Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/uuencode/uuencode.c
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | #define RW (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) | ||||
av = argv; | av = argv; | ||||
if (outfile != NULL) { | if (outfile != NULL) { | ||||
output = fopen(outfile, "w+"); | output = fopen(outfile, "w+"); | ||||
if (output == NULL) | if (output == NULL) | ||||
err(1, "unable to open %s for output", outfile); | err(1, "unable to open %s for output", outfile); | ||||
cap_rights_t out_rights; | cap_rights_t out_rights; | ||||
cap_rights_init(&out_rights, CAP_FSTAT | CAP_WRITE | CAP_SEEK ); | cap_rights_init(&out_rights, CAP_FSTAT | CAP_WRITE | CAP_SEEK ); | ||||
if (cap_rights_limit( output->_file, &out_rights )) | if (cap_rights_limit( output->_file, &out_rights )) | ||||
err(1, "unable to limit rights for %s", outfile); | err(1, "unable to limit rights for %s", outfile); | ||||
} else | } else | ||||
output = stdout; | output = stdout; | ||||
if (caph_limit_stdio() != 0) | if (caph_limit_stdio() != 0) | ||||
errx(1, "Failed to limit std{in,out,err}"); | errx(1, "Failed to limit std{in,out,err}"); | ||||
emaste: maybe just "Failed to limit stdio"? | |||||
if (cap_enter() < 0 && errno != ENOSYS) | if (cap_enter() < 0 && errno != ENOSYS) | ||||
err(1, "unable to enter capability mode"); | err(1, "unable to enter capability mode"); | ||||
if (base64) | if (base64) | ||||
base64_encode(); | base64_encode(); | ||||
else | else | ||||
encode(); | encode(); | ||||
if (ferror(output)) | if (ferror(output)) | ||||
errx(1, "write error"); | errx(1, "write error"); | ||||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |
maybe just "Failed to limit stdio"?