]> arthur.barton.de Git - netatalk.git/commitdiff
MFH: Sanitize some syslog messages.
authorjmarcus <jmarcus>
Tue, 5 Mar 2002 02:08:12 +0000 (02:08 +0000)
committerjmarcus <jmarcus>
Tue, 5 Mar 2002 02:08:12 +0000 (02:08 +0000)
etc/afpd/afp_asp.c
etc/afpd/auth.c
etc/afpd/file.c
etc/afpd/messages.c
etc/afpd/quota.c
etc/afpd/uid.c
etc/afpd/unix.c

index a06da6f4f1091b7a2b0a59467743c014cfcd4836..efb97b057b4d16b371a4db8c992c5d5e13bb2fe8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_asp.c,v 1.6.2.3 2002-02-08 02:44:05 jmarcus Exp $
+ * $Id: afp_asp.c,v 1.6.2.4 2002-03-05 02:08:12 jmarcus Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -173,7 +173,7 @@ void afp_over_asp(AFPObj *obj)
 #ifdef AFS
             if ( writtenfork ) {
                 if ( flushfork( writtenfork ) < 0 ) {
-                    syslog( LOG_ERR, "main flushfork: %m" );
+                    syslog( LOG_ERR, "main flushfork: %s", strerror(errno) );
                 }
                 writtenfork = NULL;
             }
index bee5b48a1defb40b54ae3c2823e60ef3ba676ca1..69aefb11b1cc327550fd38c4f8dfd85dd236b422 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: auth.c,v 1.19.2.2 2002-02-07 23:55:35 srittau Exp $
+ * $Id: auth.c,v 1.19.2.3 2002-03-05 02:08:12 jmarcus Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -263,7 +263,7 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void))
                 inet_ntoa( dsi->client.sin_addr ) );
 
         if (setegid( pwd->pw_gid ) < 0 || seteuid( pwd->pw_uid ) < 0) {
-            syslog( LOG_ERR, "login: %m" );
+            syslog( LOG_ERR, "login: %s", strerror(errno) );
             return AFPERR_BADUAM;
         }
     }
index cfa3545e97dcb035e4124b464b95bf51029e06b6..a55cc004e04fd9aec58188d90c72758416f35869 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.29.2.5 2002-02-09 20:29:02 jmarcus Exp $
+ * $Id: file.c,v 1.29.2.6 2002-03-05 02:08:12 jmarcus Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1386,7 +1386,7 @@ int               ibuflen, *rbuflen;
         return AFPERR_ACCESS;
         break;
     default:
-        syslog(LOG_ERR, "afp_createid: cnid_add: %m");
+        syslog(LOG_ERR, "afp_createid: cnid_add: %s", strerror(errno));
         return AFPERR_PARAM;
     }
 }
index bf4e6c847b4c475eb18b78250e88245b43d5b77d..b6471816cda9c9f3284c27d2ee5483e135646a2e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: messages.c,v 1.9.2.2 2002-01-02 17:27:50 srittau Exp $
+ * $Id: messages.c,v 1.9.2.3 2002-03-05 02:08:12 jmarcus Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -71,18 +71,18 @@ void readmessage(void)
         /* Delete will probably fail otherwise, but let's try anyways */
         euid = geteuid();
         if (seteuid(0) < 0) {
-            syslog(LOG_ERR, "Could not switch back to root: %m");
+            syslog(LOG_ERR, "Could not switch back to root: %s", strerror(errno));
         }
 
         rc = unlink(filename);
 
         /* Drop privs again, failing this is very bad */
         if (seteuid(euid) < 0) {
-            syslog(LOG_ERR, "Could not switch back to uid %d: %m", euid);
+            syslog(LOG_ERR, "Could not switch back to uid %d: %s", euid, strerror(errno));
         }
 
         if (rc < 0) {
-            syslog (LOG_ERR, "Error deleting %s: %m", filename);
+            syslog (LOG_ERR, "Error deleting %s: %s", filename, strerror(rc));
         }
 #ifdef DEBUG
         else {
index 466d8344d484d98ccbac7c3ff4c32e51f03f5f06..a43d2bb66a57daf227d6971c37c1e919099502b5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: quota.c,v 1.11.2.4 2002-02-08 02:57:26 jmarcus Exp $
+ * $Id: quota.c,v 1.11.2.5 2002-03-05 02:08:12 jmarcus Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -115,7 +115,7 @@ int  *nfs;
     static struct fs_data      fsd;
 
     if ( getmnt(0, &fsd, 0, STAT_ONE, file ) < 0 ) {
-        syslog(LOG_INFO, "special: getmnt %s: %m", file );
+        syslog(LOG_INFO, "special: getmnt %s: %s", file, strerror(errno) );
         return( NULL );
     }
 
@@ -316,7 +316,7 @@ const u_int32_t     bsize;
 
         if (vol->v_nfs) {
             if (( vol->v_gvs = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
-                syslog( LOG_ERR, "getquota: malloc: %m" );
+                syslog( LOG_ERR, "getquota: malloc: %s", strerror(errno));
                 return AFPERR_MISC;
             }
             strcpy( vol->v_gvs, p );
@@ -324,7 +324,7 @@ const u_int32_t     bsize;
         } else {
             sprintf( buf, "%s/quotas", p );
             if (( vol->v_qfd = open( buf, O_RDONLY, 0 )) < 0 ) {
-                syslog( LOG_INFO, "open %s: %m", buf );
+                syslog( LOG_INFO, "open %s: %s", buf, strerror(errno) );
                 return( AFPERR_PARAM );
             }
         }
index 3758f4d5b326928a4318e09ac3af7533f7e3a1d0..f5ab4bf2e15412f2ae926b590f8205bd6c5eb087 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uid.c,v 1.5.2.1 2001-12-03 05:01:04 jmarcus Exp $
+ * $Id: uid.c,v 1.5.2.2 2002-03-05 02:08:12 jmarcus Exp $
  * code: jeff@univrel.pr.uconn.edu
  *
  * These functions are abstracted here, so that all calls for resolving
@@ -42,11 +42,11 @@ void restore_uidgid ( pair )
 uidgidset **pair;
 {
     if ( seteuid ( (*pair)->uid ) < 0 )
-        syslog ( LOG_ERR, "restore_uidgid: unable to seteuid '%s': %m",
-                 (*pair)->uid );
+        syslog ( LOG_ERR, "restore_uidgid: unable to seteuid '%s': %s",
+                 (*pair)->uid, strerror(errno) );
     if ( setegid ( (*pair)->gid ) < 0 )
-        syslog ( LOG_ERR, "restore_uidgid: unable to setegid '%s': %m",
-                 (*pair)->gid );
+        syslog ( LOG_ERR, "restore_uidgid: unable to setegid '%s': %s",
+                 (*pair)->gid, strerror(errno) );
 } /* end function void restore_uidgid ( pair ) */
 
 void set_uidgid ( this_volume )
@@ -57,15 +57,15 @@ const struct vol    *this_volume;
     /* check to see if we have to switch users */
     if ( uid = user_to_uid ( (this_volume)->v_forceuid ) ) {
         if ( seteuid ( uid ) < 0 )
-            syslog ( LOG_ERR, "set_uidgid: unable to seteuid '%s': %m",
-                     (this_volume)->v_forceuid );
+            syslog ( LOG_ERR, "set_uidgid: unable to seteuid '%s': %s",
+                     (this_volume)->v_forceuid, strerror(errno) );
     } /* end of checking for (this_volume)->v_forceuid */
 
     /* check to see if we have to switch groups */
     if ( gid = group_to_gid ( (this_volume)->v_forcegid ) ) {
         if ( seteuid ( gid ) < 0 )
-            syslog ( LOG_ERR, "set_uidgid: unable to setegid '%s': %m",
-                     (this_volume)->v_forcegid );
+            syslog ( LOG_ERR, "set_uidgid: unable to setegid '%s': %s",
+                     (this_volume)->v_forcegid, strerror(errno) );
     } /* end of checking for (this_volume)->v_forcegid */
 
 } /* end function void set_uidgid ( username, group ) */
index 8f6972f16aec5598a5fa4d5bc8f0b9d84e500d9a..b7995f73b57ccb0a6b2867994fa3817b4885977d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unix.c,v 1.24.2.2 2001-12-15 06:32:14 jmarcus Exp $
+ * $Id: unix.c,v 1.24.2.3 2002-03-05 02:08:12 jmarcus Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -232,14 +232,14 @@ const int dropbox;
             else { /* if S_IWOTH and not S_IROTH */
                 uid=geteuid();
                 if ( seteuid(0) < 0) {
-                    syslog( LOG_ERR, "stickydirmode: unable to seteuid root: %m");
+                    syslog( LOG_ERR, "stickydirmode: unable to seteuid root: %s", strerror(errno));
                 }
                 if ( retval=chmod( name, ( (DIRBITS | mode | S_ISVTX) & 0777 & ~default_options.umask) ) < 0) {
-                    syslog( LOG_ERR, "stickydirmode: chmod \"%s\": %m", name );
+                    syslog( LOG_ERR, "stickydirmode: chmod \"%s\": %s", name, strerror(retval) );
                     return(AFPERR_ACCESS);
                 } else {
 #ifdef DEBUG
-                    syslog( LOG_INFO, "stickydirmode: (debug) chmod \"%s\": %m", name );
+                    syslog( LOG_INFO, "stickydirmode: (debug) chmod \"%s\"", name );
 #endif /* DEBUG */
                     seteuid(uid);
                 } /* end getting retval */