Deleted Added
full compact
edquota.c (99820) edquota.c (101546)
1/*
2 * Copyright (c) 1980, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Robert Elz at The University of Melbourne.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 31 unchanged lines hidden (view full) ---

40 The Regents of the University of California. All rights reserved.\n";
41#endif /* not lint */
42
43#ifndef lint
44#if 0
45static char sccsid[] = "@(#)edquota.c 8.1 (Berkeley) 6/6/93";
46#endif
47static const char rcsid[] =
1/*
2 * Copyright (c) 1980, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Robert Elz at The University of Melbourne.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 31 unchanged lines hidden (view full) ---

40 The Regents of the University of California. All rights reserved.\n";
41#endif /* not lint */
42
43#ifndef lint
44#if 0
45static char sccsid[] = "@(#)edquota.c 8.1 (Berkeley) 6/6/93";
46#endif
47static const char rcsid[] =
48 "$FreeBSD: head/usr.sbin/edquota/edquota.c 99820 2002-07-11 21:18:55Z alfred $";
48 "$FreeBSD: head/usr.sbin/edquota/edquota.c 101546 2002-08-09 01:21:03Z iedowse $";
49#endif /* not lint */
50
51/*
52 * Disk quota editor.
53 */
54#include <sys/param.h>
55#include <sys/stat.h>
56#include <sys/file.h>

--- 85 unchanged lines hidden (view full) ---

142 if (pflag) {
143 if ((protoid = getentry(protoname, quotatype)) == -1)
144 exit(1);
145 protoprivs = getprivs(protoid, quotatype, fspath);
146 for (qup = protoprivs; qup; qup = qup->next) {
147 qup->dqblk.dqb_btime = 0;
148 qup->dqblk.dqb_itime = 0;
149 }
49#endif /* not lint */
50
51/*
52 * Disk quota editor.
53 */
54#include <sys/param.h>
55#include <sys/stat.h>
56#include <sys/file.h>

--- 85 unchanged lines hidden (view full) ---

142 if (pflag) {
143 if ((protoid = getentry(protoname, quotatype)) == -1)
144 exit(1);
145 protoprivs = getprivs(protoid, quotatype, fspath);
146 for (qup = protoprivs; qup; qup = qup->next) {
147 qup->dqblk.dqb_btime = 0;
148 qup->dqblk.dqb_itime = 0;
149 }
150 while (argc-- > 0) {
151 if (isdigit(*argv[0]) &&
150 for (; argc-- > 0; argv++) {
151 if (strspn(*argv, "0123456789-") == strlen(*argv) &&
152 (cp = strchr(*argv, '-')) != NULL) {
153 *cp++ = '\0';
154 startuid = atoi(*argv);
155 enduid = atoi(cp);
156 if (enduid < startuid)
157 errx(1,
158 "ending uid (%d) must be >= starting uid (%d) when using uid ranges",
159 enduid, startuid);
160 for ( ; startuid <= enduid; startuid++) {
161 snprintf(buf, sizeof(buf), "%d",
162 startuid);
163 if ((id = getentry(buf, quotatype)) < 0)
164 continue;
165 putprivs(id, quotatype, protoprivs);
166 }
167 continue;
168 }
152 (cp = strchr(*argv, '-')) != NULL) {
153 *cp++ = '\0';
154 startuid = atoi(*argv);
155 enduid = atoi(cp);
156 if (enduid < startuid)
157 errx(1,
158 "ending uid (%d) must be >= starting uid (%d) when using uid ranges",
159 enduid, startuid);
160 for ( ; startuid <= enduid; startuid++) {
161 snprintf(buf, sizeof(buf), "%d",
162 startuid);
163 if ((id = getentry(buf, quotatype)) < 0)
164 continue;
165 putprivs(id, quotatype, protoprivs);
166 }
167 continue;
168 }
169 if ((id = getentry(*argv++, quotatype)) < 0)
169 if ((id = getentry(*argv, quotatype)) < 0)
170 continue;
171 putprivs(id, quotatype, protoprivs);
172 }
173 exit(0);
174 }
175 tmpfd = mkstemp(tmpfil);
176 fchown(tmpfd, getuid(), getgid());
177 if (tflag) {

--- 591 unchanged lines hidden ---
170 continue;
171 putprivs(id, quotatype, protoprivs);
172 }
173 exit(0);
174 }
175 tmpfd = mkstemp(tmpfil);
176 fchown(tmpfd, getuid(), getgid());
177 if (tflag) {

--- 591 unchanged lines hidden ---