From: jmarcus Date: Tue, 5 Mar 2002 02:08:12 +0000 (+0000) Subject: MFH: Sanitize some syslog messages. X-Git-Tag: netatalk-1-5-3~52 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=41faf6f55c9b33c992940bf2a8f5c4d62bb2939d MFH: Sanitize some syslog messages. --- diff --git a/etc/afpd/afp_asp.c b/etc/afpd/afp_asp.c index a06da6f4..efb97b05 100644 --- a/etc/afpd/afp_asp.c +++ b/etc/afpd/afp_asp.c @@ -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; } diff --git a/etc/afpd/auth.c b/etc/afpd/auth.c index bee5b48a..69aefb11 100644 --- a/etc/afpd/auth.c +++ b/etc/afpd/auth.c @@ -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; } } diff --git a/etc/afpd/file.c b/etc/afpd/file.c index cfa3545e..a55cc004 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -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; } } diff --git a/etc/afpd/messages.c b/etc/afpd/messages.c index bf4e6c84..b6471816 100644 --- a/etc/afpd/messages.c +++ b/etc/afpd/messages.c @@ -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 { diff --git a/etc/afpd/quota.c b/etc/afpd/quota.c index 466d8344..a43d2bb6 100644 --- a/etc/afpd/quota.c +++ b/etc/afpd/quota.c @@ -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 ); } } diff --git a/etc/afpd/uid.c b/etc/afpd/uid.c index 3758f4d5..f5ab4bf2 100644 --- a/etc/afpd/uid.c +++ b/etc/afpd/uid.c @@ -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 ) */ diff --git a/etc/afpd/unix.c b/etc/afpd/unix.c index 8f6972f1..b7995f73 100644 --- a/etc/afpd/unix.c +++ b/etc/afpd/unix.c @@ -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 */