1303 files changed, 32187 insertions, 57138 deletions
diff --git a/printutils/lpd.c b/printutils/lpd.c index 642e8a8..8823934 100644 --- a/printutils/lpd.c +++ b/printutils/lpd.c @@ -69,6 +69,15 @@ * cat ./"$DATAFILE" >/dev/lp0 * mv -f ./"$DATAFILE" save/ */ +//config:config LPD +//config: bool "lpd" +//config: default y +//config: help +//config: lpd is a print spooling daemon. + +//applet:IF_LPD(APPLET(lpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_LPD) += lpd.o //usage:#define lpd_trivial_usage //usage: "SPOOLDIR [HELPER [ARGS]]" @@ -200,15 +209,15 @@ int lpd_main(int argc UNUSED_PARAM, char *argv[]) if (2 != s[0] && 3 != s[0]) goto unsupported_cmd; if (spooling & (1 << (s[0]-1))) { - printf("Duplicated subcommand\n"); + puts("Duplicated subcommand"); goto err_exit; } // get filename - *strchrnul(s, '\n') = '\0'; + chomp(s); fname = strchr(s, ' '); if (!fname) { // bad_fname: - printf("No or bad filename\n"); + puts("No or bad filename"); goto err_exit; } *fname++ = '\0'; @@ -219,13 +228,13 @@ int lpd_main(int argc UNUSED_PARAM, char *argv[]) // get length expected_len = bb_strtou(s + 1, NULL, 10); if (errno || expected_len < 0) { - printf("Bad length\n"); + puts("Bad length"); goto err_exit; } if (2 == s[0] && expected_len > 16 * 1024) { // SECURITY: // ctrlfile can't be big (we want to read it back later!) - printf("File is too big\n"); + puts("File is too big"); goto err_exit; } |