| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: quota.c,v 1.39 2011/11/27 13:23:50 dholland Exp $ */ | | 1 | /* $NetBSD: quota.c,v 1.40 2011/11/27 13:24:32 dholland Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1980, 1990, 1993 | | 4 | * Copyright (c) 1980, 1990, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Robert Elz at The University of Melbourne. | | 8 | * Robert Elz at The University of Melbourne. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -32,27 +32,27 @@ | | | @@ -32,27 +32,27 @@ |
32 | * SUCH DAMAGE. | | 32 | * SUCH DAMAGE. |
33 | */ | | 33 | */ |
34 | | | 34 | |
35 | #include <sys/cdefs.h> | | 35 | #include <sys/cdefs.h> |
36 | #ifndef lint | | 36 | #ifndef lint |
37 | __COPYRIGHT("@(#) Copyright (c) 1980, 1990, 1993\ | | 37 | __COPYRIGHT("@(#) Copyright (c) 1980, 1990, 1993\ |
38 | The Regents of the University of California. All rights reserved."); | | 38 | The Regents of the University of California. All rights reserved."); |
39 | #endif /* not lint */ | | 39 | #endif /* not lint */ |
40 | | | 40 | |
41 | #ifndef lint | | 41 | #ifndef lint |
42 | #if 0 | | 42 | #if 0 |
43 | static char sccsid[] = "@(#)quota.c 8.4 (Berkeley) 4/28/95"; | | 43 | static char sccsid[] = "@(#)quota.c 8.4 (Berkeley) 4/28/95"; |
44 | #else | | 44 | #else |
45 | __RCSID("$NetBSD: quota.c,v 1.39 2011/11/27 13:23:50 dholland Exp $"); | | 45 | __RCSID("$NetBSD: quota.c,v 1.40 2011/11/27 13:24:32 dholland Exp $"); |
46 | #endif | | 46 | #endif |
47 | #endif /* not lint */ | | 47 | #endif /* not lint */ |
48 | | | 48 | |
49 | /* | | 49 | /* |
50 | * Disk quota reporting program. | | 50 | * Disk quota reporting program. |
51 | */ | | 51 | */ |
52 | #include <sys/param.h> | | 52 | #include <sys/param.h> |
53 | #include <sys/types.h> | | 53 | #include <sys/types.h> |
54 | #include <sys/file.h> | | 54 | #include <sys/file.h> |
55 | #include <sys/stat.h> | | 55 | #include <sys/stat.h> |
56 | #include <sys/mount.h> | | 56 | #include <sys/mount.h> |
57 | #include <sys/socket.h> | | 57 | #include <sys/socket.h> |
58 | | | 58 | |
| @@ -82,27 +82,27 @@ struct quotause { | | | @@ -82,27 +82,27 @@ struct quotause { |
82 | struct quotaval qv[QUOTA_NLIMITS]; | | 82 | struct quotaval qv[QUOTA_NLIMITS]; |
83 | char fsname[MAXPATHLEN + 1]; | | 83 | char fsname[MAXPATHLEN + 1]; |
84 | }; | | 84 | }; |
85 | #define FOUND 0x01 | | 85 | #define FOUND 0x01 |
86 | #define QUOTA2 0x02 | | 86 | #define QUOTA2 0x02 |
87 | | | 87 | |
88 | static struct quotause *getprivs(id_t, int); | | 88 | static struct quotause *getprivs(id_t, int); |
89 | static void heading(int, id_t, const char *, const char *); | | 89 | static void heading(int, id_t, const char *, const char *); |
90 | static void showgid(gid_t); | | 90 | static void showgid(gid_t); |
91 | static void showgrpname(const char *); | | 91 | static void showgrpname(const char *); |
92 | static void showquotas(int, id_t, const char *); | | 92 | static void showquotas(int, id_t, const char *); |
93 | static void showuid(uid_t); | | 93 | static void showuid(uid_t); |
94 | static void showusrname(const char *); | | 94 | static void showusrname(const char *); |
95 | static void usage(void) __attribute__((__noreturn__)); | | 95 | static void usage(void) __dead; |
96 | | | 96 | |
97 | static int qflag = 0; | | 97 | static int qflag = 0; |
98 | static int vflag = 0; | | 98 | static int vflag = 0; |
99 | static int hflag = 0; | | 99 | static int hflag = 0; |
100 | static int dflag = 0; | | 100 | static int dflag = 0; |
101 | static int Dflag = 0; | | 101 | static int Dflag = 0; |
102 | static uid_t myuid; | | 102 | static uid_t myuid; |
103 | | | 103 | |
104 | int | | 104 | int |
105 | main(int argc, char *argv[]) | | 105 | main(int argc, char *argv[]) |
106 | { | | 106 | { |
107 | int ngroups; | | 107 | int ngroups; |
108 | gid_t mygid, gidset[NGROUPS]; | | 108 | gid_t mygid, gidset[NGROUPS]; |