=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sudo/Attic/logging.c,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** src/usr.bin/sudo/Attic/logging.c 2002/06/12 06:07:16 1.8 --- src/usr.bin/sudo/Attic/logging.c 2003/03/15 21:23:54 1.9 *************** *** 1,5 **** /* ! * Copyright (c) 1994-1996,1998-2001 Todd C. Miller * All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 1,5 ---- /* ! * Copyright (c) 1994-1996,1998-2003 Todd C. Miller * All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 65,71 **** #include "sudo.h" #ifndef lint ! static const char rcsid[] = "$Sudo: logging.c,v 1.153 2002/01/16 21:28:25 millert Exp $"; #endif /* lint */ static void do_syslog __P((int, char *)); --- 65,71 ---- #include "sudo.h" #ifndef lint ! static const char rcsid[] = "$Sudo: logging.c,v 1.157 2003/03/15 20:31:02 millert Exp $"; #endif /* lint */ static void do_syslog __P((int, char *)); *************** *** 137,143 **** int pri; char *msg; { ! int count; char *p; char *tmp; char save; --- 137,143 ---- int pri; char *msg; { ! size_t count; char *p; char *tmp; char save; *************** *** 188,196 **** char *beg, *oldend, *end; FILE *fp; mode_t oldmask; ! int maxlen = def_ival(I_LOGLINELEN); oldmask = umask(077); fp = fopen(def_str(I_LOGFILE), "a"); (void) umask(oldmask); if (fp == NULL) { --- 188,197 ---- char *beg, *oldend, *end; FILE *fp; mode_t oldmask; ! size_t maxlen; oldmask = umask(077); + maxlen = def_ival(I_LOGLINELEN) > 0 ? def_ival(I_LOGLINELEN) : 0; fp = fopen(def_str(I_LOGFILE), "a"); (void) umask(oldmask); if (fp == NULL) { *************** *** 365,371 **** /* Become root if we are not already to avoid user control */ if (geteuid() != 0) ! set_perms(PERM_ROOT, 0); /* Expand printf-style format + args. */ evasprintf(&message, fmt, ap); --- 366,372 ---- /* Become root if we are not already to avoid user control */ if (geteuid() != 0) ! set_perms(PERM_ROOT); /* Expand printf-style format + args. */ evasprintf(&message, fmt, ap); *************** *** 508,517 **** * (so user cannot kill it) or as the user (for the paranoid). */ #ifndef NO_ROOT_MAILER ! set_perms(PERM_FULL_ROOT, 0); execve(mpath, argv, root_envp); #else ! set_perms(PERM_FULL_USER, 0); execv(mpath, argv); #endif /* NO_ROOT_MAILER */ _exit(127); --- 509,518 ---- * (so user cannot kill it) or as the user (for the paranoid). */ #ifndef NO_ROOT_MAILER ! set_perms(PERM_FULL_ROOT); execve(mpath, argv, root_envp); #else ! set_perms(PERM_FULL_USER); execv(mpath, argv); #endif /* NO_ROOT_MAILER */ _exit(127);