BusyBox Bug and Patch Tracking
BusyBox
  

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

- Relationships

- Notes
(0001985)
vda
01-12-07 14:28

Fixed prior to rev 17263, thanks
 

- Issue History
Date Modified Username Field Change
01-12-07 11:26 espakman New Issue
01-12-07 11:26 espakman Status new => assigned
01-12-07 11:26 espakman Assigned To  => BusyBox
01-12-07 14:28 vda Status assigned => closed
01-12-07 14:28 vda Note Added: 0001985
01-12-07 14:28 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker