diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1996-10-28 04:08:22 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1996-10-28 04:08:22 +0000 |
commit | 1a1dcd8f0e979a890261ce36802e39fee062352a (patch) | |
tree | 7aa1785c3d07f7f33dca02d4e65acc58aa66b03f | |
parent | 21cedb92ab0aa4a4e51fdb421cc0afdd04823793 (diff) |
Be more paranoid about passing around user/group name from argv.
-rw-r--r-- | usr.bin/quota/quota.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c index 008bf2364de..666c78454e7 100644 --- a/usr.bin/quota/quota.c +++ b/usr.bin/quota/quota.c @@ -1,4 +1,4 @@ -/* $OpenBSD: quota.c,v 1.7 1996/08/07 14:08:52 etheisen Exp $ */ +/* $OpenBSD: quota.c,v 1.8 1996/10/28 04:08:21 millert Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -44,7 +44,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)quota.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: quota.c,v 1.7 1996/08/07 14:08:52 etheisen Exp $"; +static char rcsid[] = "$OpenBSD: quota.c,v 1.8 1996/10/28 04:08:21 millert Exp $"; #endif /* not lint */ /* @@ -207,10 +207,10 @@ showusrname(name) myuid = getuid(); if (pwd->pw_uid != myuid && myuid != 0) { fprintf(stderr, "quota: %s (uid %d): permission denied\n", - name, pwd->pw_uid); + pwd->pw_name, pwd->pw_uid); return; } - showquotas(USRQUOTA, pwd->pw_uid, name); + showquotas(USRQUOTA, pwd->pw_uid, pwd->pw_name); } /* @@ -277,11 +277,11 @@ showgrpname(name) if (i >= ngroups && getuid() != 0) { fprintf(stderr, "quota: %s (gid %d): permission denied\n", - name, grp->gr_gid); + grp->gr_name, grp->gr_gid); return; } } - showquotas(GRPQUOTA, grp->gr_gid, name); + showquotas(GRPQUOTA, grp->gr_gid, grp->gr_name); } showquotas(type, id, name) |