version 1.19, 2002/02/17 19:42:31 |
version 1.20, 2002/05/14 12:24:10 |
|
|
*/ |
*/ |
|
|
#ifndef lint |
#ifndef lint |
static char copyright[] = |
static const char copyright[] = |
"@(#) Copyright (c) 1980, 1990, 1993\n\ |
"@(#) Copyright (c) 1980, 1990, 1993\n\ |
The Regents of the University of California. All rights reserved.\n"; |
The Regents of the University of California. All rights reserved.\n"; |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
#ifndef lint |
#ifndef lint |
/*static char sccsid[] = "from: @(#)quota.c 8.1 (Berkeley) 6/6/93";*/ |
/*static char sccsid[] = "from: @(#)quota.c 8.1 (Berkeley) 6/6/93";*/ |
static char rcsid[] = "$OpenBSD$"; |
static const char rcsid[] = |
|
"$OpenBSD$"; |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
/* |
/* |
|
|
|
|
int alldigits(char *); |
int alldigits(char *); |
int callaurpc(char *, int, int, int, xdrproc_t, void *, xdrproc_t, void *); |
int callaurpc(char *, int, int, int, xdrproc_t, void *, xdrproc_t, void *); |
int main(int, char **); |
|
int getnfsquota(struct statfs *, struct fstab *, struct quotause *, |
int getnfsquota(struct statfs *, struct fstab *, struct quotause *, |
long, int); |
long, int); |
struct quotause *getprivs(long id, int quotatype); |
struct quotause |
|
*getprivs(long id, int quotatype); |
int getufsquota(struct statfs *, struct fstab *, struct quotause *, |
int getufsquota(struct statfs *, struct fstab *, struct quotause *, |
long, int); |
long, int); |
void heading(int, u_long, const char *, const char *); |
void heading(int, u_long, const char *, const char *); |
|
|
exit(0); |
exit(0); |
} |
} |
/* NOTREACHED */ |
/* NOTREACHED */ |
|
|
|
exit(1); |
} |
} |
|
|
void |
void |
|
|
} |
} |
myuid = getuid(); |
myuid = getuid(); |
if (pwd->pw_uid != myuid && myuid != 0) { |
if (pwd->pw_uid != myuid && myuid != 0) { |
warnx("%s (uid %u): permission denied", pwd->pw_name, pwd->pw_uid); |
warnx("%s (uid %u): permission denied", pwd->pw_name, |
|
pwd->pw_uid); |
return; |
return; |
} |
} |
showquotas(USRQUOTA, pwd->pw_uid, pwd->pw_name); |
showquotas(USRQUOTA, pwd->pw_uid, pwd->pw_name); |
|
|
setfsent(); |
setfsent(); |
for (i = 0; i < nfst; i++) { |
for (i = 0; i < nfst; i++) { |
if (qup == NULL) { |
if (qup == NULL) { |
if ((qup = (struct quotause *)malloc(sizeof *qup)) == NULL) |
if ((qup = |
|
(struct quotause *)malloc(sizeof *qup)) == NULL) |
errx(2, "out of memory"); |
errx(2, "out of memory"); |
} |
} |
if (strncmp(fst[i].f_fstypename, "nfs", MFSNAMELEN) == 0) { |
if (strncmp(fst[i].f_fstypename, "nfs", MFSNAMELEN) == 0) { |