aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/quota
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2003-06-15 06:54:36 +0000
committerRobert Watson <rwatson@FreeBSD.org>2003-06-15 06:54:36 +0000
commitaee1b42ab6a40c51142f9204c9304e179805d871 (patch)
tree9df0a2d4ff8f76facfe5c172f5ef8eb8525acf0a /usr.bin/quota
parent41b0d1a0645b48312e410f5595c017bfd98c5fe1 (diff)
downloadsrc-aee1b42ab6a40c51142f9204c9304e179805d871.tar.gz
src-aee1b42ab6a40c51142f9204c9304e179805d871.zip
Notes
Diffstat (limited to 'usr.bin/quota')
-rw-r--r--usr.bin/quota/quota.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c
index d30184f91fb1..a2b89ec749a9 100644
--- a/usr.bin/quota/quota.c
+++ b/usr.bin/quota/quota.c
@@ -197,14 +197,12 @@ static void
showuid(u_long uid)
{
struct passwd *pwd = getpwuid(uid);
- u_long myuid;
const char *name;
if (pwd == NULL)
name = "(no account)";
else
name = pwd->pw_name;
- myuid = getuid();
showquotas(USRQUOTA, uid, name);
}
@@ -215,13 +213,11 @@ static void
showusrname(char *name)
{
struct passwd *pwd = getpwnam(name);
- u_long myuid;
if (pwd == NULL) {
warnx("%s: unknown user", name);
return;
}
- myuid = getuid();
showquotas(USRQUOTA, pwd->pw_uid, name);
}
@@ -232,26 +228,12 @@ static void
showgid(u_long gid)
{
struct group *grp = getgrgid(gid);
- int ngroups;
- gid_t mygid, gidset[NGROUPS];
- int i;
const char *name;
if (grp == NULL)
name = "(no entry)";
else
name = grp->gr_name;
- mygid = getgid();
- ngroups = getgroups(NGROUPS, gidset);
- if (ngroups < 0) {
- warn("getgroups");
- return;
- }
- if (gid != mygid) {
- for (i = 0; i < ngroups; i++)
- if (gid == gidset[i])
- break;
- }
showquotas(GRPQUOTA, gid, name);
}
@@ -262,25 +244,11 @@ static void
showgrpname(char *name)
{
struct group *grp = getgrnam(name);
- int ngroups;
- gid_t mygid, gidset[NGROUPS];
- int i;
if (grp == NULL) {
warnx("%s: unknown group", name);
return;
}
- mygid = getgid();
- ngroups = getgroups(NGROUPS, gidset);
- if (ngroups < 0) {
- warn("getgroups");
- return;
- }
- if (grp->gr_gid != mygid) {
- for (i = 0; i < ngroups; i++)
- if (grp->gr_gid == gidset[i])
- break;
- }
showquotas(GRPQUOTA, grp->gr_gid, name);
}