Index: share/mk/bsd.lib.mk =================================================================== --- share/mk/bsd.lib.mk +++ share/mk/bsd.lib.mk @@ -200,8 +200,8 @@ .endif .if defined(LLVM_LINK) -BCOBJS= ${OBJS:.o=.bco} ${STATICOBJS:.o=.bco} -LLOBJS= ${OBJS:.o=.llo} ${STATICOBJS:.o=.llo} +BCOBJS= ${SRCS:N*.h:N*.S:R:S/$/.bco/} ${STATICOBJS:.o=.bco} +LLOBJS= ${SRCS:N*.h:N*.S:R:S/$/.llo/} ${STATICOBJS:.o=.llo} CLEANFILES+= ${BCOBJS} ${LLOBJS} lib${LIB_PRIVATE}${LIB}.bc: ${BCOBJS} Index: usr.bin/uuencode/uuencode.c =================================================================== --- usr.bin/uuencode/uuencode.c +++ usr.bin/uuencode/uuencode.c @@ -46,13 +46,16 @@ * * Encode a file so it can be mailed to a remote system. */ +#include #include #include #include #include +#include #include +#include #include #include #include @@ -125,8 +128,21 @@ output = fopen(outfile, "w+"); if (output == NULL) err(1, "unable to open %s for output", outfile); + + cap_rights_t out_rights; + cap_rights_init(&out_rights, CAP_FSTAT | CAP_WRITE | CAP_SEEK ); + if (cap_rights_limit( output->_file, &out_rights )) + err(1, "unable to limit rights for %s", outfile); } else output = stdout; + + + if (caph_limit_stdio() != 0) + errx(1, "Failed to limit std{in,out,err}"); + + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + if (base64) base64_encode(); else