FreeBSD Bugzilla – Attachment 16890 Details for
Bug 30816
usr.sbin/edquota new option [-f]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 4.03 KB, created by
Dmitry Morozovsky
on 2001-09-25 15:30:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Dmitry Morozovsky
Created:
2001-09-25 15:30:00 UTC
Size:
4.03 KB
patch
obsolete
>Index: edquota.8 >=================================================================== >RCS file: /home/ncvs/src/usr.sbin/edquota/edquota.8,v >retrieving revision 1.9.2.1 >diff -u -r1.9.2.1 edquota.8 >--- edquota.8 2000/12/08 15:28:04 1.9.2.1 >+++ edquota.8 2001/09/24 18:19:51 >@@ -44,18 +44,22 @@ > .Sh SYNOPSIS > .Nm > .Op Fl u >+.Op Fl f Ar fspath > .Op Fl p Ar proto-username > .Ar username ... > .Nm > .Fl g >+.Op Fl f Ar fspath > .Op Fl p Ar proto-groupname > .Ar groupname ... > .Nm > .Fl t > .Op Fl u >+.Op Fl f Ar fspath > .Nm > .Fl t > .Fl g >+.Op Fl f Ar fspath > .Sh DESCRIPTION > .Nm Edquota > is a quota editor. >@@ -90,6 +94,15 @@ > below). > The current usage information in the file is for informational purposes; > only the hard and soft limits can be changed. >+.Pp >+If the >+.Fl f >+option is specified, >+.Nm >+reads and edits quotas only for specified fylesystem. Parameter to >+.Fl f >+option may be either special device or mount point of the filesystem >+selected. > .Pp > On leaving the editor, > .Nm >Index: edquota.c >=================================================================== >RCS file: /home/ncvs/src/usr.sbin/edquota/edquota.c,v >retrieving revision 1.9.2.1 >diff -u -r1.9.2.1 edquota.c >--- edquota.c 2000/10/28 02:22:59 1.9.2.1 >+++ edquota.c 2001/09/24 18:19:51 >@@ -89,7 +89,7 @@ > int editit __P((char *)); > void freeprivs __P((struct quotause *)); > int getentry __P((char *, int)); >-struct quotause *getprivs __P((long, int)); >+struct quotause *getprivs __P((long, int, char *)); > int hasquota __P((struct fstab *, int, char **)); > void putprivs __P((long, int, struct quotause *)); > int readprivs __P((struct quotause *, char *)); >@@ -109,6 +109,7 @@ > register uid_t startuid, enduid; > char *protoname, *cp, ch; > int tflag = 0, pflag = 0; >+ char *fspath = NULL; > char buf[30]; > > if (argc < 2) >@@ -116,8 +117,11 @@ > if (getuid()) > errx(1, "permission denied"); > quotatype = USRQUOTA; >- while ((ch = getopt(argc, argv, "ugtp:")) != -1) { >+ while ((ch = getopt(argc, argv, "ugtf:p:")) != -1) { > switch(ch) { >+ case 'f': >+ fspath = optarg; >+ break; > case 'p': > protoname = optarg; > pflag++; >@@ -140,7 +144,7 @@ > if (pflag) { > if ((protoid = getentry(protoname, quotatype)) == -1) > exit(1); >- protoprivs = getprivs(protoid, quotatype); >+ protoprivs = getprivs(protoid, quotatype, fspath); > for (qup = protoprivs; qup; qup = qup->next) { > qup->dqblk.dqb_btime = 0; > qup->dqblk.dqb_itime = 0; >@@ -173,7 +177,7 @@ > tmpfd = mkstemp(tmpfil); > fchown(tmpfd, getuid(), getgid()); > if (tflag) { >- protoprivs = getprivs(0, quotatype); >+ protoprivs = getprivs(0, quotatype, fspath); > if (writetimes(protoprivs, tmpfd, quotatype) == 0) > exit(1); > if (editit(tmpfil) && readtimes(protoprivs, tmpfil)) >@@ -186,7 +190,7 @@ > for ( ; argc > 0; argc--, argv++) { > if ((id = getentry(*argv, quotatype)) == -1) > continue; >- curprivs = getprivs(id, quotatype); >+ curprivs = getprivs(id, quotatype, fspath); > if (writeprivs(curprivs, tmpfd, *argv, quotatype) == 0) > continue; > if (editit(tmpfil) && readprivs(curprivs, tmpfil)) >@@ -202,10 +206,10 @@ > usage() > { > fprintf(stderr, "%s\n%s\n%s\n%s\n", >- "usage: edquota [-u] [-p username] username ...", >- " edquota -g [-p groupname] groupname ...", >- " edquota [-u] -t", >- " edquota -g -t"); >+ "usage: edquota [-u] [-f fspath] [-p username] username ...", >+ " edquota -g [-f fspath] [-p groupname] groupname ...", >+ " edquota [-u] -t [-f fspath]", >+ " edquota -g -t [-f fspath]"); > exit(1); > } > >@@ -247,9 +251,10 @@ > * Collect the requested quota information. > */ > struct quotause * >-getprivs(id, quotatype) >+getprivs(id, quotatype, fspath) > register long id; > int quotatype; >+ char *fspath; > { > register struct fstab *fs; > register struct quotause *qup, *quptail; >@@ -262,6 +267,9 @@ > quphead = (struct quotause *)0; > qcmd = QCMD(Q_GETQUOTA, quotatype); > while ((fs = getfsent())) { >+ if (fspath && *fspath && strcmp(fspath, fs->fs_spec) && >+ strcmp(fspath, fs->fs_file)) >+ continue; > if (strcmp(fs->fs_vfstype, "ufs")) > continue; > if (!hasquota(fs, quotatype, &qfpathname))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 30816
: 16890