Anonymous | Login | Signup for a new account | 11-10-2008 11:09 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0001158 | [BusyBox] Other | minor | always | 01-12-07 11:26 | 01-12-07 14:28 | ||||
Reporter | espakman | View Status | public | ||||||
Assigned To | BusyBox | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | svn | ||||||
Summary | 0001158: logger truncates user names | ||||||||
Description |
The logger applet truncates usernames. Example (as user "root"): ./busybox logger "test" Contents of the logfile: Jan 12 19:11:45 enterprise roo: test The fix is simple but ugly: diff -urpN busybox.orig/sysklogd/logger.c busybox/sysklogd/logger.c --- busybox.orig/sysklogd/logger.c 2007-01-12 09:20:07.000000000 +0100 +++ busybox/sysklogd/logger.c 2007-01-12 20:12:52.000000000 +0100 @@ -88,7 +88,7 @@ int logger_main(int argc, char **argv) RESERVE_CONFIG_BUFFER(name, 80); /* Fill out the name string early (may be overwritten later) */ - bb_getpwuid(name, geteuid(), sizeof(name)); + bb_getpwuid(name, geteuid(), 80); /* Parse any options */ getopt32(argc, argv, "p:st:", &opt_p, &opt_t); @@ -96,7 +96,7 @@ int logger_main(int argc, char **argv) if (option_mask32 & 0x2) /* -s */ i |= LOG_PERROR; if (option_mask32 & 0x4) /* -t */ - safe_strncpy(name, opt_t, sizeof(name)); + safe_strncpy(name, opt_t, 80); openlog(name, i, 0); if (ENABLE_FEATURE_CLEAN_UP) RELEASE_CONFIG_BUFFER(name); It looks like the use of RESERVE_CONFIG_BUFFER and sizeof() is mutual exclusive. |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Copyright © 2000 - 2006 Mantis Group |