[BACK]Return to logging.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sudo

Diff for /src/usr.bin/sudo/Attic/logging.c between version 1.8 and 1.9

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

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9