From 7c06a3d40d3237b20c9b6dace27fa6bc6cdf6fbf Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:10:28 +0000 Subject: import quota-4.01-17.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de4d0a4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/quota-4.01.tar.gz diff --git a/.quota.metadata b/.quota.metadata new file mode 100644 index 0000000..d1907a5 --- /dev/null +++ b/.quota.metadata @@ -0,0 +1 @@ +64d2ab8b039cfea1aa4bd9e77e8c373488a7f0bf SOURCES/quota-4.01.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/quota-3.06-pie.patch b/SOURCES/quota-3.06-pie.patch new file mode 100644 index 0000000..caf7653 --- /dev/null +++ b/SOURCES/quota-3.06-pie.patch @@ -0,0 +1,32 @@ +--- quota-tools/Makefile.in.orig 2008-01-24 06:52:54.658544000 -0500 ++++ quota-tools/Makefile.in 2008-01-24 06:56:58.930806000 -0500 +@@ -52,6 +52,10 @@ LIBOBJS += @LIBMALLOC@ + + all: $(PROGS) + ++ ++svc_socket.o rquota_server.o rquota_svc.o $(filter-out rquota_xdr.o,$(LIBOBJS)): %.o: %.c ++ $(CC) $(CFLAGS) -fpie -c $< ++ + clean: + -rm -f core *.o .*.d + +@@ -130,7 +134,8 @@ setquota: setquota.o quotaops.o $(LIBOBJ + convertquota: convertquota.o $(LIBOBJS) + + rpc.rquotad: rquota_server.o rquota_svc.o svc_socket.o $(LIBOBJS) +- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) ++ $(CC) $(LDFLAGS) -pie -o $@ $^ $(LIBS) ++ @if readelf -d $@|fgrep -q TEXTREL; then echo "*** Text relocation"; false; else true; fi + + ifneq ($(NETLINKLIBS),) + quota_nld: quota_nld.o $(LIBOBJS) +@@ -146,7 +151,7 @@ rquota_xdr.c: rquota.x + $(RPCGEN) -c -o $@ $< + + rquota_xdr.o: rquota_xdr.c rquota.h +- $(CC) $(CFLAGS) -Wno-unused -c $< ++ $(CC) $(CFLAGS) -Wno-unused -fpie -c $< + + rquota_clnt.c: rquota.x + $(RPCGEN) -l -o $@ $< diff --git a/SOURCES/quota-3.13-wrong-ports.patch b/SOURCES/quota-3.13-wrong-ports.patch new file mode 100644 index 0000000..8c59a28 --- /dev/null +++ b/SOURCES/quota-3.13-wrong-ports.patch @@ -0,0 +1,11 @@ +--- quota-tools/rquota_svc.c.orig 2005-06-01 03:21:30.000000000 -0400 ++++ quota-tools/rquota_svc.c 2006-11-01 15:11:29.161101000 -0500 +@@ -140,7 +140,7 @@ static void parse_options(int argc, char + break; + case 'p': + port = strtol(optarg, &endptr, 0); +- if (*endptr || port <= 0) { ++ if (*endptr || port <= 0 || port > 0xffff) { + errstr(_("Illegal port number: %s\n"), optarg); + show_help(); + exit(1); diff --git a/SOURCES/quota-4.01-Add-quotagrpadmins-5-manual-page.patch b/SOURCES/quota-4.01-Add-quotagrpadmins-5-manual-page.patch new file mode 100644 index 0000000..fdf5d0a --- /dev/null +++ b/SOURCES/quota-4.01-Add-quotagrpadmins-5-manual-page.patch @@ -0,0 +1,96 @@ +From 2e0023997cf6fe1e2eee678ba66371642e212829 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 16 Oct 2013 16:48:26 +0200 +Subject: [PATCH 1/4] Add quotagrpadmins(5) manual page +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Písař +--- + Makefile.in | 2 ++ + quotagrpadmins.5 | 28 ++++++++++++++++++++++++++++ + warnquota.8 | 5 ++++- + 3 files changed, 34 insertions(+), 1 deletion(-) + create mode 100644 quotagrpadmins.5 + +diff --git a/Makefile.in b/Makefile.in +index 84fafce..5800029 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -90,6 +90,7 @@ install: all @INSTMO@ + -$(INSTALL) -m $(DEF_CONF_MODE) quotagrpadmins $(ROOTDIR)$(sysconfdir) + -mkdir -p $(ROOTDIR)$(mandir)/man1 + -mkdir -p $(ROOTDIR)$(mandir)/man3 ++ -mkdir -p $(ROOTDIR)$(mandir)/man5 + -mkdir -p $(ROOTDIR)$(mandir)/man8 + -$(INSTALL) -m 755 -d $(ROOTDIR)$(includedir)/rpcsvc + -$(INSTALL) -m 644 rquota.h rquota.x $(ROOTDIR)$(includedir)/rpcsvc +@@ -100,6 +101,7 @@ ifneq ($(NETLINKLIBS),) + endif + -$(INSTALL) -m $(DEF_MAN_MODE) *.1 $(ROOTDIR)$(mandir)/man1 + -$(INSTALL) -m $(DEF_MAN_MODE) *.3 $(ROOTDIR)$(mandir)/man3 ++ -$(INSTALL) -m $(DEF_MAN_MODE) *.5 $(ROOTDIR)$(mandir)/man5 + -$(INSTALL) -m $(DEF_MAN_MODE) *.8 $(ROOTDIR)$(mandir)/man8 + + quotaon: quotaon.o quotaon_xfs.o $(LIBOBJS) +diff --git a/quotagrpadmins.5 b/quotagrpadmins.5 +new file mode 100644 +index 0000000..fef1e3a +--- /dev/null ++++ b/quotagrpadmins.5 +@@ -0,0 +1,28 @@ ++.TH QUOTAGRPADMINS 5 ++.SH NAME ++quotagrpadmins \- users responsible for group disk usage ++.SH SYNOPSIS ++.B /etc/quotagrpadmins ++.SH DESCRIPTION ++The ++.B quotagrpadmins ++file lists administrators of user groups who will receive a warning if ++.B warnquota --group ++command finds a group exceeding its disk usage limits. ++.P ++Each line consists of a group name followed by a colon and an user name. White ++space characters surrounding the names are allowed. Empty lines or lines ++starting with a hash sign or a semicolon are ignored. ++.SH EXAMPLE ++.PP ++# comment ++.RS 0 ++users: root ++.SH FILES ++.PD 0 ++.TP 20 ++.B /etc/quotagrpadmins ++list of group administrators ++.PD ++.SH SEE ALSO ++.BR warnquota (8). +diff --git a/warnquota.8 b/warnquota.8 +index 8427488..836290d 100644 +--- a/warnquota.8 ++++ b/warnquota.8 +@@ -58,7 +58,9 @@ Use + .I adminsfile + instead of + .I /etc/quotagrpadmins +-as a file with administrators of the groups. ++as a file with administrators of the groups (see ++.BR quotagrpadmins (5) ++for syntax). + .TP + .B -u, --user + check whether users are not exceeding quotas (default). +@@ -102,6 +104,7 @@ default set of users + .PD + .SH "SEE ALSO" + .BR quota (1), ++.BR quotagrpadmins (5), + .BR cron (8), + .BR edquota (8). + .SH AUTHORS +-- +1.8.3.1 + diff --git a/SOURCES/quota-4.01-Add-quotasync-1-manual-page.patch b/SOURCES/quota-4.01-Add-quotasync-1-manual-page.patch new file mode 100644 index 0000000..3345c58 --- /dev/null +++ b/SOURCES/quota-4.01-Add-quotasync-1-manual-page.patch @@ -0,0 +1,96 @@ +From 801386a31d0ae47779cf74cbb4f343be346a07db Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 6 Mar 2013 11:21:50 +0100 +Subject: [PATCH 1/4] Add quotasync(1) manual page +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + quotasync.1 | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 72 insertions(+) + create mode 100644 quotasync.1 + +diff --git a/quotasync.1 b/quotasync.1 +new file mode 100644 +index 0000000..e968403 +--- /dev/null ++++ b/quotasync.1 +@@ -0,0 +1,72 @@ ++.TH QUOTASYNC 1 ++.SH NAME ++quotasync \- synchronize in-kernel file system usage and limits to disk format ++.SH SYNOPSIS ++.B quotasync ++[ ++.B -ug ++] ++.IR mount-point ... ++.br ++.B quotasync ++[ ++.B -ug ++] ++.B -a ++.br ++.B quotasync ++.B -h ++| ++.B -V ++.SH DESCRIPTION ++.B quotasync ++flushes file system usage and limits from kernel memory to quota files stored ++in the file system. By default only the user quotas are synchronized. ++.P ++This tool can be useful if you want to display accurate quotas by tools that ++parse quota files, like ++.BR repquota (8). ++.SH OPTIONS ++.TP ++.B -u, --user ++Synchronize user usage and limits. ++.TP ++.B -g, --group ++Synchronize group usage and limits. ++.TP ++.B -a, --all ++Synchronize usage and limits on all file systems. You have to specify this ++option or to specify desired file systems. ++.TP ++.B -V, --version ++Show program version information and exit. ++.TP ++.B -h, --help ++Show program usage and exit. ++.SH DIAGNOSTICS ++If requested synchronization fails, or invalid option is given, ++.B quotasync ++will terminate with non-zero exit code. Otherwise it will return zero. ++.SH FILES ++.PD 0 ++.TP 16 ++.B aquota.user " or " aquota.group ++Quota file at the file system root (version 2 quota, non-XFS/GFS2 file systems). ++.TP 16 ++.B quota.user " or " quota.group ++Quota file at the file system root (version 1 quota, non-XFS/GFS2 file systems). ++.TP 16 ++.B /etc/mtab ++List of mounted file systems maintained by user space. ++.TP 16 ++.B /proc/mounts ++List of mounted file systems maintained by kernel. ++.PD ++.SH SEE ALSO ++.BR quota (1), ++.BR quotactl (2), ++.BR mount (8), ++.BR quotacheck (8), ++.BR quotaon (8), ++.BR repquota (8), ++.BR warnquota (8). +-- +1.8.1.4 + diff --git a/SOURCES/quota-4.01-Add-quotatab-5-manual-page.patch b/SOURCES/quota-4.01-Add-quotatab-5-manual-page.patch new file mode 100644 index 0000000..f1edbbc --- /dev/null +++ b/SOURCES/quota-4.01-Add-quotatab-5-manual-page.patch @@ -0,0 +1,78 @@ +From e0d078f1fdf1c91602d72b402e3accc3b7c8cb58 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Thu, 17 Oct 2013 14:40:35 +0200 +Subject: [PATCH 2/4] Add quotatab(5) manual page +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Písař +--- + quotatab.5 | 31 +++++++++++++++++++++++++++++++ + warnquota.8 | 5 ++++- + 2 files changed, 35 insertions(+), 1 deletion(-) + create mode 100644 quotatab.5 + +diff --git a/quotatab.5 b/quotatab.5 +new file mode 100644 +index 0000000..96d3608 +--- /dev/null ++++ b/quotatab.5 +@@ -0,0 +1,31 @@ ++.TH QUOTATAB 5 ++.SH NAME ++quotatab \- Descriptions of devices with disk quotas ++.SH SYNOPSIS ++.B /etc/quotatab ++.SH DESCRIPTION ++The ++.B quotatab ++file lists human descriptions of devices for the purpose of ++.BR warnquota (8) ++notifications. ++.P ++Each line consists of a device path name followed by a colon and ++a description. White space, apostrophe, and double quote characters ++surrounding the names and descriptions will be stripped. The description field ++can encode a new-line as a pipe character. ++.P ++Empty lines or lines starting with a hash sign or a semicolon are ignored. ++.SH EXAMPLE ++.PP ++# comment ++.RS 0 ++/dev/sda2: Home directories.|This becomes second line. ++.SH FILES ++.PD 0 ++.TP 20 ++.B /etc/quotatab ++list of device descriptions ++.PD ++.SH SEE ALSO ++.BR warnquota (8). +diff --git a/warnquota.8 b/warnquota.8 +index 836290d..b998f19 100644 +--- a/warnquota.8 ++++ b/warnquota.8 +@@ -44,7 +44,9 @@ Use + .I quotatab + instead of + .I /etc/quotatab +-as file with device description strings (see example file for syntax). ++as file with device description strings (see ++.BR quotatab (5) ++for syntax). + .TP + .B -c, --config=\f2configfile\f1 + Use +@@ -104,6 +106,7 @@ default set of users + .PD + .SH "SEE ALSO" + .BR quota (1), ++.BR quotatab (5), + .BR quotagrpadmins (5), + .BR cron (8), + .BR edquota (8). +-- +1.8.3.1 + diff --git a/SOURCES/quota-4.01-Add-warnquota.conf-5-manual-page.patch b/SOURCES/quota-4.01-Add-warnquota.conf-5-manual-page.patch new file mode 100644 index 0000000..08fc2ff --- /dev/null +++ b/SOURCES/quota-4.01-Add-warnquota.conf-5-manual-page.patch @@ -0,0 +1,231 @@ +From 91db972ea2f4065974811655847be4d52b7caee9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Thu, 17 Oct 2013 17:01:07 +0200 +Subject: [PATCH 3/4] Add warnquota.conf(5) manual page +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Písař +--- + warnquota.8 | 5 +- + warnquota.conf.5 | 184 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 188 insertions(+), 1 deletion(-) + create mode 100644 warnquota.conf.5 + +diff --git a/warnquota.8 b/warnquota.8 +index b998f19..e675f4a 100644 +--- a/warnquota.8 ++++ b/warnquota.8 +@@ -53,7 +53,9 @@ Use + .I configfile + instead of + .I /etc/warnquota.conf +-as configuration file (see example file for syntax). ++as configuration file (see ++.BR warnquota.conf (5) ++for syntax). + .TP + .B -a, --admins-file=\f2adminsfile\f1 + Use +@@ -108,6 +110,7 @@ default set of users + .BR quota (1), + .BR quotatab (5), + .BR quotagrpadmins (5), ++.BR warnquota.conf (5), + .BR cron (8), + .BR edquota (8). + .SH AUTHORS +diff --git a/warnquota.conf.5 b/warnquota.conf.5 +new file mode 100644 +index 0000000..56e1439 +--- /dev/null ++++ b/warnquota.conf.5 +@@ -0,0 +1,184 @@ ++.TH WARNQUOTA.CONF 5 ++.SH NAME ++warnquota.conf \- configuration for warnquota ++.SH SYNOPSIS ++.B /etc/warnquota.conf ++.SH DESCRIPTION ++The ++.B warnquota.conf ++file stores a configuration for ++.BR warnquota (8) ++tool which is used to notify an user or a group who exceeds its disk quota ++limits. ++.P ++The syntax is an option name followed by a equal sign and the option value. ++White space characters surrounding the option names and values are allowed. ++.P ++Empty lines or lines starting with a hash sign or a semicolon are ignored. ++.P ++An option value can but does not have to be quoted. The value can span ++across multiple lines provided each previous line ends with a backslash. ++.P ++Some option values can contain formatting sequences which will be expanded to ++their respective values. Following sequences are recognizes: ++.P ++.PD 0 ++.TP 20 ++.B %d ++domain name ++.TP ++.B %h ++host name ++.TP ++.BR "%i" ", " "%s" ++user or group name ++.TP ++.B %% ++literal % character ++.TP ++.B | ++new-line character ++.PD ++.SH OPTIONS ++.PD 0 ++.TP 20 ++.B CC_BEFORE ++Send to copy-carbon address only when an user has less than specified grace time ++left. Value is a number followed by a time unit. Known units are ++.IR seconds , ++.IR minutes , ++.IR hours ", and" ++.IR days . ++Example: ++.I 5 days ++.TP ++.B CC_TO ++An e-mail address to put into copy-carbon (CC:) recipient header. Default ++value is ++.IR root . ++.TP ++.B CHARSET ++Defines character set for sent e-mails. Default value will be current locale ++character set used when executing warnquota command, if locale is not either ++.I C ++or ++.IR POSIX . ++Otherwise none character set will be specified in the e-mails. ++.TP ++.B FROM ++Defines From: e-email address. Default value is ++.IR "support@localhost" . ++.TP ++.B GROUP_MESSAGE ++A text sent as an e-mail body if a group exceeds its limits. This option ++recognizes formatting sequences. ++.TP ++.B GROUP_SIGNATURE ++A signature text appended to notification for a group. Default value is ++a general explanation utilizing ++.B SUPPORT ++and ++.B PHONE ++values. This option recognizes formatting sequences. ++.TP ++.B LDAP_BASEDN ++Base distinguished name for LDAP queries. ++.TP ++.B LDAP_BINDDN ++Bind distinguished name for LDAP queries. ++.TP ++.B LDAP_BINDPW ++Bind password for LDAP queries. ++.TP ++.B LDAP_DEFAULT_MAIL_DOMAIN ++Default e-mail address domain of searched user if given LDAP attribute does ++not specify any. ++.TP ++.B LDAP_HOST ++LDAP server name to connect to if ++.B LDAP_URI ++is not defined. ++.TP ++.B LDAP_MAIL ++A boolean controlling if LDAP has to be used to look up an user's e-mail ++address. Possible values are ++.I true ++and ++.IR false . ++Default value is ++.IR false . ++.TP ++.B LDAP_MAIL_ATTRIBUTE ++The LDAP attribute which holds user's e-mail address. ++.TP ++.B LDAP_PORT ++LDAP server port number to connect to if ++.B LDAP_URI ++is not defined. ++.TP ++.B LDAP_SEARCH_ATTRIBUTE ++The LDAP attribute which holds user's ID to look up. ++.TP ++.B LDAP_URI ++The URL of LDAP server to use to search user's e-mail addresses. This option ++takes preference over ++.B LDAP_HOST ++and ++.BR LDAP_PORT . ++Example: ++.I ldaps://example.com:389/ ++.TP ++.B MESSAGE ++A beginning of text sent as an e-mail body if a user exceeds his limits. This ++option recognizes formatting sequences. ++.TP ++.B MAIL_CMD ++The command to execute to send an e-mail. The e-mail text including all ++headers is passed to the standard input of the command. Default value is ++.IR "/usr/lib/sendmail -t" . ++.TP ++.B MAILDEV ++The device with disk quotas to exclude from sending notifications if there are ++exceeded limits. This option should identify the device where mail boxes are ++stored to prevent from bouncing the warnquota notification by local MDA due to ++no space for storing new e-mails. Special value ++.I any ++denotes all devices. ++.TP ++.B PHONE ++The telephone contact to the user support. Default value is ++.IR "(xxx) xxx-xxxx or (yyy) yyy-yyyy" . ++.TP ++.B SIGNATURE ++The end of e-mail body if a user exceeds its limits. Default value is ++a general explanation utilizing ++.B SUPPORT ++and ++.B PHONE ++values. This option recognizes formatting sequences. ++.TP ++.B SUBJECT ++The text to put into Subject: header. Default value is ++.IR "Disk Quota usage on system" . ++.TP ++.B SUPPORT ++The contact to the user support. Default value is ++.IR "support@localhost" . ++.SH EXAMPLE ++.PP ++# comment ++.RS 0 ++FROM = root@example.com ++.RS 0 ++SUPPORT = support@example.com ++.RS 0 ++PHONE = 1234 ++.SH FILES ++.PD 0 ++.TP 20 ++.B /etc/warnquota.conf ++configuration for ++.BR warnquota (8) ++.PD ++.SH SEE ALSO ++.BR warnquota (8). +-- +1.8.3.1 + diff --git a/SOURCES/quota-4.01-Close-FILE-handles-on-error.patch b/SOURCES/quota-4.01-Close-FILE-handles-on-error.patch new file mode 100644 index 0000000..46e82af --- /dev/null +++ b/SOURCES/quota-4.01-Close-FILE-handles-on-error.patch @@ -0,0 +1,101 @@ +From d26e316c3ffd4658b25f14ea1c42384f251c96de Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Thu, 13 Jun 2013 16:11:30 +0200 +Subject: [PATCH] Close FILE handles on error + +Functions for reading quota specification in quotaops.c create new +temporary FILE stream handle, they close it on successful return, +but they forget to close it on unsuccessful return. That leads to +memory leaks. This patch ensures that the handle gets closed in all +cases. +--- + quotaops.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/quotaops.c b/quotaops.c +index 175a945..47ef9a7 100644 +--- a/quotaops.c ++++ b/quotaops.c +@@ -334,42 +334,49 @@ int readprivs(struct dquot *qlist, int infd) + + if (cnt != 7) { + errstr(_("Bad format:\n%s\n"), line); ++ fclose(fd); + return -1; + } + error = str2space(blocksstring, &blocks); + if (error) { + errstr(_("Bad block usage: %s: %s\n"), + blocksstring, error); ++ fclose(fd); + return -1; + } + error = str2space(bsoftstring, &bsoft); + if (error) { + errstr(_("Bad block soft limit: %s: %s\n"), + bsoftstring, error); ++ fclose(fd); + return -1; + } + error = str2space(bhardstring, &bhard); + if (error) { + errstr(_("Bad block hard limit: %s: %s\n"), + bhardstring, error); ++ fclose(fd); + return -1; + } + error = str2number(inodesstring, &inodes); + if (error) { + errstr(_("Bad inode usage: %s: %s\n"), + inodesstring, error); ++ fclose(fd); + return -1; + } + error = str2number(isoftstring, &isoft); + if (error) { + errstr(_("Bad inode soft limit: %s: %s\n"), + isoftstring, error); ++ fclose(fd); + return -1; + } + error = str2number(ihardstring, &ihard); + if (error) { + errstr(_("Bad inode hard limit: %s: %s\n"), + ihardstring, error); ++ fclose(fd); + return -1; + } + +@@ -478,6 +485,7 @@ int readindividualtimes(struct dquot *qlist, int infd) + if (cnt != 3) { + format_err: + errstr(_("bad format:\n%s\n"), line); ++ fclose(fd); + return -1; + } + if (!strcmp(btimestr, _("unset"))) +@@ -488,6 +496,7 @@ format_err: + if (str2timeunits(btime, bunits, &bseconds) < 0) { + units_err: + errstr(_("Bad time units. Units are 'second', 'minute', 'hour', and 'day'.\n")); ++ fclose(fd); + return -1; + } + bseconds += now; +@@ -576,11 +585,13 @@ int readtimes(struct quota_handle **handles, int infd) + cnt = sscanf(line, "%s %d %s %d %s", fsp, &btime, bunits, &itime, iunits); + if (cnt != 5) { + errstr(_("bad format:\n%s\n"), line); ++ fclose(fd); + return -1; + } + if (str2timeunits(btime, bunits, &bseconds) < 0 || + str2timeunits(itime, iunits, &iseconds) < 0) { + errstr(_("Bad time units. Units are 'second', 'minute', 'hour', and 'day'.\n")); ++ fclose(fd); + return -1; + } + for (i = 0; handles[i]; i++) { +-- +1.8.1.4 + diff --git a/SOURCES/quota-4.01-Complete-quotasync-usage.patch b/SOURCES/quota-4.01-Complete-quotasync-usage.patch new file mode 100644 index 0000000..e66eb9b --- /dev/null +++ b/SOURCES/quota-4.01-Complete-quotasync-usage.patch @@ -0,0 +1,47 @@ +From 9384c1c0f8b64535595c89bb2b1a980538c8be43 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 6 Mar 2013 13:10:25 +0100 +Subject: [PATCH 2/4] Complete quotasync usage +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + quotasync.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/quotasync.c b/quotasync.c +index dd8ade9..cab9015 100644 +--- a/quotasync.c ++++ b/quotasync.c +@@ -22,8 +22,23 @@ char *progname; + + static void usage(void) + { +- errstr(_("Utility for syncing quotas.\nUsage:\n%s [-ug] -a | mntpoint...\n\n"), progname); +- fprintf(stderr, _("Bugs to %s\n"), MY_EMAIL); ++ printf(_( ++"%1$s: Utility for syncing quotas.\n" ++"Usage: %1$s [-ug] mount-point...\n" ++" or: %1$s [-ug] -a\n" ++" or: %1$s -h | -V\n" ++"\n" ++ ), progname); ++ printf(_( ++"Options:\n" ++"-u, --user synchronize user quotas\n" ++"-g, --group synchronize group quotas\n" ++"-a, --all synchronize quotas for all mounted file systems\n" ++"-h, --help display this help message and exit\n" ++"-V, --version display version information and exit\n" ++"\n" ++ )); ++ printf(_("Report bugs to <%s>.\n"), MY_EMAIL); + exit(1); + } + +-- +1.8.1.4 + diff --git a/SOURCES/quota-4.01-Correct-quotasync-exit-code.patch b/SOURCES/quota-4.01-Correct-quotasync-exit-code.patch new file mode 100644 index 0000000..68a903e --- /dev/null +++ b/SOURCES/quota-4.01-Correct-quotasync-exit-code.patch @@ -0,0 +1,102 @@ +From 0d5a11f41afe14f779908fbc366c492b818a0864 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 6 Mar 2013 11:32:32 +0100 +Subject: [PATCH 3/4] Correct quotasync exit code +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes `quotasync -h' exit code as well as it uses more portable +EXIT_SUCCESS/EXIT_FAILURE values. + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + quotasync.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +diff --git a/quotasync.c b/quotasync.c +index cab9015..cfc3f2d 100644 +--- a/quotasync.c ++++ b/quotasync.c +@@ -20,7 +20,7 @@ static char **mnt; + static int mntcnt; + char *progname; + +-static void usage(void) ++static void usage(int status) + { + printf(_( + "%1$s: Utility for syncing quotas.\n" +@@ -39,7 +39,7 @@ static void usage(void) + "\n" + )); + printf(_("Report bugs to <%s>.\n"), MY_EMAIL); +- exit(1); ++ exit(status); + } + + static void parse_options(int argcnt, char **argstr) +@@ -57,11 +57,12 @@ static void parse_options(int argcnt, char **argstr) + while ((ret = getopt_long(argcnt, argstr, "ahugV", long_opts, NULL)) != -1) { + switch (ret) { + case '?': ++ usage(EXIT_FAILURE); + case 'h': +- usage(); ++ usage(EXIT_SUCCESS); + case 'V': + version(); +- exit(0); ++ exit(EXIT_SUCCESS); + case 'u': + flags |= FL_USER; + break; +@@ -77,7 +78,7 @@ static void parse_options(int argcnt, char **argstr) + if ((flags & FL_ALL && optind != argcnt) || + (!(flags & FL_ALL) && optind == argcnt)) { + fputs(_("Bad number of arguments.\n"), stderr); +- usage(); ++ usage(EXIT_FAILURE); + } + if (!(flags & FL_ALL)) { + mnt = argstr + optind; +@@ -100,10 +101,12 @@ static int syncquotas(int type) + int i, ret = 0; + + if (flags & FL_ALL) { +- if (sync_one(type, NULL) < 0) ++ if (sync_one(type, NULL) < 0) { + errstr(_("%s quota sync failed: %s\n"), _(type2name(type)), + strerror(errno)); +- return -1; ++ ret = -1; ++ } ++ return ret; + } + + handles = create_handle_list(mntcnt, mnt, type, fmt, +@@ -124,7 +127,7 @@ static int syncquotas(int type) + + int main(int argc, char **argv) + { +- int ret = 0; ++ int ret = EXIT_SUCCESS; + + gettexton(); + progname = basename(argv[0]); +@@ -134,9 +137,9 @@ int main(int argc, char **argv) + + if (flags & FL_USER) + if (syncquotas(USRQUOTA)) +- ret = 1; ++ ret = EXIT_FAILURE; + if (flags & FL_GROUP) + if (syncquotas(GRPQUOTA)) +- ret = 1; ++ ret = EXIT_FAILURE; + return ret; + } +-- +1.8.1.4 + diff --git a/SOURCES/quota-4.01-Do-not-fiddle-with-quota-files-on-XFS-and-GFS.patch b/SOURCES/quota-4.01-Do-not-fiddle-with-quota-files-on-XFS-and-GFS.patch new file mode 100644 index 0000000..54c8c98 --- /dev/null +++ b/SOURCES/quota-4.01-Do-not-fiddle-with-quota-files-on-XFS-and-GFS.patch @@ -0,0 +1,45 @@ +From 5f7b9d139d64117abc4dcd66d2fbac99c070d7ce Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Thu, 31 Jan 2013 12:58:59 +0100 +Subject: [PATCH] Do not fiddle with quota files on XFS and GFS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +XFS and GFS have no quota files. Skip unnecessary examination and +rename of these files when running quotacheck. + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + quotacheck.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/quotacheck.c b/quotacheck.c +index 0d0d4b2..e047825 100644 +--- a/quotacheck.c ++++ b/quotacheck.c +@@ -828,6 +828,9 @@ static int dump_to_file(struct mount_entry *mnt, int type) + return -1; + } + debug(FL_DEBUG, _("Data dumped.\n")); ++ /* Moving of quota files doesn't apply to GFS2 or XFS */ ++ if (cfmt == QF_XFS) ++ return 0; + if (kern_quota_on(mnt, type, cfmt) >= 0) { /* Quota turned on? */ + char *filename; + +@@ -871,6 +874,10 @@ static int sub_quota_file(struct mount_entry *mnt, int qtype, int ftype) + struct dquot *d; + qid_t id; + ++ /* GFS2 and XFS do not have quota files. */ ++ if (cfmt == QF_XFS) ++ return 0; ++ + debug(FL_DEBUG, _("Substracting space used by old %s quota file.\n"), _(type2name(ftype))); + if (get_qf_name(mnt, ftype, cfmt, 0, &filename) < 0) { + debug(FL_VERBOSE, _("Old %s file name could not been determined. Usage will not be subtracted.\n"), _(type2name(ftype))); +-- +1.8.1.2 + diff --git a/SOURCES/quota-4.01-Fix-various-usage-mistakes.patch b/SOURCES/quota-4.01-Fix-various-usage-mistakes.patch new file mode 100644 index 0000000..86e8504 --- /dev/null +++ b/SOURCES/quota-4.01-Fix-various-usage-mistakes.patch @@ -0,0 +1,72 @@ +From 97fad5f32bfe24b3a3ce8b3923b27099b746de06 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 6 Mar 2013 13:41:23 +0100 +Subject: [PATCH 4/4] Fix various usage mistakes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +quota: Fix long variant for -A option in usage +repquota: Fix long variant for -c option in usage and manual +repquota: Fix long variant for -C option in usage and manual +repquota: Add -a, --all options to usage + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + quota.c | 2 +- + repquota.8 | 4 ++-- + repquota.c | 5 +++-- + 3 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/quota.c b/quota.c +index 56e71a8..1befbde 100644 +--- a/quota.c ++++ b/quota.c +@@ -102,7 +102,7 @@ static void usage(void) + -i, --no-autofs do not query autofs mountpoints\n\ + -F, --format=formatname display quota of a specific format\n\ + -f, --filesystem-list display quota information only for given filesystems\n\ +--A, --nfs-all display quota for all NFS mountpoints\n\ ++-A, --all-nfs display quota for all NFS mountpoints\n\ + -m, --no-mixed-pathnames trim leading slashes from NFSv4 mountpoints\n\ + --show-mntpoint show mount point of the file system in output\n\ + --hide-device do not show file system device in output\n\ +diff --git a/repquota.8 b/repquota.8 +index a71cf6b..bb6d7ab 100644 +--- a/repquota.8 ++++ b/repquota.8 +@@ -84,11 +84,11 @@ to be read-write with quotas. + Report all quotas, even if there is no usage. Be also more verbose about quotafile + information. + .TP +-.B -c, --batch-translation ++.B -c, --cache + Cache entries to report and translate uids/gids to names in big chunks by scanning + all users (default). This is good (fast) behaviour when using /etc/passwd file. + .TP +-.B -C, --no-batch-translation ++.B -C, --no-cache + Translate individual entries. This is faster when you have users stored in database. + .TP + .B -t, --truncate-names +diff --git a/repquota.c b/repquota.c +index 43de31d..50683b9 100644 +--- a/repquota.c ++++ b/repquota.c +@@ -56,9 +56,10 @@ static void usage(void) + -p, --raw-grace print grace time in seconds since epoch\n\ + -n, --no-names do not translate uid/gid to name\n\ + -i, --no-autofs avoid autofs mountpoints\n\ +--c, --batch-translation translate big number of ids at once\n\ +--C, --no-batch-translation translate ids one by one\n\ ++-c, --cache translate big number of ids at once\n\ ++-C, --no-cache translate ids one by one\n\ + -F, --format=formatname report information for specific format\n\ ++-a, --all report information for all mount points with quotas\n\ + -h, --help display this help message and exit\n\ + -V, --version display version information and exit\n\n"), progname); + fprintf(stderr, _("Bugs to %s\n"), MY_EMAIL); +-- +1.8.1.4 + diff --git a/SOURCES/quota-4.01-Improve-rcp.rquota-8-manual-page.patch b/SOURCES/quota-4.01-Improve-rcp.rquota-8-manual-page.patch new file mode 100644 index 0000000..0c48e36 --- /dev/null +++ b/SOURCES/quota-4.01-Improve-rcp.rquota-8-manual-page.patch @@ -0,0 +1,241 @@ +From e4e473c7bb8f30604d763074a6d04e2854249552 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Mon, 21 Oct 2013 14:24:52 +0200 +Subject: [PATCH 4/4] Improve rcp.rquota(8) manual page +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch renames rquotad(8) to rpc.rquotad(8) to reflect the +executable name. It also shows completes synopsis and documents --help option. + +Signed-off-by: Petr Písař +--- + rpc.rquotad.8 | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + rquotad.8 | 95 ------------------------------------------------- + 2 files changed, 112 insertions(+), 95 deletions(-) + create mode 100644 rpc.rquotad.8 + delete mode 100644 rquotad.8 + +diff --git a/rpc.rquotad.8 b/rpc.rquotad.8 +new file mode 100644 +index 0000000..a045dba +--- /dev/null ++++ b/rpc.rquotad.8 +@@ -0,0 +1,112 @@ ++.TH RQUOTAD 8 ++.SH NAME ++rpc.rquotad \- remote quota server ++.SH SYNOPSIS ++.B /usr/sbin/rpc.rquotad ++[ ++.BR \-FI ++] [ ++.B \-p ++.I port ++] [ ++.B \-s ++| ++.B \-S ++] [ ++.B \-x ++.I path ++] ++.LP ++.B /usr/sbin/rpc.rquotad ++[ ++.B \-h ++| ++.B \-V ++] ++.SH DESCRIPTION ++.LP ++.IX "rquotad daemon" "" "\fLrquotad\fP \(em remote quota server" ++.IX daemons "rquotad daemon" "" "\fLrquotad\fP \(em remote quota server" ++.IX "user quotas" "rquotad daemon" "" "\fLrquotad\fP \(em remote quota server" ++.IX "disk quotas" "rquotad daemon" "" "\fLrquotad\fP \(em remote quota server" ++.IX "quotas" "rquotad daemon" "" "\fLrquotad\fP \(em remote quota server" ++.IX "filesystem" "rquotad daemon" "" "\fLrquotad\fP \(em remote quota server" ++.IX "remote procedure call services" "rquotad" "" "\fLrquotad\fP \(em remote quota server" ++.B rpc.rquotad ++is an ++.BR rpc (3) ++server which returns quotas for a user of a local filesystem ++which is mounted by a remote machine over the ++.SM NFS\s0. ++It also allows setting of quotas on ++.SM NFS ++mounted filesystem (if configured during compilation and allowed by a command line option ++.BR \-S ). ++The results are used by ++.BR quota (1) ++to display user quotas for remote filesystems and by ++.BR edquota (8) ++to set quotas on remote filesystems. ++.B rquotad ++daemon uses tcp-wrappers library (under service name ++.IR rquotad ) ++which allows you to specify hosts allowed/disallowed to use ++the daemon (see ++.BR hosts.allow (5) ++manpage for more information). The ++.B rquotad ++daemon is normally started at boot time from the ++system startup scripts. ++.SH OPTIONS ++.TP ++.B \-h, \-\-help ++Show program usage and exit. ++.B \-V, \-\-version ++Show version of quota tools. ++.TP ++.B \-s, \-\-no-setquota ++Don't allow setting of quotas (default). This option is available only ++if utilities were compiled with the ++.I rpcsetquota ++option. ++.TP ++.B \-S, \-\-setquota ++Allow setting of quotas. This option is available only ++if utilities were compiled with the ++.I rpcsetquota ++option. ++.TP ++.B \-F, \-\-foreground ++Run daemon in foreground (may be useful for debugging purposes). ++.TP ++.B \-I, \-\-autofs ++Do not ignore autofs mountpoints. ++.TP ++.B \-p \f2port\f3, \-\-port \f2port\f1 ++Listen on alternate port ++.IR port. ++.TP ++.B \-x \f2path\f3, \-\-xtab \f2path\f1 ++Set an alternative file with NFSD export table. This file is used to ++determine pseudoroot of NFSv4 exports. The pseudoroot is then prepended ++to each relative path (i.e. a path not beginning by '/') received in a ++quota RPC request. ++ ++.SH FILES ++.PD 0 ++.TP 20 ++.B aquota.user or aquota.group ++quota file at the filesystem root (version 2 quota, non-XFS filesystems) ++.TP ++.B quota.user or quota.group ++quota file at the filesystem root (version 1 quota, non-XFS filesystems) ++.TP ++.B /etc/mtab ++default filesystems ++.PD ++.SH "SEE ALSO" ++.BR quota (1), ++.BR rpc (3), ++.BR nfs (5), ++.BR services (5), ++.BR inetd (8) +diff --git a/rquotad.8 b/rquotad.8 +deleted file mode 100644 +index f18bdcc..0000000 +--- a/rquotad.8 ++++ /dev/null +@@ -1,95 +0,0 @@ +-.TH RQUOTAD 8 +-.SH NAME +-rquotad, rpc.rquotad \- remote quota server +-.SH SYNOPSIS +-.B rpc.rquotad +-[ +-.B \-sSFI +-] [ +-.B \-p \f2port\f1 +-] +-.SH DESCRIPTION +-.LP +-.IX "rquotad daemon" "" "\fLrquotad\fP \(em remote quota server" +-.IX daemons "rquotad daemon" "" "\fLrquotad\fP \(em remote quota server" +-.IX "user quotas" "rquotad daemon" "" "\fLrquotad\fP \(em remote quota server" +-.IX "disk quotas" "rquotad daemon" "" "\fLrquotad\fP \(em remote quota server" +-.IX "quotas" "rquotad daemon" "" "\fLrquotad\fP \(em remote quota server" +-.IX "filesystem" "rquotad daemon" "" "\fLrquotad\fP \(em remote quota server" +-.IX "remote procedure call services" "rquotad" "" "\fLrquotad\fP \(em remote quota server" +-.B rquotad +-is an +-.BR rpc (3) +-server which returns quotas for a user of a local filesystem +-which is mounted by a remote machine over the +-.SM NFS\s0. +-It also allows setting of quotas on +-.SM NFS +-mounted filesystem (if configured during compilation and allowed by a command line option +-.BR \-S ). +-The results are used by +-.BR quota (1) +-to display user quotas for remote filesystems and by +-.BR edquota (8) +-to set quotas on remote filesystems. +-.B rquotad +-daemon uses tcp-wrappers library (under service name +-.IR rquotad ) +-which allows you to specify hosts allowed/disallowed to use +-the daemon (see +-.BR hosts.allow (5) +-manpage for more information). The +-.B rquotad +-daemon is normally started at boot time from the +-system startup scripts. +-.SH OPTIONS +-.TP +-.B \-V, \-\-version +-Shows version of quota tools. +-.TP +-.B \-s, \-\-no-setquota +-Don't allow setting of quotas (default). This option is available only +-if utilities were compiled with the +-.I rpcsetquota +-option. +-.TP +-.B \-S, \-\-setquota +-Allow setting of quotas. This option is available only +-if utilities were compiled with the +-.I rpcsetquota +-option. +-.TP +-.B \-F, \-\-foreground +-Run daemon in foreground (may be useful for debugging purposes). +-.TP +-.B \-I, \-\-autofs +-Do not ignore autofs mountpoints. +-.TP +-.B \-p \f2port\f3, \-\-port \f2port\f1 +-Listen on alternate port +-.IR port. +-.TP +-.B \-x \f2path\f3, \-\-xtab \f2path\f1 +-Set an alternative file with NFSD export table. This file is used to +-determine pseudoroot of NFSv4 exports. The pseudoroot is then prepended +-to each relative path (i.e. a path not beginning by '/') received in a +-quota RPC request. +- +-.SH FILES +-.PD 0 +-.TP 20 +-.B aquota.user or aquota.group +-quota file at the filesystem root (version 2 quota, non-XFS filesystems) +-.TP +-.B quota.user or quota.group +-quota file at the filesystem root (version 1 quota, non-XFS filesystems) +-.TP +-.B /etc/mtab +-default filesystems +-.PD +-.SH "SEE ALSO" +-.BR quota (1), +-.BR rpc (3), +-.BR nfs (5), +-.BR services (5), +-.BR inetd (8) +-- +1.8.3.1 + diff --git a/SOURCES/quota-4.01-Make-group-warning-message-more-official.patch b/SOURCES/quota-4.01-Make-group-warning-message-more-official.patch new file mode 100644 index 0000000..6060467 --- /dev/null +++ b/SOURCES/quota-4.01-Make-group-warning-message-more-official.patch @@ -0,0 +1,29 @@ +From cc9476d5bf016375dc02453be424ac1ea9b01247 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 25 Sep 2012 15:27:44 +0200 +Subject: [PATCH] Make group warning message more official + +Port to 4.01-1. +--- + warnquota.conf | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/warnquota.conf b/warnquota.conf +index 77f6a75..6d26bed 100644 +--- a/warnquota.conf ++++ b/warnquota.conf +@@ -27,8 +27,9 @@ MESSAGE = Your disk usage has exceeded the agreed limits\ + # is created) + SIGNATURE = root@example.com + # Following text is used for mails about group exceeding quotas +-GROUP_MESSAGE = Hello, a group '%i' you're member of use too much space at %h.|\ +-I chose you to do the cleanup.|Delete group files on the following filesystems:| ++GROUP_MESSAGE = Hello,|\ ++your group %i is using too much disk space at %h.|\ ++I suggest you to clean up group files on the following filesystems:| + # Text in the end of the mail to the group (if not specified, default text using SUPPORT + # and PHONE is created). + GROUP_SIGNATURE = See you!| Your admin| +-- +1.7.11.4 + diff --git a/SOURCES/quota-4.01-Prevent-from-grace-period-overflow-in-RPC-transport.patch b/SOURCES/quota-4.01-Prevent-from-grace-period-overflow-in-RPC-transport.patch new file mode 100644 index 0000000..c6c4ad0 --- /dev/null +++ b/SOURCES/quota-4.01-Prevent-from-grace-period-overflow-in-RPC-transport.patch @@ -0,0 +1,174 @@ +From d850a85b2374fe1b83779c0fc61463057eeca4ab Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Mon, 24 Feb 2014 15:54:32 +0100 +Subject: [PATCH] Prevent from grace period overflow in RPC transport +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The RPC transports grace time as unsigned int, but the value stored +there and retrivedd from is treated as singed difference against current time. + +This leads to overflow after expiring the grace time which is +presented as an enourmously large grace time instead of "none" in the +quota(1) output. + +There also possible an overflow when the time difference is still +bigger than an int can represent. + +This first issue is solved by explicit type cast to/from int32_t, the +second issue is fixes by limiting the value into int32_t range. + + + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + quotasys.c | 13 +++++++++++++ + quotasys.h | 4 ++++ + rquota_client.c | 10 ++++++---- + rquota_server.c | 9 +++++---- + 4 files changed, 28 insertions(+), 8 deletions(-) + +diff --git a/quotasys.c b/quotasys.c +index 120125a..a5737a8 100644 +--- a/quotasys.c ++++ b/quotasys.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + #include "pot.h" + #include "bylabel.h" +@@ -323,6 +324,18 @@ void difftime2str(time_t seconds, char *buf) + } + + /* ++ * Round difference of two time_t values into int32_t ++ */ ++int32_t difftime2net(time_t later, time_t sooner) ++{ ++ if ((later - sooner) > INT32_MAX) ++ return INT32_MAX; ++ if ((later - sooner) < INT32_MIN) ++ return INT32_MIN; ++ return (later - sooner); ++} ++ ++/* + * Convert time to printable form + */ + void time2str(time_t seconds, char *buf, int flags) +diff --git a/quotasys.h b/quotasys.h +index e79f8cd..d8d79fe 100644 +--- a/quotasys.h ++++ b/quotasys.h +@@ -8,6 +8,7 @@ + #define GUARD_QUOTASYS_H + + #include ++#include + #include "mntopt.h" + #include "quota.h" + +@@ -100,6 +101,9 @@ int util2kernfmt(int fmt); + /* Convert time difference between given time and current time to printable form */ + void difftime2str(time_t, char *); + ++/* Round difference of two time_t values into int32_t */ ++int32_t difftime2net(time_t later, time_t sooner); ++ + /* Convert time to printable form */ + void time2str(time_t, char *, int); + +diff --git a/rquota_client.c b/rquota_client.c +index e26e066..9d4055e 100644 +--- a/rquota_client.c ++++ b/rquota_client.c +@@ -32,11 +32,13 @@ + #include + #include + #include ++#include + + #include "mntopt.h" + #include "rquota.h" + #include "common.h" + #include "quotaio.h" ++#include "quotasys.h" + + #if defined(RPC) + +@@ -54,11 +56,11 @@ static inline void clinet2utildqblk(struct util_dqblk *u, struct rquota *n) + u->dqb_curspace = ((qsize_t)n->rq_curblocks) * n->rq_bsize; + time(&now); + if (n->rq_btimeleft) +- u->dqb_btime = n->rq_btimeleft + now; ++ u->dqb_btime = (int32_t)n->rq_btimeleft + now; + else + u->dqb_btime = 0; + if (n->rq_ftimeleft) +- u->dqb_itime = n->rq_ftimeleft + now; ++ u->dqb_itime = (int32_t)n->rq_ftimeleft + now; + else + u->dqb_itime = 0; + } +@@ -76,11 +78,11 @@ static inline void cliutil2netdqblk(struct sq_dqblk *n, struct util_dqblk *u) + n->rq_curblocks = toqb(u->dqb_curspace); + n->rq_curfiles = u->dqb_curinodes; + if (u->dqb_btime) +- n->rq_btimeleft = u->dqb_btime - now; ++ n->rq_btimeleft = difftime2net(u->dqb_btime, now); + else + n->rq_btimeleft = 0; + if (u->dqb_itime) +- n->rq_ftimeleft = u->dqb_itime - now; ++ n->rq_ftimeleft = difftime2net(u->dqb_itime, now); + else + n->rq_ftimeleft = 0; + } +diff --git a/rquota_server.c b/rquota_server.c +index bf66e4d..09cf6ed 100644 +--- a/rquota_server.c ++++ b/rquota_server.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include "mntopt.h" + #include "quotaops.h" +@@ -82,11 +83,11 @@ static inline void servnet2utildqblk(struct util_dqblk *u, sq_dqblk * n) + u->dqb_curspace = ((qsize_t)n->rq_curblocks) << RPC_DQBLK_SIZE_BITS; + u->dqb_curinodes = n->rq_curfiles; + if (n->rq_btimeleft) +- u->dqb_btime = n->rq_btimeleft + now; ++ u->dqb_btime = (int32_t)n->rq_btimeleft + now; + else + u->dqb_btime = 0; + if (n->rq_ftimeleft) +- u->dqb_itime = n->rq_ftimeleft + now; ++ u->dqb_itime = (int32_t)n->rq_ftimeleft + now; + else + u->dqb_itime = 0; + } +@@ -127,11 +128,11 @@ static inline void servutil2netdqblk(struct rquota *n, struct util_dqblk *u) + + time(&now); + if (u->dqb_btime) +- n->rq_btimeleft = u->dqb_btime - now; ++ n->rq_btimeleft = difftime2net(u->dqb_btime, now); + else + n->rq_btimeleft = 0; + if (u->dqb_itime) +- n->rq_ftimeleft = u->dqb_itime - now; ++ n->rq_ftimeleft = difftime2net(u->dqb_itime, now); + else + n->rq_ftimeleft = 0; + } +-- +2.5.0 + diff --git a/SOURCES/quota-4.01-Properly-handle-signed-space-and-inode-values.patch b/SOURCES/quota-4.01-Properly-handle-signed-space-and-inode-values.patch new file mode 100644 index 0000000..d2aedb6 --- /dev/null +++ b/SOURCES/quota-4.01-Properly-handle-signed-space-and-inode-values.patch @@ -0,0 +1,155 @@ +From 0214512479e04a3e118cbef8703aa1aec5240f3f Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Thu, 1 May 2014 18:08:09 +0200 +Subject: [PATCH] Properly handle signed space and inode values +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +For cluster filesystems, kernel can sometimes return negative values of +used space or inodes (because counters are not completely synchronized +across the cluster). Make quota tools properly print these. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotasys.c | 47 +++++++++++++++++++++++++++++++---------------- + quotasys.h | 2 +- + 2 files changed, 32 insertions(+), 17 deletions(-) + +diff --git a/quotasys.c b/quotasys.c +index dee5118..120125a 100644 +--- a/quotasys.c ++++ b/quotasys.c +@@ -376,6 +376,7 @@ int str2timeunits(time_t num, char *unit, time_t *res) + return 0; + } + ++#define DIV_ROUND_UP(x, d) (((x) + d - 1) / d) + /* + * Convert number in quota blocks to some nice short form for printing + */ +@@ -383,18 +384,26 @@ void space2str(qsize_t space, char *buf, int format) + { + int i; + char suffix[8] = " MGT"; ++ qsize_t aspace = space >= 0 ? space : -space; + + space = qb2kb(space); + if (format) { +- for (i = 3; i > 0; i--) +- if (space >= (1LL << (QUOTABLOCK_BITS*i))*100) { +- sprintf(buf, "%llu%c", (unsigned long long)(space+(1 << (QUOTABLOCK_BITS*i))-1) >> (QUOTABLOCK_BITS*i), suffix[i]); ++ for (i = 3; i > 0; i--) { ++ long long unit = 1LL << (QUOTABLOCK_BITS*i); ++ ++ if (aspace >= unit * 100) { ++ int sign = aspace != space ? -1 : 1; ++ ++ sprintf(buf, "%lld%c", (long long) ++ DIV_ROUND_UP(aspace, unit) * sign, ++ suffix[i]); + return; + } +- sprintf(buf, "%lluK", (unsigned long long)space); ++ } ++ sprintf(buf, "%lldK", (long long)space); + return; + } +- sprintf(buf, "%llu", (unsigned long long)space); ++ sprintf(buf, "%lld", (long long)space); + } + + /* +@@ -404,11 +413,11 @@ void space2str(qsize_t space, char *buf, int format) + const char *str2space(const char *string, qsize_t *space) + { + char *unit; +- unsigned long long int number; ++ long long int number; + int unit_shift; + +- number = strtoull(string, &unit, 0); +- if (ULLONG_MAX == number) ++ number = strtoll(string, &unit, 0); ++ if (number == LLONG_MAX || number == LLONG_MIN) + return _("Integer overflow while parsing space number."); + + if (!unit || unit[0] == '\0' || !strcmp(unit, _("K"))) +@@ -422,7 +431,8 @@ const char *str2space(const char *string, qsize_t *space) + else + return _("Unknown space binary unit. " + "Valid units are K, M, G, T."); +- if (number > (QSIZE_MAX >> unit_shift)) ++ if (number > (QSIZE_MAX >> unit_shift) || ++ number < -(QSIZE_MAX >> unit_shift)) + return _("Integer overflow while interpreting space unit."); + *space = number << unit_shift; + return NULL; +@@ -431,19 +441,23 @@ const char *str2space(const char *string, qsize_t *space) + /* + * Convert number to some nice short form for printing + */ +-void number2str(unsigned long long num, char *buf, int format) ++void number2str(long long num, char *buf, int format) + { + int i; + unsigned long long div; + char suffix[8] = " kmgt"; ++ long long anum = num >= 0 ? num : -num; + + if (format) + for (i = 4, div = 1000000000000LL; i > 0; i--, div /= 1000) + if (num >= 100*div) { +- sprintf(buf, "%llu%c", (num+div-1) / div, suffix[i]); ++ int sign = num != anum ? -1 : 1; ++ ++ sprintf(buf, "%lld%c", (num+div-1) / div * sign, ++ suffix[i]); + return; + } +- sprintf(buf, "%llu", num); ++ sprintf(buf, "%lld", num); + } + + /* +@@ -453,10 +467,10 @@ void number2str(unsigned long long num, char *buf, int format) + const char *str2number(const char *string, qsize_t *inodes) + { + char *unit; +- unsigned long long int number, multiple; ++ long long int number, multiple; + +- number = strtoull(string, &unit, 0); +- if (ULLONG_MAX == number) ++ number = strtoll(string, &unit, 0); ++ if (number == LLONG_MAX || number == LLONG_MIN) + return _("Integer overflow while parsing number."); + + if (!unit || unit[0] == '\0') +@@ -472,7 +486,8 @@ const char *str2number(const char *string, qsize_t *inodes) + else + return _("Unknown decimal unit. " + "Valid units are k, m, g, t."); +- if (number > QSIZE_MAX / multiple) ++ if (number > QSIZE_MAX / multiple || ++ -number < QSIZE_MAX / multiple) + return _("Integer overflow while interpreting decimal unit."); + *inodes = number * multiple; + return NULL; +diff --git a/quotasys.h b/quotasys.h +index 5ca26e6..e79f8cd 100644 +--- a/quotasys.h ++++ b/quotasys.h +@@ -113,7 +113,7 @@ void space2str(qsize_t, char *, int); + const char *str2space(const char *string, qsize_t *space); + + /* Convert number to short printable form */ +-void number2str(unsigned long long, char *, int); ++void number2str(long long, char *, int); + + /* Convert inode number with unit from string to quota inodes. */ + const char *str2number(const char *string, qsize_t *inodes); +-- +2.13.6 + diff --git a/SOURCES/quota-4.01-Recognize-block-limit-units-on-setquota-standard-inp.patch b/SOURCES/quota-4.01-Recognize-block-limit-units-on-setquota-standard-inp.patch new file mode 100644 index 0000000..d017cd8 --- /dev/null +++ b/SOURCES/quota-4.01-Recognize-block-limit-units-on-setquota-standard-inp.patch @@ -0,0 +1,74 @@ +From 2d851a9726b799078f8c2279d8dd9ce39b7b4055 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 9 Jan 2013 17:27:11 +0100 +Subject: [PATCH 2/5] Recognize block limit units on setquota standard input +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch adds support for binary suffixes on `setquota -b' input. + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + setquota.c | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) + +diff --git a/setquota.c b/setquota.c +index ccac7f7..e55b79d 100644 +--- a/setquota.c ++++ b/setquota.c +@@ -319,7 +319,9 @@ static int read_entry(qid_t *id, qsize_t *isoftlimit, qsize_t *ihardlimit, qsize + static int line = 0; + char name[MAXNAMELEN+1]; + char linebuf[MAXLINELEN], *chptr; +- unsigned long is, ih, bs, bh; ++ unsigned long is, ih; ++ char bs[MAXNAMELEN+1], bh[MAXNAMELEN+1]; ++ const char *error; + int ret; + + while (1) { +@@ -337,7 +339,7 @@ static int read_entry(qid_t *id, qsize_t *isoftlimit, qsize_t *ihardlimit, qsize + chptr++; + if (*chptr == '\n') + continue; +- ret = sscanf(chptr, "%s %lu %lu %lu %lu", name, &bs, &bh, &is, &ih); ++ ret = sscanf(chptr, "%s %s %s %lu %lu", name, bs, bh, &is, &ih); + if (ret != 5) { + errstr(_("Cannot parse input line %d.\n"), line); + if (!(flags & FL_CONTINUE_BATCH)) +@@ -353,12 +355,28 @@ static int read_entry(qid_t *id, qsize_t *isoftlimit, qsize_t *ihardlimit, qsize + errstr(_("Skipping line.\n")); + continue; + } ++ error = str2space(bs, bsoftlimit); ++ if (error) { ++ errstr(_("Unable to parse block soft limit '%s' " ++ "on line %d: %s\n"), bs, line, error); ++ if (!(flags & FL_CONTINUE_BATCH)) ++ die(1, _("Exitting.\n")); ++ errstr(_("Skipping line.\n")); ++ continue; ++ } ++ error = str2space(bh, bhardlimit); ++ if (error) { ++ errstr(_("Unable to parse block hard limit '%s' " ++ "on line %d: %s\n"), bh, line, error); ++ if (!(flags & FL_CONTINUE_BATCH)) ++ die(1, _("Exitting.\n")); ++ errstr(_("Skipping line.\n")); ++ continue; ++ } + break; + } + *isoftlimit = is; + *ihardlimit = ih; +- *bsoftlimit = bs; +- *bhardlimit = bh; + return 0; + } + +-- +1.8.1.4 + diff --git a/SOURCES/quota-4.01-Recognize-units-at-block-limits-by-edquota.patch b/SOURCES/quota-4.01-Recognize-units-at-block-limits-by-edquota.patch new file mode 100644 index 0000000..ce0f1d6 --- /dev/null +++ b/SOURCES/quota-4.01-Recognize-units-at-block-limits-by-edquota.patch @@ -0,0 +1,89 @@ +From f61d6442cc92a2b2935db6995b8d901235dbd076 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 9 Jan 2013 18:16:14 +0100 +Subject: [PATCH 3/5] Recognize units at block limits by edquota +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +With this patch, it's possible to specify block values including +binary units in the editor run by edquota. + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + edquota.8 | 4 ++++ + quotaops.c | 28 +++++++++++++++++++++++++--- + 2 files changed, 29 insertions(+), 3 deletions(-) + +diff --git a/edquota.8 b/edquota.8 +index 4b1406b..2617068 100644 +--- a/edquota.8 ++++ b/edquota.8 +@@ -64,6 +64,10 @@ is then invoked on the file. The quotas may then be modified, new + quotas added, etc. + Setting a quota to zero indicates that no quota should be imposed. + .PP ++Block usage and limits are reported and interpereted as multiples of kibibyte ++(1024 bytes) blocks by default. Symbols K, M, G, and T can be appended to ++numeric value to express kibibytes, mebibytes, gibibytes, and tebibytes. ++.PP + Users are permitted to exceed their soft limits for a grace period that + may be specified per filesystem. Once the grace period has expired, the + soft limit is enforced as a hard limit. +diff --git a/quotaops.c b/quotaops.c +index 1416015..32e21da 100644 +--- a/quotaops.c ++++ b/quotaops.c +@@ -310,9 +310,12 @@ int readprivs(struct dquot *qlist, int infd) + { + FILE *fd; + int cnt; +- long long blocks, bsoft, bhard, inodes, isoft, ihard; ++ qsize_t blocks, bsoft, bhard; ++ long long inodes, isoft, ihard; + struct dquot *q; + char fsp[BUFSIZ], line[BUFSIZ]; ++ char blocksstring[BUFSIZ], bsoftstring[BUFSIZ], bhardstring[BUFSIZ]; ++ const char *error; + + lseek(infd, 0, SEEK_SET); + if (!(fd = fdopen(dup(infd), "r"))) +@@ -325,13 +328,32 @@ int readprivs(struct dquot *qlist, int infd) + fgets(line, sizeof(line), fd); + + while (fgets(line, sizeof(line), fd)) { +- cnt = sscanf(line, "%s %llu %llu %llu %llu %llu %llu", +- fsp, &blocks, &bsoft, &bhard, &inodes, &isoft, &ihard); ++ cnt = sscanf(line, "%s %s %s %s %llu %llu %llu", ++ fsp, blocksstring, bsoftstring, bhardstring, ++ &inodes, &isoft, &ihard); + + if (cnt != 7) { + errstr(_("Bad format:\n%s\n"), line); + return -1; + } ++ error = str2space(blocksstring, &blocks); ++ if (error) { ++ errstr(_("Bad block usage: %s: %s\n"), ++ blocksstring, error); ++ return -1; ++ } ++ error = str2space(bsoftstring, &bsoft); ++ if (error) { ++ errstr(_("Bad block soft limit: %s: %s\n"), ++ bsoftstring, error); ++ return -1; ++ } ++ error = str2space(bhardstring, &bhard); ++ if (error) { ++ errstr(_("Bad block hard limit: %s: %s\n"), ++ bhardstring, error); ++ return -1; ++ } + + merge_limits_to_list(qlist, fsp, blocks, bsoft, bhard, inodes, isoft, ihard); + } +-- +1.8.1.4 + diff --git a/SOURCES/quota-4.01-Recognize-units-at-block-limits-by-setquota.patch b/SOURCES/quota-4.01-Recognize-units-at-block-limits-by-setquota.patch new file mode 100644 index 0000000..4c88120 --- /dev/null +++ b/SOURCES/quota-4.01-Recognize-units-at-block-limits-by-setquota.patch @@ -0,0 +1,151 @@ +From 0ada9c13f9b8299ff607b66c37022ce2a3c4444b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 9 Jan 2013 17:00:44 +0100 +Subject: [PATCH 1/5] Recognize units at block limits by setquota +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch allows to specify suffixes at block limits on setquota +command line. Binary units K, M, G, T are implemented. Numeric value +without suffix is equivatent to kibibytes as before. This is +complementary functionality to `quota -s'. + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + quota.h | 2 ++ + quotasys.c | 31 +++++++++++++++++++++++++++++++ + quotasys.h | 3 +++ + setquota.8 | 7 +++++++ + setquota.c | 17 +++++++++++++++-- + 5 files changed, 58 insertions(+), 2 deletions(-) + +diff --git a/quota.h b/quota.h +index ac034d0..6787eab 100644 +--- a/quota.h ++++ b/quota.h +@@ -2,9 +2,11 @@ + #define GUARD_QUOTA_H + + #include ++#include + + typedef u_int32_t qid_t; /* Type in which we store ids in memory */ + typedef int64_t qsize_t; /* Type in which we store size limitations */ ++#define QSIZE_MAX INT64_MAX /* Maximum value storable in qsize_t */ + + #define MAXQUOTAS 2 + #define USRQUOTA 0 /* element used for user quotas */ +diff --git a/quotasys.c b/quotasys.c +index 03f678a..5c1464f 100644 +--- a/quotasys.c ++++ b/quotasys.c +@@ -367,6 +367,37 @@ void space2str(qsize_t space, char *buf, int format) + } + + /* ++ * Convert block number with unit from string to quota blocks. ++ * Return NULL on success, static error message otherwise. ++ */ ++const char *str2space(const char *string, qsize_t *space) ++{ ++ char *unit; ++ unsigned long long int number; ++ int unit_shift; ++ ++ number = strtoull(string, &unit, 0); ++ if (ULLONG_MAX == number) ++ return _("Integer overflow while parsing space number."); ++ ++ if (!unit || unit[0] == '\0' || !strcmp(unit, _("K"))) ++ unit_shift = 0; ++ else if (!strcmp(unit, _("M"))) ++ unit_shift = 10; ++ else if (!strcmp(unit, _("G"))) ++ unit_shift = 20; ++ else if (!strcmp(unit, _("T"))) ++ unit_shift = 30; ++ else ++ return _("Unknown space binary unit. " ++ "Valid units are K, M, G, T."); ++ if (number > (QSIZE_MAX >> unit_shift)) ++ return _("Integer overflow while interpreting space unit."); ++ *space = number << unit_shift; ++ return NULL; ++} ++ ++/* + * Convert number to some nice short form for printing + */ + void number2str(unsigned long long num, char *buf, int format) +diff --git a/quotasys.h b/quotasys.h +index 1cebf7e..0cc2c4c 100644 +--- a/quotasys.h ++++ b/quotasys.h +@@ -103,6 +103,9 @@ int str2timeunits(time_t, char *, time_t *); + /* Convert number in quota blocks to short printable form */ + void space2str(qsize_t, char *, int); + ++/* Convert block number with unit from string to quota blocks */ ++const char *str2space(const char *string, qsize_t *space); ++ + /* Convert number to short printable form */ + void number2str(unsigned long long, char *, int); + +diff --git a/setquota.8 b/setquota.8 +index db9d054..e4511c4 100644 +--- a/setquota.8 ++++ b/setquota.8 +@@ -182,6 +182,13 @@ Go through all filesystems with quota in + .B /etc/mtab + and perform setting. + .PP ++.I block-softlimit ++and ++.I block-hardlimit ++are interpreted as multiples of kibibyte (1024 bytes) blocks by default. ++Symbols K, M, G, and T can be appended to numeric value to express kibibytes, ++mebibytes, gibibytes, and tebibytes. ++.PP + To disable a quota, set the corresponding parameter to 0. To change quotas + for several filesystems, invoke once for each filesystem. + .PP +diff --git a/setquota.c b/setquota.c +index f609dc7..ccac7f7 100644 +--- a/setquota.c ++++ b/setquota.c +@@ -93,6 +93,19 @@ static qsize_t parse_unum(char *str, char *msg) + return ret; + } + ++/* Convert block size to number - print errstr message in case of failure */ ++static qsize_t parse_blocksize(const char *str, const char *msg) ++{ ++ qsize_t ret; ++ const char *error = str2space(str, &ret); ++ ++ if (error) { ++ errstr(_("%s: %s: %s\n"), msg, str, error); ++ usage(); ++ } ++ return ret; ++} ++ + /* Convert our flags to quota type */ + static inline int flag2type(int flags) + { +@@ -226,8 +239,8 @@ static void parse_options(int argcnt, char **argstr) + if (!(flags & (FL_GRACE | FL_BATCH))) { + id = name2id(argstr[optind++], flag2type(flags), !!(flags & FL_NUMNAMES), NULL); + if (!(flags & (FL_GRACE | FL_INDIVIDUAL_GRACE | FL_PROTO))) { +- toset.dqb_bsoftlimit = parse_unum(argstr[optind++], _("Bad block softlimit")); +- toset.dqb_bhardlimit = parse_unum(argstr[optind++], _("Bad block hardlimit")); ++ toset.dqb_bsoftlimit = parse_blocksize(argstr[optind++], _("Bad block softlimit")); ++ toset.dqb_bhardlimit = parse_blocksize(argstr[optind++], _("Bad block hardlimit")); + toset.dqb_isoftlimit = parse_unum(argstr[optind++], _("Bad inode softlimit")); + toset.dqb_ihardlimit = parse_unum(argstr[optind++], _("Bad inode hardlimit")); + } +-- +1.8.1.4 + diff --git a/SOURCES/quota-4.01-Recognize-units-at-inode-limits-by-edquota.patch b/SOURCES/quota-4.01-Recognize-units-at-inode-limits-by-edquota.patch new file mode 100644 index 0000000..628dc54 --- /dev/null +++ b/SOURCES/quota-4.01-Recognize-units-at-inode-limits-by-edquota.patch @@ -0,0 +1,105 @@ +From 73316c7746e89896c63fc49f24cafe32335df288 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 9 Jan 2013 18:16:14 +0100 +Subject: [PATCH 5/5] Recognize units at inode limits by edquota +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +With this patch, it's possible to specify inode values including +decimal units in the editor run by edquota. + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + edquota.8 | 4 ++++ + quotaops.c | 26 ++++++++++++++++++++++---- + setquota.c | 2 -- + 3 files changed, 26 insertions(+), 6 deletions(-) + +diff --git a/edquota.8 b/edquota.8 +index 2617068..fefb5d4 100644 +--- a/edquota.8 ++++ b/edquota.8 +@@ -68,6 +68,10 @@ Block usage and limits are reported and interpereted as multiples of kibibyte + (1024 bytes) blocks by default. Symbols K, M, G, and T can be appended to + numeric value to express kibibytes, mebibytes, gibibytes, and tebibytes. + .PP ++Inode usage and limits are interpreted literally. Symbols k, m, g, and t can ++be appended to numeric value to express multiples of 10^3, 10^6, 10^9, and ++10^12 inodes. ++.PP + Users are permitted to exceed their soft limits for a grace period that + may be specified per filesystem. Once the grace period has expired, the + soft limit is enforced as a hard limit. +diff --git a/quotaops.c b/quotaops.c +index 32e21da..175a945 100644 +--- a/quotaops.c ++++ b/quotaops.c +@@ -310,11 +310,11 @@ int readprivs(struct dquot *qlist, int infd) + { + FILE *fd; + int cnt; +- qsize_t blocks, bsoft, bhard; +- long long inodes, isoft, ihard; ++ qsize_t blocks, bsoft, bhard, inodes, isoft, ihard; + struct dquot *q; + char fsp[BUFSIZ], line[BUFSIZ]; + char blocksstring[BUFSIZ], bsoftstring[BUFSIZ], bhardstring[BUFSIZ]; ++ char inodesstring[BUFSIZ], isoftstring[BUFSIZ], ihardstring[BUFSIZ]; + const char *error; + + lseek(infd, 0, SEEK_SET); +@@ -328,9 +328,9 @@ int readprivs(struct dquot *qlist, int infd) + fgets(line, sizeof(line), fd); + + while (fgets(line, sizeof(line), fd)) { +- cnt = sscanf(line, "%s %s %s %s %llu %llu %llu", ++ cnt = sscanf(line, "%s %s %s %s %s %s %s", + fsp, blocksstring, bsoftstring, bhardstring, +- &inodes, &isoft, &ihard); ++ inodesstring, isoftstring, ihardstring); + + if (cnt != 7) { + errstr(_("Bad format:\n%s\n"), line); +@@ -354,6 +354,24 @@ int readprivs(struct dquot *qlist, int infd) + bhardstring, error); + return -1; + } ++ error = str2number(inodesstring, &inodes); ++ if (error) { ++ errstr(_("Bad inode usage: %s: %s\n"), ++ inodesstring, error); ++ return -1; ++ } ++ error = str2number(isoftstring, &isoft); ++ if (error) { ++ errstr(_("Bad inode soft limit: %s: %s\n"), ++ isoftstring, error); ++ return -1; ++ } ++ error = str2number(ihardstring, &ihard); ++ if (error) { ++ errstr(_("Bad inode hard limit: %s: %s\n"), ++ ihardstring, error); ++ return -1; ++ } + + merge_limits_to_list(qlist, fsp, blocks, bsoft, bhard, inodes, isoft, ihard); + } +diff --git a/setquota.c b/setquota.c +index 19449ad..cc5fee8 100644 +--- a/setquota.c ++++ b/setquota.c +@@ -406,8 +406,6 @@ static int read_entry(qid_t *id, qsize_t *isoftlimit, qsize_t *ihardlimit, qsize + } + break; + } +- *isoftlimit = is; +- *ihardlimit = ih; + return 0; + } + +-- +1.8.1.4 + diff --git a/SOURCES/quota-4.01-Recognize-units-at-inode-limits-by-setquota.patch b/SOURCES/quota-4.01-Recognize-units-at-inode-limits-by-setquota.patch new file mode 100644 index 0000000..3221f2f --- /dev/null +++ b/SOURCES/quota-4.01-Recognize-units-at-inode-limits-by-setquota.patch @@ -0,0 +1,177 @@ +From fdcf21db852bc8d6c1d0b41f2812ba614851e2b4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 9 Jan 2013 17:00:44 +0100 +Subject: [PATCH 4/5] Recognize units at inode limits by setquota +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch allows to specify suffixes at inode limits on setquota +command line and standard input. Decimal Units k, m, g, t are +implemented. Numeric value without suffix is equivatent to single +inodes as before. This is complementary functionality to `quota -s'. + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + quotasys.c | 32 ++++++++++++++++++++++++++++++++ + quotasys.h | 3 +++ + setquota.8 | 6 ++++++ + setquota.c | 39 +++++++++++++++++++++++++++++++++++---- + 4 files changed, 76 insertions(+), 4 deletions(-) + +diff --git a/quotasys.c b/quotasys.c +index 5c1464f..e583437 100644 +--- a/quotasys.c ++++ b/quotasys.c +@@ -416,6 +416,38 @@ void number2str(unsigned long long num, char *buf, int format) + } + + /* ++ * Convert inode number with unit from string to quota inodes. ++ * Return NULL on success, static error message otherwise. ++ */ ++const char *str2number(const char *string, qsize_t *inodes) ++{ ++ char *unit; ++ unsigned long long int number, multiple; ++ ++ number = strtoull(string, &unit, 0); ++ if (ULLONG_MAX == number) ++ return _("Integer overflow while parsing number."); ++ ++ if (!unit || unit[0] == '\0') ++ multiple = 1; ++ else if (!strcmp(unit, _("k"))) ++ multiple = 1000; ++ else if (!strcmp(unit, _("m"))) ++ multiple = 1000000; ++ else if (!strcmp(unit, _("g"))) ++ multiple = 1000000000; ++ else if (!strcmp(unit, _("t"))) ++ multiple = 1000000000000ULL; ++ else ++ return _("Unknown decimal unit. " ++ "Valid units are k, m, g, t."); ++ if (number > QSIZE_MAX / multiple) ++ return _("Integer overflow while interpreting decimal unit."); ++ *inodes = number * multiple; ++ return NULL; ++} ++ ++/* + * Wrappers for mount options processing functions + */ + +diff --git a/quotasys.h b/quotasys.h +index 0cc2c4c..505ea77 100644 +--- a/quotasys.h ++++ b/quotasys.h +@@ -109,6 +109,9 @@ const char *str2space(const char *string, qsize_t *space); + /* Convert number to short printable form */ + void number2str(unsigned long long, char *, int); + ++/* Convert inode number with unit from string to quota inodes. */ ++const char *str2number(const char *string, qsize_t *inodes); ++ + /* Return pointer to given mount option in mount option string */ + char *str_hasmntopt(const char *optstring, const char *opt); + +diff --git a/setquota.8 b/setquota.8 +index e4511c4..508309e 100644 +--- a/setquota.8 ++++ b/setquota.8 +@@ -189,6 +189,12 @@ are interpreted as multiples of kibibyte (1024 bytes) blocks by default. + Symbols K, M, G, and T can be appended to numeric value to express kibibytes, + mebibytes, gibibytes, and tebibytes. + .PP ++.I inode-softlimit ++and ++.I inode-hardlimit ++are interpreted literally. Symbols k, m, g, and t can be appended to numeric ++value to express multiples of 10^3, 10^6, 10^9, and 10^12 inodes. ++.PP + To disable a quota, set the corresponding parameter to 0. To change quotas + for several filesystems, invoke once for each filesystem. + .PP +diff --git a/setquota.c b/setquota.c +index e55b79d..19449ad 100644 +--- a/setquota.c ++++ b/setquota.c +@@ -106,6 +106,19 @@ static qsize_t parse_blocksize(const char *str, const char *msg) + return ret; + } + ++/* Convert inode count to number - print errstr message in case of failure */ ++static qsize_t parse_inodecount(const char *str, const char *msg) ++{ ++ qsize_t ret; ++ const char *error = str2number(str, &ret); ++ ++ if (error) { ++ errstr(_("%s: %s: %s\n"), msg, str, error); ++ usage(); ++ } ++ return ret; ++} ++ + /* Convert our flags to quota type */ + static inline int flag2type(int flags) + { +@@ -241,8 +254,8 @@ static void parse_options(int argcnt, char **argstr) + if (!(flags & (FL_GRACE | FL_INDIVIDUAL_GRACE | FL_PROTO))) { + toset.dqb_bsoftlimit = parse_blocksize(argstr[optind++], _("Bad block softlimit")); + toset.dqb_bhardlimit = parse_blocksize(argstr[optind++], _("Bad block hardlimit")); +- toset.dqb_isoftlimit = parse_unum(argstr[optind++], _("Bad inode softlimit")); +- toset.dqb_ihardlimit = parse_unum(argstr[optind++], _("Bad inode hardlimit")); ++ toset.dqb_isoftlimit = parse_inodecount(argstr[optind++], _("Bad inode softlimit")); ++ toset.dqb_ihardlimit = parse_inodecount(argstr[optind++], _("Bad inode hardlimit")); + } + else if (flags & FL_PROTO) + protoid = name2id(protoname, flag2type(flags), !!(flags & FL_NUMNAMES), NULL); +@@ -319,7 +332,7 @@ static int read_entry(qid_t *id, qsize_t *isoftlimit, qsize_t *ihardlimit, qsize + static int line = 0; + char name[MAXNAMELEN+1]; + char linebuf[MAXLINELEN], *chptr; +- unsigned long is, ih; ++ char is[MAXNAMELEN+1], ih[MAXNAMELEN+1]; + char bs[MAXNAMELEN+1], bh[MAXNAMELEN+1]; + const char *error; + int ret; +@@ -339,7 +352,7 @@ static int read_entry(qid_t *id, qsize_t *isoftlimit, qsize_t *ihardlimit, qsize + chptr++; + if (*chptr == '\n') + continue; +- ret = sscanf(chptr, "%s %s %s %lu %lu", name, bs, bh, &is, &ih); ++ ret = sscanf(chptr, "%s %s %s %s %s", name, bs, bh, is, ih); + if (ret != 5) { + errstr(_("Cannot parse input line %d.\n"), line); + if (!(flags & FL_CONTINUE_BATCH)) +@@ -373,6 +386,24 @@ static int read_entry(qid_t *id, qsize_t *isoftlimit, qsize_t *ihardlimit, qsize + errstr(_("Skipping line.\n")); + continue; + } ++ error = str2number(is, isoftlimit); ++ if (error) { ++ errstr(_("Unable to parse inode soft limit '%s' " ++ "on line %d: %s\n"), is, line, error); ++ if (!(flags & FL_CONTINUE_BATCH)) ++ die(1, _("Exitting.\n")); ++ errstr(_("Skipping line.\n")); ++ continue; ++ } ++ error = str2number(ih, ihardlimit); ++ if (error) { ++ errstr(_("Unable to parse inode hard limit '%s' " ++ "on line %d: %s\n"), ih, line, error); ++ if (!(flags & FL_CONTINUE_BATCH)) ++ die(1, _("Exitting.\n")); ++ errstr(_("Skipping line.\n")); ++ continue; ++ } + break; + } + *isoftlimit = is; +-- +1.8.1.4 + diff --git a/SOURCES/quota-4.01-Remove-installation-of-manpages-into-section-2.patch b/SOURCES/quota-4.01-Remove-installation-of-manpages-into-section-2.patch new file mode 100644 index 0000000..03e8357 --- /dev/null +++ b/SOURCES/quota-4.01-Remove-installation-of-manpages-into-section-2.patch @@ -0,0 +1,41 @@ +From 246dd4960e6878f3ff2e1fe34ef978bcb21e8d03 Mon Sep 17 00:00:00 2001 +From: Carsten Grohmann +Date: Wed, 14 Aug 2013 18:16:46 +0200 +Subject: [PATCH] Remove installation of manpages into section 2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There are no manpages in this section in quota tools anymore. So just +remove the installation commands. + +Signed-off-by: Carsten Grohmann +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + Makefile.in | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index c81d7a9..84fafce 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -89,7 +89,6 @@ install: all @INSTMO@ + -$(INSTALL) -m $(DEF_CONF_MODE) quotatab $(ROOTDIR)$(sysconfdir) + -$(INSTALL) -m $(DEF_CONF_MODE) quotagrpadmins $(ROOTDIR)$(sysconfdir) + -mkdir -p $(ROOTDIR)$(mandir)/man1 +- -mkdir -p $(ROOTDIR)$(mandir)/man2 + -mkdir -p $(ROOTDIR)$(mandir)/man3 + -mkdir -p $(ROOTDIR)$(mandir)/man8 + -$(INSTALL) -m 755 -d $(ROOTDIR)$(includedir)/rpcsvc +@@ -100,7 +99,6 @@ ifneq ($(NETLINKLIBS),) + -$(INSTALL) $(STRIP) -m $(DEF_SBIN_MODE) quota_nld $(ROOTDIR)$(sbindir) + endif + -$(INSTALL) -m $(DEF_MAN_MODE) *.1 $(ROOTDIR)$(mandir)/man1 +- -$(INSTALL) -m $(DEF_MAN_MODE) *.2 $(ROOTDIR)$(mandir)/man2 + -$(INSTALL) -m $(DEF_MAN_MODE) *.3 $(ROOTDIR)$(mandir)/man3 + -$(INSTALL) -m $(DEF_MAN_MODE) *.8 $(ROOTDIR)$(mandir)/man8 + +-- +1.8.3.1 + diff --git a/SOURCES/quota-4.01-define_charset_in_mail.patch b/SOURCES/quota-4.01-define_charset_in_mail.patch new file mode 100644 index 0000000..699f519 --- /dev/null +++ b/SOURCES/quota-4.01-define_charset_in_mail.patch @@ -0,0 +1,79 @@ +From aebb8189069f24e6f4e59cf79f179bcbafe7a098 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Tue, 6 Nov 2012 11:04:44 +0100 +Subject: [PATCH 1/2] warnquota: Add MIME-Version header + +Warnquota forgot to add MIME-Version header to sent email when Content-type +etc. fields were set. + +Signed-off-by: Jan Kara +--- + warnquota.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/warnquota.c b/warnquota.c +index 08827f2..80f528c 100644 +--- a/warnquota.c ++++ b/warnquota.c +@@ -503,6 +503,7 @@ static int mail_user(struct offenderlist *offender, struct configparams *config) + if (should_cc(offender, config)) + fprintf(fp, "Cc: %s\n", config->cc_to); + if ((config->charset)[0] != '\0') { /* are we supposed to set the encoding */ ++ fprintf(fp, "MIME-Version: 1.0\n"); + fprintf(fp, "Content-Type: text/plain; charset=%s\n", config->charset); + fprintf(fp, "Content-Disposition: inline\n"); + fprintf(fp, "Content-Transfer-Encoding: 8bit\n"); +-- +1.7.11.7 + +From d8bb9ec3cef26cd3fb62534d896bf9c8feea67f9 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Tue, 6 Nov 2012 12:12:19 +0100 +Subject: [PATCH 2/2] warnquota: Use current locale as default charset + +If charset in warnquota.conf is not specified, use charset from current +locale as the charset of the warning email. This is to accomodate possible +translations of messages via gettext. + +Signed-off-by: Jan Kara +--- + warnquota.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/warnquota.c b/warnquota.c +index 80f528c..5c5a1b9 100644 +--- a/warnquota.c ++++ b/warnquota.c +@@ -29,6 +29,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -707,6 +709,7 @@ static int readconfigfile(const char *filename, struct configparams *config) + char *value; + char *pos; + int line, len, bufpos; ++ char *locale; + + /* set default values */ + sstrncpy(config->mail_cmd, MAIL_CMD, CNF_BUFFER); +@@ -716,6 +719,12 @@ static int readconfigfile(const char *filename, struct configparams *config) + sstrncpy(config->support, SUPPORT, CNF_BUFFER); + sstrncpy(config->phone, PHONE, CNF_BUFFER); + (config->charset)[0] = '\0'; ++ setlocale(LC_ALL, NULL); ++ locale = setlocale(LC_MESSAGES, NULL); ++ if (locale && strcasecmp(locale, "posix") && strcasecmp(locale, "c")) { ++ locale = nl_langinfo(CODESET); ++ sstrncpy(config->charset, locale, CNF_BUFFER); ++ } + maildev[0] = 0; + config->user_signature = config->user_message = config->group_signature = config->group_message = NULL; + config->use_ldap_mail = 0; +-- +1.7.11.7 + diff --git a/SOURCES/quota-4.01-quotacheck-Make-sure-d-provides-at-least-as-much-inf.patch b/SOURCES/quota-4.01-quotacheck-Make-sure-d-provides-at-least-as-much-inf.patch new file mode 100644 index 0000000..7d72142 --- /dev/null +++ b/SOURCES/quota-4.01-quotacheck-Make-sure-d-provides-at-least-as-much-inf.patch @@ -0,0 +1,63 @@ +From 8985a04067eb396877593db102d4a535c8a2871a Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Mon, 4 Feb 2013 23:21:30 +0100 +Subject: [PATCH] quotacheck: Make sure -d provides at least as much + information as -v + +There was a couple of useful messages that were printed when -v was +specified but not when -d was specified. Fix this. + +Signed-off-by: Jan Kara +--- + quotacheck.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/quotacheck.c b/quotacheck.c +index e047825..e62c3a7 100644 +--- a/quotacheck.c ++++ b/quotacheck.c +@@ -880,12 +880,12 @@ static int sub_quota_file(struct mount_entry *mnt, int qtype, int ftype) + + debug(FL_DEBUG, _("Substracting space used by old %s quota file.\n"), _(type2name(ftype))); + if (get_qf_name(mnt, ftype, cfmt, 0, &filename) < 0) { +- debug(FL_VERBOSE, _("Old %s file name could not been determined. Usage will not be subtracted.\n"), _(type2name(ftype))); ++ debug(FL_VERBOSE | FL_DEBUG, _("Old %s file name could not been determined. Usage will not be subtracted.\n"), _(type2name(ftype))); + return 0; + } + + if (stat(filename, &st) < 0) { +- debug(FL_VERBOSE, _("Cannot stat old %s quota file %s: %s. Usage will not be subtracted.\n"), _(type2name(ftype)), filename, strerror(errno)); ++ debug(FL_VERBOSE | FL_DEBUG, _("Cannot stat old %s quota file %s: %s. Usage will not be subtracted.\n"), _(type2name(ftype)), filename, strerror(errno)); + free(filename); + return 0; + } +@@ -961,7 +961,7 @@ Please stop all programs writing to filesystem or use -m flag to force checking. + debug(FL_DEBUG, _("Filesystem remounted read-only\n")); + } + start_scan: +- debug(FL_VERBOSE, _("Scanning %s [%s] "), mnt->me_devname, mnt->me_dir); ++ debug(FL_VERBOSE | FL_DEBUG, _("Scanning %s [%s] "), mnt->me_devname, mnt->me_dir); + #if defined(EXT2_DIRECT) + if (!strcmp(mnt->me_type, MNTTYPE_EXT2) || !strcmp(mnt->me_type, MNTTYPE_EXT3) || !strcmp(mnt->me_type, MNTTYPE_NEXT3)) { + if ((failed = ext2_direct_scan(mnt->me_devname)) < 0) +@@ -977,7 +977,7 @@ start_scan: + goto out; + } + dirs_done++; +- if (flags & FL_VERBOSE || flags & FL_VERYVERBOSE) ++ if (flags & FL_VERBOSE || flags & FL_DEBUG) + fputs(_("done\n"), stdout); + if (ucheck) { + failed |= sub_quota_file(mnt, USRQUOTA, USRQUOTA); +@@ -1171,7 +1171,7 @@ static int check_all(void) + debug(FL_DEBUG, _("Detected quota format %s\n"), fmt2name(cfmt)); + } + +- if (flags & FL_VERBOSE && ++ if (flags & (FL_VERBOSE | FL_DEBUG) && + !str_hasmntopt(mnt->me_opts, MNTOPT_USRJQUOTA) && + !str_hasmntopt(mnt->me_opts, MNTOPT_GRPJQUOTA) && + !warned && +-- +1.8.1.2 + diff --git a/SOURCES/quota-4.01-warnquota.patch b/SOURCES/quota-4.01-warnquota.patch new file mode 100644 index 0000000..a713ce9 --- /dev/null +++ b/SOURCES/quota-4.01-warnquota.patch @@ -0,0 +1,71 @@ +From d2f7a6be1526a6f46cbf37aa27587a51e4d5990f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 23 Aug 2011 13:45:15 +0200 +Subject: [PATCH] warnquota configuration tunes + +Rest of changes (378a64006bb1e818e84a1c77808563b802b028fa) not +accepted by upstream (we had root@... addresses and more enterprise +wordings usually there). +--- + warnquota.c | 2 +- + warnquota.conf | 17 ++++++++--------- + 2 files changed, 9 insertions(+), 10 deletions(-) + +diff --git a/warnquota.c b/warnquota.c +index 08827f2..c7ca6f2 100644 +--- a/warnquota.c ++++ b/warnquota.c +@@ -806,7 +806,7 @@ static int readconfigfile(const char *filename, struct configparams *config) + verify_format(config->group_signature, "GROUP_SIGNATURE"); + } + else if (!strcmp(var, "LDAP_MAIL")) { +- if(strcasecmp(value, "true") == 0) ++ if(strncasecmp(value, "true", 4) == 0) + config->use_ldap_mail = 1; + else + config->use_ldap_mail = 0; +diff --git a/warnquota.conf b/warnquota.conf +index 2a72b78..77f6a75 100644 +--- a/warnquota.conf ++++ b/warnquota.conf +@@ -4,17 +4,16 @@ + # and even blank lines + + # values can be quoted: +-#MAIL_CMD = "/usr/my/sendmail/instead/sendmail -t" +-MAIL_CMD = "/bin/echo" +-FROM = "bas@example.com" ++MAIL_CMD = "/usr/sbin/sendmail -t" ++FROM = "root@example.com" + # but they don't have to be: +-SUBJECT = Hey, user, clean up your account! +-CC_TO = "sysadm@example.com" ++SUBJECT = NOTE: You are exceeding your allocated disk space limits ++CC_TO = "root@example.com" + # If you set this variable CC will be used only when user has less than + # specified grace time left (examples of possible times: 5 seconds, 1 minute, + # 12 hours, 5 days) + # CC_BEFORE = 2 days +-SUPPORT = "support@example.com" ++SUPPORT = "root@example.com" + PHONE = "(123) 456-1111 or (222) 333-4444" + # Text in the beginning of the mail (if not specified, default text is used) + # This way text can be split to more lines +@@ -22,11 +21,11 @@ PHONE = "(123) 456-1111 or (222) 333-4444" + # The expressions %i, %h, %d, and %% are substituted for user/group name, + # host name, domain name, and '%' respectively. For backward compatibility + # %s behaves as %i but is deprecated. +-MESSAGE = Hello user %i, I've noticed you use too much space\ +- on my disk in %h.%d.|Delete your files on the following filesystems:| ++MESSAGE = Your disk usage has exceeded the agreed limits\ ++ on this server|Please delete any unnecessary files on following filesystems:| + # Text in the end of the mail (if not specified, default text using SUPPORT and PHONE + # is created) +-SIGNATURE = See you!| Your admin of %h| ++SIGNATURE = root@example.com + # Following text is used for mails about group exceeding quotas + GROUP_MESSAGE = Hello, a group '%i' you're member of use too much space at %h.|\ + I chose you to do the cleanup.|Delete group files on the following filesystems:| +-- +1.7.11.4 + diff --git a/SOURCES/quota-4.02-Fix-handling-of-space-and-inode-values.patch b/SOURCES/quota-4.02-Fix-handling-of-space-and-inode-values.patch new file mode 100644 index 0000000..46c2308 --- /dev/null +++ b/SOURCES/quota-4.02-Fix-handling-of-space-and-inode-values.patch @@ -0,0 +1,64 @@ +From 663ac451b045b4823d6d633893a5d748c09f42f2 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Wed, 1 Oct 2014 18:10:40 +0200 +Subject: [PATCH] Fix handling of space and inode values +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit 0214512479e0 (Properly handle signed space and inode values) +broke parsing of pure numbers in str2number() so that it would always +complain about "Integer overflow while interpreting decimal unit". Fix +condition checking for overflow. + +Also number2str() was buggy and wouldn't guess proper units for negative +numbers. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotasys.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/quotasys.c b/quotasys.c +index a5737a8..4b49e0e 100644 +--- a/quotasys.c ++++ b/quotasys.c +@@ -459,17 +459,19 @@ void number2str(long long num, char *buf, int format) + int i; + unsigned long long div; + char suffix[8] = " kmgt"; +- long long anum = num >= 0 ? num : -num; + +- if (format) +- for (i = 4, div = 1000000000000LL; i > 0; i--, div /= 1000) +- if (num >= 100*div) { +- int sign = num != anum ? -1 : 1; ++ if (format) { ++ long long anum = num >= 0 ? num : -num; ++ int sign = num != anum ? -1 : 1; + +- sprintf(buf, "%lld%c", (num+div-1) / div * sign, ++ for (i = 4, div = 1000000000000LL; i > 0; i--, div /= 1000) ++ if (anum >= 100*div) { ++ sprintf(buf, "%lld%c", ++ DIV_ROUND_UP(anum, div) * sign, + suffix[i]); + return; + } ++ } + sprintf(buf, "%lld", num); + } + +@@ -500,7 +502,7 @@ const char *str2number(const char *string, qsize_t *inodes) + return _("Unknown decimal unit. " + "Valid units are k, m, g, t."); + if (number > QSIZE_MAX / multiple || +- -number < QSIZE_MAX / multiple) ++ number < -(QSIZE_MAX / multiple)) + return _("Integer overflow while interpreting decimal unit."); + *inodes = number * multiple; + return NULL; +-- +1.9.3 + diff --git a/SOURCES/quota-4.02-Skip-NFS-mounts-without-rquotad-RPC-service-silently.patch b/SOURCES/quota-4.02-Skip-NFS-mounts-without-rquotad-RPC-service-silently.patch new file mode 100644 index 0000000..1a512e2 --- /dev/null +++ b/SOURCES/quota-4.02-Skip-NFS-mounts-without-rquotad-RPC-service-silently.patch @@ -0,0 +1,125 @@ +From bffaeb028ee716ed46e5b74a45162f2ef45b2963 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Thu, 23 Oct 2014 14:12:01 +0200 +Subject: [PATCH] Skip NFS mounts without rquotad RPC service silently +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If NFS server does uses quotas, then it's high chance the RCP rquotad +service is not running at all. Then listing quotas for such NFS mount +point results into a warning about "connection refused". + +This warning can be obtrusive if a host has mounted various mixture of +NFS exports with and without quotas. + +This patch recognizes this special error state (after performing +a query to a client without running rquotad) and considers such +server as having quotas disabled. This silents the warning +effectively. + +JK: Some coding style fixes, treat also rpc_set_quota() this way. + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + rquota_client.c | 38 ++++++++++++++++++++++++++++++++++---- + 1 file changed, 34 insertions(+), 4 deletions(-) + +diff --git a/rquota_client.c b/rquota_client.c +index 9d4055e..a3a4ae3 100644 +--- a/rquota_client.c ++++ b/rquota_client.c +@@ -148,6 +148,8 @@ int rpc_rquota_get(struct dquot *dquot) + } args; + char *fsname_tmp, *host, *pathname; + struct timeval timeout = { 2, 0 }; ++ int rquotaprog_not_registered = 0; ++ int ret; + + /* + * Initialize with NULL. +@@ -206,8 +208,11 @@ int rpc_rquota_get(struct dquot *dquot) + auth_destroy(clnt->cl_auth); + clnt_destroy(clnt); + } +- else ++ else { + result = NULL; ++ if (rpc_createerr.cf_stat == RPC_PROGNOTREGISTERED) ++ rquotaprog_not_registered = 1; ++ } + + if (result == NULL || !result->status) { + if (dquot->dq_h->qh_type == USRQUOTA) { +@@ -244,11 +249,21 @@ int rpc_rquota_get(struct dquot *dquot) + */ + auth_destroy(clnt->cl_auth); + clnt_destroy(clnt); ++ } else { ++ result = NULL; ++ if (rpc_createerr.cf_stat == RPC_PROGNOTREGISTERED) ++ rquotaprog_not_registered = 1; + } + } + } + free(fsname_tmp); +- return rquota_err(result?result->status:-1); ++ if (result) ++ ret = result->status; ++ else if (rquotaprog_not_registered) ++ ret = Q_NOQUOTA; ++ else ++ ret = -1; ++ return rquota_err(ret); + } + + /* +@@ -265,6 +280,8 @@ int rpc_rquota_set(int qcmd, struct dquot *dquot) + } args; + char *fsname_tmp, *host, *pathname; + struct timeval timeout = { 2, 0 }; ++ int rquotaprog_not_registered = 0; ++ int ret; + + /* RPC limits values to 32b variables. Prevent value wrapping. */ + if (check_dquot_range(dquot) < 0) +@@ -321,8 +338,11 @@ int rpc_rquota_set(int qcmd, struct dquot *dquot) + auth_destroy(clnt->cl_auth); + clnt_destroy(clnt); + } +- else ++ else { + result = NULL; ++ if (rpc_createerr.cf_stat == RPC_PROGNOTREGISTERED) ++ rquotaprog_not_registered = 1; ++ } + + if (result == NULL || !result->status) { + if (dquot->dq_h->qh_type == USRQUOTA) { +@@ -361,11 +381,21 @@ int rpc_rquota_set(int qcmd, struct dquot *dquot) + */ + auth_destroy(clnt->cl_auth); + clnt_destroy(clnt); ++ } else { ++ result = NULL; ++ if (rpc_createerr.cf_stat == RPC_PROGNOTREGISTERED) ++ rquotaprog_not_registered = 1; + } + } + } + free(fsname_tmp); +- return rquota_err(result?result->status:-1); ++ if (result) ++ ret = result->status; ++ else if (rquotaprog_not_registered) ++ ret = Q_NOQUOTA; ++ else ++ ret = -1; ++ return rquota_err(ret); + #endif + return -1; + } +-- +1.9.3 + diff --git a/SOURCES/quota-4.03-Add-support-for-scanning-using-Q_XGETNEXTQUOTA.patch b/SOURCES/quota-4.03-Add-support-for-scanning-using-Q_XGETNEXTQUOTA.patch new file mode 100644 index 0000000..1eb0d17 --- /dev/null +++ b/SOURCES/quota-4.03-Add-support-for-scanning-using-Q_XGETNEXTQUOTA.patch @@ -0,0 +1,92 @@ +From 7367f5d511ec4555fbb7a87c1c1853fd4fd01712 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Tue, 26 Jan 2016 14:06:59 +0100 +Subject: [PATCH 2/2] Add support for scanning using Q_XGETNEXTQUOTA +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add support for scanning of all available quota structures using +Q_XGETNEXTQUOTA quotactl. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotaio_xfs.c | 42 +++++++++++++++++++++++++++++++++++++++--- + quotaio_xfs.h | 1 + + 2 files changed, 40 insertions(+), 3 deletions(-) + +diff --git a/quotaio_xfs.c b/quotaio_xfs.c +index 903c03e..9d90a3e 100644 +--- a/quotaio_xfs.c ++++ b/quotaio_xfs.c +@@ -191,15 +191,51 @@ static int xfs_get_dquot(struct dquot *dq) + return 0; + } + ++static int xfs_kernel_scan_dquots(struct quota_handle *h, ++ int (*process_dquot)(struct dquot *dquot, char *dqname)) ++{ ++ struct dquot *dquot = get_empty_dquot(); ++ qid_t id = 0; ++ struct xfs_kern_dqblk xdqblk; ++ int ret; ++ ++ dquot->dq_h = h; ++ while (1) { ++ ret = quotactl(QCMD(Q_XGETNEXTQUOTA, h->qh_type), ++ h->qh_quotadev, id, (void *)&xdqblk); ++ if (ret < 0) ++ break; ++ ++ xfs_kern2utildqblk(&dquot->dq_dqb, &xdqblk); ++ dquot->dq_id = xdqblk.d_id; ++ ret = process_dquot(dquot, NULL); ++ if (ret < 0) ++ break; ++ id = xdqblk.d_id + 1; ++ } ++ free(dquot); ++ ++ if (errno == ENOENT) ++ return 0; ++ return ret; ++} ++ + /* + * Scan all known dquots and call callback on each + */ + static int xfs_scan_dquots(struct quota_handle *h, int (*process_dquot) (struct dquot *dquot, char *dqname)) + { +- if (!XFS_USRQUOTA(h) && !XFS_GRPQUOTA(h)) +- return 0; ++ int ret; ++ struct xfs_kern_dqblk xdqblk; + +- return generic_scan_dquots(h, process_dquot, xfs_get_dquot); ++ ret = quotactl(QCMD(Q_XGETNEXTQUOTA, h->qh_type), h->qh_quotadev, 0, ++ (void *)&xdqblk); ++ if (ret < 0 && (errno == ENOSYS || errno == EINVAL)) { ++ if (!XFS_USRQUOTA(h) && !XFS_GRPQUOTA(h)) ++ return 0; ++ return generic_scan_dquots(h, process_dquot, xfs_get_dquot); ++ } ++ return xfs_kernel_scan_dquots(h, process_dquot); + } + + /* +diff --git a/quotaio_xfs.h b/quotaio_xfs.h +index 54725b0..2236da4 100644 +--- a/quotaio_xfs.h ++++ b/quotaio_xfs.h +@@ -46,6 +46,7 @@ + #define Q_XSETQLIM XQM_CMD(0x4) /* set disk limits only */ + #define Q_XGETQSTAT XQM_CMD(0x5) /* returns fs_quota_stat_t struct */ + #define Q_XQUOTARM XQM_CMD(0x6) /* free quota files' space */ ++#define Q_XGETNEXTQUOTA XQM_CMD(0x9) /* get disk limits and usage >= ID */ + + /* + * fs_disk_quota structure: +-- +2.5.0 + diff --git a/SOURCES/quota-4.03-Scan-dquots-using-Q_GETNEXTQUOTA.patch b/SOURCES/quota-4.03-Scan-dquots-using-Q_GETNEXTQUOTA.patch new file mode 100644 index 0000000..38707ed --- /dev/null +++ b/SOURCES/quota-4.03-Scan-dquots-using-Q_GETNEXTQUOTA.patch @@ -0,0 +1,142 @@ +From 85687833434d50e3f5fd4b849e543eb505bf5a20 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Tue, 26 Jan 2016 13:10:59 +0100 +Subject: [PATCH 1/2] Scan dquots using Q_GETNEXTQUOTA +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Check for new kernel quotactl Q_GETNEXTQUOTA and if available use it for +scanning all dquot structures. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quota.h | 14 ++++++++++++++ + quotaio_generic.c | 34 ++++++++++++++++++++++++++++++++++ + quotaio_generic.h | 4 ++++ + quotaio_meta.c | 14 +++++++++++++- + 4 files changed, 65 insertions(+), 1 deletion(-) + +diff --git a/quota.h b/quota.h +index 0c38427..0607e04 100644 +--- a/quota.h ++++ b/quota.h +@@ -63,6 +63,7 @@ typedef int64_t qsize_t; /* Type in which we store size limitations */ + #define Q_SETINFO 0x800006 /* set information about quota files */ + #define Q_GETQUOTA 0x800007 /* get user quota structure */ + #define Q_SETQUOTA 0x800008 /* set user quota structure */ ++#define Q_GETNEXTQUOTA 0x800009 /* get disk limits and usage >= ID */ + + /* + * Quota structure used for communication with userspace via quotactl +@@ -91,6 +92,19 @@ struct if_dqblk { + u_int32_t dqb_valid; + }; + ++struct if_nextdqblk { ++ u_int64_t dqb_bhardlimit; ++ u_int64_t dqb_bsoftlimit; ++ u_int64_t dqb_curspace; ++ u_int64_t dqb_ihardlimit; ++ u_int64_t dqb_isoftlimit; ++ u_int64_t dqb_curinodes; ++ u_int64_t dqb_btime; ++ u_int64_t dqb_itime; ++ u_int32_t dqb_valid; ++ u_int32_t dqb_id; ++}; ++ + /* + * Structure used for setting quota information about file via quotactl + * Following flags are used to specify which fields are valid +diff --git a/quotaio_generic.c b/quotaio_generic.c +index 5001a56..4bdf380 100644 +--- a/quotaio_generic.c ++++ b/quotaio_generic.c +@@ -161,3 +161,37 @@ int generic_scan_dquots(struct quota_handle *h, + free(dquot); + return ret; + } ++ ++int vfs_scan_dquots(struct quota_handle *h, ++ int (*process_dquot)(struct dquot *dquot, char *dqname)) ++{ ++ struct dquot *dquot = get_empty_dquot(); ++ qid_t id = 0; ++ struct if_nextdqblk kdqblk; ++ int ret; ++ ++ dquot->dq_h = h; ++ while (1) { ++ ret = quotactl(QCMD(Q_GETNEXTQUOTA, h->qh_type), ++ h->qh_quotadev, id, (void *)&kdqblk); ++ if (ret < 0) ++ break; ++ ++ /* ++ * This is a slight hack but we know struct if_dqblk is a ++ * subset of struct if_nextdqblk ++ */ ++ generic_kern2utildqblk(&dquot->dq_dqb, ++ (struct if_dqblk *)&kdqblk); ++ dquot->dq_id = kdqblk.dqb_id; ++ ret = process_dquot(dquot, NULL); ++ if (ret < 0) ++ break; ++ id = kdqblk.dqb_id + 1; ++ } ++ free(dquot); ++ ++ if (errno == ENOENT) ++ return 0; ++ return ret; ++} +diff --git a/quotaio_generic.h b/quotaio_generic.h +index 5edc11c..a7930f0 100644 +--- a/quotaio_generic.h ++++ b/quotaio_generic.h +@@ -27,4 +27,8 @@ int generic_scan_dquots(struct quota_handle *h, + int (*process_dquot)(struct dquot *dquot, char *dqname), + int (*get_dquot)(struct dquot *dquot)); + ++/* Scan all dquots using kernel quotactl to get existing ids */ ++int vfs_scan_dquots(struct quota_handle *h, ++ int (*process_dquot)(struct dquot *dquot, char *dqname)); ++ + #endif +diff --git a/quotaio_meta.c b/quotaio_meta.c +index e52b4f4..ad6ff7a 100644 +--- a/quotaio_meta.c ++++ b/quotaio_meta.c +@@ -8,6 +8,7 @@ + + #include + #include ++#include + + #include + +@@ -55,7 +56,18 @@ static int meta_commit_dquot(struct dquot *dquot, int flags) + + static int meta_scan_dquots(struct quota_handle *h, int (*process_dquot)(struct dquot *dquot, char *dqname)) + { +- return generic_scan_dquots(h, process_dquot, vfs_get_dquot); ++ struct if_nextdqblk kdqblk; ++ int ret; ++ ++ ret = quotactl(QCMD(Q_GETNEXTQUOTA, h->qh_type), h->qh_quotadev, 0, ++ (void *)&kdqblk); ++ /* ++ * Fall back to scanning using passwd if Q_GETNEXTQUOTA is not ++ * supported ++ */ ++ if (ret < 0 && (errno == ENOSYS || errno == EINVAL)) ++ return generic_scan_dquots(h, process_dquot, vfs_get_dquot); ++ return vfs_scan_dquots(h, process_dquot); + } + + struct quotafile_ops quotafile_ops_meta = { +-- +2.5.0 + diff --git a/SOURCES/quota-4.03-quotacheck-Deallocate-memory-after-direct-scanning.patch b/SOURCES/quota-4.03-quotacheck-Deallocate-memory-after-direct-scanning.patch new file mode 100644 index 0000000..ee02d7b --- /dev/null +++ b/SOURCES/quota-4.03-quotacheck-Deallocate-memory-after-direct-scanning.patch @@ -0,0 +1,99 @@ +From bf9b17da317ecf56ceada3a575fb95669bf2041b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Mon, 21 Aug 2017 13:02:21 +0200 +Subject: [PATCH] quotacheck: Deallocate memory after direct scanning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +quotacheck had memory leaks because it did not clean up after direct +ext scanning: + +==6885== 1,392 (88 direct, 1,304 indirect) bytes in 1 blocks are definitely lost in loss record 19 of 23 +==6885== at 0x4C29BE3: malloc (vg_replace_malloc.c:299) +==6885== by 0x4E5288B: ext2fs_make_generic_bitmap (in /usr/lib64/libext2fs.so.2.4) +==6885== by 0x4E47ED5: ext2fs_allocate_inode_bitmap (in /usr/lib64/libext2fs.so.2.4) +==6885== by 0x10BBA5: ext2_direct_scan (quotacheck.c:435) +==6885== by 0x10DA8A: check_dir (quotacheck.c:971) +==6885== by 0x10E634: check_all (quotacheck.c:1192) +==6885== by 0x10E6EC: main (quotacheck.c:1212) +==6885== +==6885== 8,464 (144 direct, 8,320 indirect) bytes in 1 blocks are definitely lost in loss record 22 of 23 +==6885== at 0x4C29BE3: malloc (vg_replace_malloc.c:299) +==6885== by 0x4E5749D: ext2fs_open_inode_scan (in /usr/lib64/libext2fs.so.2.4) +==6885== by 0x10BBF0: ext2_direct_scan (quotacheck.c:440) +==6885== by 0x10DA8A: check_dir (quotacheck.c:971) +==6885== by 0x10E634: check_all (quotacheck.c:1192) +==6885== by 0x10E6EC: main (quotacheck.c:1212) +==6885== +==6885== 15,243 (88 direct, 15,155 indirect) bytes in 1 blocks are definitely lost in loss record 23 of 23 +==6885== at 0x4C29BE3: malloc (vg_replace_malloc.c:299) +==6885== by 0x4E5288B: ext2fs_make_generic_bitmap (in /usr/lib64/libext2fs.so.2.4) +==6885== by 0x4E47ED5: ext2fs_allocate_inode_bitmap (in /usr/lib64/libext2fs.so.2.4) +==6885== by 0x10BB55: ext2_direct_scan (quotacheck.c:430) +==6885== by 0x10DA8A: check_dir (quotacheck.c:971) +==6885== by 0x10E634: check_all (quotacheck.c:1192) +==6885== by 0x10E6EC: main (quotacheck.c:1212) + +Signed-off-by: Petr Písař +--- + quotacheck.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/quotacheck.c b/quotacheck.c +index 689ceb9..e9a84ba 100644 +--- a/quotacheck.c ++++ b/quotacheck.c +@@ -429,21 +429,31 @@ static int ext2_direct_scan(const char *device) + + if ((error = ext2fs_allocate_inode_bitmap(fs, "in-use inode map", &inode_used_map))) { + errstr(_("error (%d) while allocating file inode bitmap\n"), (int)error); ++ ext2fs_free(fs); + return -1; + } + + if ((error = ext2fs_allocate_inode_bitmap(fs, "directory inode map", &inode_dir_map))) { + errstr(_("errstr (%d) while allocating directory inode bitmap\n"), (int)error); ++ ext2fs_free_inode_bitmap(inode_used_map); ++ ext2fs_free(fs); + return -1; + } + + if ((error = ext2fs_open_inode_scan(fs, inode_buffer_blocks, &scan))) { + errstr(_("error (%d) while opening inode scan\n"), (int)error); ++ ext2fs_free_inode_bitmap(inode_dir_map); ++ ext2fs_free_inode_bitmap(inode_used_map); ++ ext2fs_free(fs); + return -1; + } + + if ((error = ext2fs_get_next_inode(scan, &i_num, &inode))) { + errstr(_("error (%d) while starting inode scan\n"), (int)error); ++ ext2fs_close_inode_scan(scan); ++ ext2fs_free_inode_bitmap(inode_dir_map); ++ ext2fs_free_inode_bitmap(inode_used_map); ++ ext2fs_free(fs); + return -1; + } + +@@ -474,9 +484,17 @@ static int ext2_direct_scan(const char *device) + + if ((error = ext2fs_get_next_inode(scan, &i_num, &inode))) { + errstr(_("Something weird happened while scanning. Error %d\n"), (int)error); ++ ext2fs_close_inode_scan(scan); ++ ext2fs_free_inode_bitmap(inode_dir_map); ++ ext2fs_free_inode_bitmap(inode_used_map); ++ ext2fs_free(fs); + return -1; + } + } ++ ext2fs_close_inode_scan(scan); ++ ext2fs_free_inode_bitmap(inode_dir_map); ++ ext2fs_free_inode_bitmap(inode_used_map); ++ ext2fs_free(fs); + return 0; + } + #endif +-- +2.9.5 + diff --git a/SOURCES/quota-4.03-quotacheck-Use-direct-scanning-also-for-ext4.patch b/SOURCES/quota-4.03-quotacheck-Use-direct-scanning-also-for-ext4.patch new file mode 100644 index 0000000..8d5048a --- /dev/null +++ b/SOURCES/quota-4.03-quotacheck-Use-direct-scanning-also-for-ext4.patch @@ -0,0 +1,36 @@ +From 2b3795805c8d1bd8873b046508777fa6e9a5c83d Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Tue, 9 Aug 2016 19:17:56 +0200 +Subject: [PATCH] quotacheck: Use direct scanning also for ext4 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We mistakenly didn't use direct scanning through libext2fs for ext4 +filesystem. Add ext4 to the list of filesystem libext2fs can handle. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotacheck.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/quotacheck.c b/quotacheck.c +index 6f34cff..a6fe432 100644 +--- a/quotacheck.c ++++ b/quotacheck.c +@@ -959,7 +959,10 @@ Please stop all programs writing to filesystem or use -m flag to force checking. + start_scan: + debug(FL_VERBOSE | FL_DEBUG, _("Scanning %s [%s] "), mnt->me_devname, mnt->me_dir); + #if defined(EXT2_DIRECT) +- if (!strcmp(mnt->me_type, MNTTYPE_EXT2) || !strcmp(mnt->me_type, MNTTYPE_EXT3) || !strcmp(mnt->me_type, MNTTYPE_NEXT3)) { ++ if (!strcmp(mnt->me_type, MNTTYPE_EXT2) || ++ !strcmp(mnt->me_type, MNTTYPE_EXT3) || ++ !strcmp(mnt->me_type, MNTTYPE_NEXT3) || ++ !strcmp(mnt->me_type, MNTTYPE_EXT4)) { + if ((failed = ext2_direct_scan(mnt->me_devname)) < 0) + goto out; + } +-- +2.7.4 + diff --git a/SOURCES/quota_nld.service b/SOURCES/quota_nld.service new file mode 100644 index 0000000..d069003 --- /dev/null +++ b/SOURCES/quota_nld.service @@ -0,0 +1,12 @@ +[Unit] +Description=Disk quota netlink message daemon +After=syslog.target + +[Service] +Type=forking +EnvironmentFile=-/etc/sysconfig/quota_nld +ExecStart=/usr/sbin/quota_nld $QUOTA_NLD_OPTS +PIDFile=/var/run/quota_nld.pid + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/quota_nld.sysconfig b/SOURCES/quota_nld.sysconfig new file mode 100644 index 0000000..51df5be --- /dev/null +++ b/SOURCES/quota_nld.sysconfig @@ -0,0 +1,5 @@ +# Arguments to pass to quota_nld daemon. +# -b, --print-below Inform about falling usage bellow limits too +# -C, --no-console Do not print messages on last user's terminal +# -D, --no-dbus Do not forward messages to D-Bus +QUOTA_NLD_OPTS="" diff --git a/SOURCES/rpc-rquotad.service b/SOURCES/rpc-rquotad.service new file mode 100644 index 0000000..f9c794e --- /dev/null +++ b/SOURCES/rpc-rquotad.service @@ -0,0 +1,15 @@ +[Unit] +Description=Remote quota server +Documentation=man:rpc.rquotad(8) +Requires=rpcbind.service +PartOf=rpcbind.service +After=rpcbind.service + +[Service] +Type=forking +EnvironmentFile=-/etc/sysconfig/rpc-rquotad +ExecStart=/usr/sbin/rpc.rquotad $RPCRQUOTADOPTS + +[Install] +WantedBy=multi-user.target +WantedBy=nfs-server.service diff --git a/SOURCES/rpc-rquotad.sysconfig b/SOURCES/rpc-rquotad.sysconfig new file mode 100644 index 0000000..4c67c13 --- /dev/null +++ b/SOURCES/rpc-rquotad.sysconfig @@ -0,0 +1,8 @@ +# Optionas to pass to rpc.rquotad daemon. See rpc.rquotad(8) manual page for +# more details. +# -I, --autofs Ignore autofs mount points +# -p port, --port port Listen on alternative port +# -s, --no-setquota Don't allow setting quotas with RPC (default) +# -S, --setquota Allow setting quotas with RPC +# -x path, --xtab path Use alternative NFSD export table +RPCRQUOTADOPTS="" diff --git a/SPECS/quota.spec b/SPECS/quota.spec new file mode 100644 index 0000000..a45520e --- /dev/null +++ b/SPECS/quota.spec @@ -0,0 +1,843 @@ +#allow remote set quota by defined rpcsetquota to 1(set to 0 to disabled it) +%{!?rpcsetquota:%define rpcsetquota 1} + +Name: quota +Summary: System administration tools for monitoring users' disk usage +Epoch: 1 +Version: 4.01 +Release: 17%{?dist} +# quota_nld.c, quotaio_xfs.h: GPLv2 +# bylabel.c copied from util-linux: GPLv2+ +# svc_socket.c copied from glibc: LGPLv2+ +# doc/quotas.ms, quotaops.c, quot.c, quotaon.c, edquota.c, quot.h, quota.c, +# quotaio_v1.c: BSD +License: BSD and LGPLv2+ and GPLv2 and GPLv2+ +URL: http://sourceforge.net/projects/linuxquota/ +Group: System Environment/Base +Requires: tcp_wrappers +Requires: quota-nls = %{epoch}:%{version}-%{release} +Requires: rpcbind +Conflicts: kernel < 2.4 +# nfs-utils used to provide nfs-rquotad.service, bug #1207239 +Conflicts: nfs-utils < 1:1.3.0-0.4.el7 +BuildRequires: e2fsprogs-devel gettext tcp_wrappers-devel +BuildRequires: openldap-devel dbus-devel libnl-devel +BuildRequires: systemd-units +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +Source0: http://downloads.sourceforge.net/linuxquota/%{name}-%{version}.tar.gz +Source1: quota_nld.service +Source2: quota_nld.sysconfig +Source3: rpc-rquotad.service +Source4: rpc-rquotad.sysconfig +# Not accepted changes (378a64006bb1e818e84a1c77808563b802b028fa) +# Some of the lines have been superseded by other commits probably. +Patch0: quota-4.01-warnquota.patch +Patch2: quota-3.06-pie.patch +Patch3: quota-3.13-wrong-ports.patch +# Submitted to upstream, SF#3571486 +Patch4: quota-4.01-Make-group-warning-message-more-official.patch +# In upstream after 4.01, SF#3571589 +Patch5: quota-4.01-define_charset_in_mail.patch +# In upstream after 4.01, SF#3602786, bug #846296 +Patch6: quota-4.01-Do-not-fiddle-with-quota-files-on-XFS-and-GFS.patch +# In upstream after 4.01, SF#3602777 +Patch7: quota-4.01-quotacheck-Make-sure-d-provides-at-least-as-much-inf.patch +# In upstream after 4.01, SF#3607034 +Patch8: quota-4.01-Add-quotasync-1-manual-page.patch +# In upstream after 4.01, SF#3607034 +Patch9: quota-4.01-Complete-quotasync-usage.patch +# In upstream after 4.01, SF#3607034 +Patch10: quota-4.01-Correct-quotasync-exit-code.patch +# In upstream after 4.01, SF#3607038 +Patch11: quota-4.01-Fix-various-usage-mistakes.patch +# In upstream after 4.01, SF#3600120 +Patch12: quota-4.01-Recognize-units-at-block-limits-by-setquota.patch +# In upstream after 4.01, SF#3600120 +Patch13: quota-4.01-Recognize-block-limit-units-on-setquota-standard-inp.patch +# In upstream after 4.01, SF#3600120 +Patch14: quota-4.01-Recognize-units-at-block-limits-by-edquota.patch +# In upstream after 4.01, SF#3600120 +Patch15: quota-4.01-Recognize-units-at-inode-limits-by-setquota.patch +# In upstream after 4.01, SF#3600120 +Patch16: quota-4.01-Recognize-units-at-inode-limits-by-edquota.patch +# Submited to upstream +Patch17: quota-4.01-Close-FILE-handles-on-error.patch +# In upstream after 4.01 +Patch18: quota-4.01-Remove-installation-of-manpages-into-section-2.patch +# Submitted to upstream, +Patch19: quota-4.01-Add-quotagrpadmins-5-manual-page.patch +# Submitted to upstream, +Patch20: quota-4.01-Add-quotatab-5-manual-page.patch +# Submitted to upstream, +Patch21: quota-4.01-Add-warnquota.conf-5-manual-page.patch +# Submitted to upstream, +Patch22: quota-4.01-Improve-rcp.rquota-8-manual-page.patch +# Do not warn if rquotad RPC service is not registered, bug #1155584, +# in upstream 4.02 +Patch23: quota-4.02-Skip-NFS-mounts-without-rquotad-RPC-service-silently.patch +# Query kernel for next quota on file system with hiden quota files, +# bug #1305968, in upstream after 4.03 +Patch24: quota-4.03-Scan-dquots-using-Q_GETNEXTQUOTA.patch +# Query kernel for next XFS quota, bug #1305968, in upstream after 4.03 +Patch25: quota-4.03-Add-support-for-scanning-using-Q_XGETNEXTQUOTA.patch +# Prevent from grace period overflow in RPC transport, bug #1072858, +# in upstream 4.02 +Patch26: quota-4.01-Prevent-from-grace-period-overflow-in-RPC-transport.patch +# Use direct scanning also for ext4, bug #1393849, in upsream after 4.03 +Patch27: quota-4.03-quotacheck-Use-direct-scanning-also-for-ext4.patch +# Fix memory leaks when running quotacheck on ext file systems, bug #1483543, +# +Patch28: quota-4.03-quotacheck-Deallocate-memory-after-direct-scanning.patch +# Bug #1517822, in upstream 4.02 +Patch29: quota-4.01-Properly-handle-signed-space-and-inode-values.patch +# Bug #1517822, in upstream 4.02 +Patch30: quota-4.02-Fix-handling-of-space-and-inode-values.patch + +%description +The quota package contains system administration tools for monitoring +and limiting user and or group disk usage per file system. + + +%package nld +Summary: quota_nld daemon +Group: System Environment/Base +Requires: quota-nls = %{epoch}:%{version}-%{release} +Requires(post): systemd-sysv systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units + +%description nld +Daemon that listens on netlink socket and processes received quota warnings. +Note, that you have to enable the kernel support for sending quota messages +over netlink (in Filesystems->Quota menu). The daemon supports forwarding +warning messages to the system D-Bus (so that desktop manager can display +a dialog) and writing them to the terminal user has last accessed. + + +%package warnquota +Summary: Send e-mail to users over quota +Group: System Environment/Base +Requires: quota-nls = %{epoch}:%{version}-%{release} + +%description warnquota +Utility that checks disk quota for each local file system and mails a warning +message to those users who have reached their soft limit. It is typically run +via cron(8). + + +%package nls +Summary: Gettext catalogs for disk quota tools +Group: System Environment/Base +BuildArch: noarch + +%description nls +Disk quota tools messages translated into different natural languages. + + +%package devel +Summary: Development files for quota +Group: System Environment/Base +Requires: quota = %{epoch}:%{version}-%{release} + +%description devel +The quota package contains system administration tools for monitoring +and limiting user and or group disk usage per file system. + +This package contains development header files for implementing quotas +on remote machines. + + +%package doc +Summary: Additional documentation for disk quotas +Group: Documentation +Requires: quota = %{epoch}:%{version}-%{release} +BuildArch: noarch +AutoReq: 0 + +%description doc +This package contains additional documentation for disk quotas concept in +Linux/UNIX environment. + + +%prep +%setup -q -n quota-tools +%patch0 -p1 +%ifnarch ppc ppc64 +%patch2 -p1 +%endif +%patch3 -p1 +%patch4 -p1 -b .group_warning +%patch5 -p1 -b .charset_in_mail +%patch6 -p1 -b .gfs_files +%patch7 -p1 -b .quotackeck_debug +%patch8 -p1 -b .quotasync_manual +%patch9 -p1 -b .quotasync_usage +%patch10 -p1 -b .quotasync_exit +%patch11 -p1 -b .usage +%patch12 -p1 -b .setquota_block_units +%patch13 -p1 -b .setquota_block_units_stdin +%patch14 -p1 -b .edquota_block_units +%patch15 -p1 -b .setquota_inode_units +%patch16 -p1 -b .edquota_inode_units +%patch17 -p1 -b .close_file_handles +%patch18 -p1 -b .remove_man2 +%patch19 -p1 -b .doc_quotagrpadmins +%patch20 -p1 -b .doc_quotatab +%patch21 -p1 -b .doc_warnquota +%patch22 -p1 -b .doc_rquota +%patch23 -p1 -b .silent_no_rquotad +%patch24 -p1 -b .getnextquota +%patch25 -p1 -b .xgetnextquota +%patch26 -p1 -b .rpc_time +%patch27 -p1 -b .directext4 +%patch28 -p1 -b .quotacheck_leak +%patch29 -p1 -b .signed_values +%patch30 -p1 -b .fix_signed_values + +#fix typos/mistakes in localized documentation +for pofile in $(find ./po/*.p*) +do + sed -i 's/editting/editing/' "$pofile" +done + +# Fix charset +for F in Changelog; do + iconv -f latin1 -t utf-8 <"$F" >"${F}.utf8" + touch -r "$F"{,.utf8} + mv "$F"{.utf8,} +done + + +%build +%global _hardened_build 1 +%configure \ + --enable-ext2direct=yes \ + --enable-ldapmail=yes \ + --enable-netlink=yes \ + --enable-rootsbin=no \ +%if %{rpcsetquota} + --enable-rpcsetquota=yes \ +%endif + --enable-strip-binaries=no +make + + +%install +mkdir -p %{buildroot}%{_sysconfdir} +mkdir -p %{buildroot}%{_sbindir} +mkdir -p %{buildroot}%{_bindir} +mkdir -p %{buildroot}%{_mandir}/{man1,man3,man5,man8} +make install INSTALL='install -p' ROOTDIR=%{buildroot} +install -m 644 warnquota.conf %{buildroot}%{_sysconfdir} +ln -s quotaon.8.gz \ + %{buildroot}%{_mandir}/man8/quotaoff.8 + +install -p -m644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/quota_nld.service +install -p -m644 -D %{SOURCE2} \ + $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/quota_nld +install -p -m644 -D %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/rpc-rquotad.service +install -p -m644 -D %{SOURCE4} \ + $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/rpc-rquotad +# For backward compatibilty, bug #1207239 +ln -s rpc-rquotad.service $RPM_BUILD_ROOT%{_unitdir}/nfs-rquotad.service + +%find_lang %{name} + + +%post +%systemd_post rpc-rquotad.service + +%preun +%systemd_preun rpc-rquotad.service + +%postun +%systemd_postun_with_restart rpc-rquotad.service + + +%post nld +%systemd_post quota_nld.service + +%preun nld +%systemd_preun quota_nld.service + +%postun nld +%systemd_postun_with_restart quota_nld.service + + +%triggerun -- %{name}-nld < 1:4.00-2 +echo 'quota-nld: User must migrate to systemd target manually by runnig:' +echo ' systemd-sysv-convert --apply quota_nld' +# Save the current service runlevel info +/usr/bin/systemd-sysv-convert --save quota_nld >/dev/null 2>&1 || : +# Run these because the SysV package being removed won't do them +/sbin/chkconfig --del quota_nld >/dev/null 2>&1 || : +/bin/systemctl try-restart quota_nld.service >/dev/null 2>&1 || : + + +%files +%config(noreplace) %{_sysconfdir}/sysconfig/rpc-rquotad +%{_unitdir}/rpc-rquotad.service +%{_unitdir}/nfs-rquotad.service +%attr(0755,root,root) %{_bindir}/* +%attr(0755,root,root) %{_sbindir}/* +%exclude %{_sbindir}/quota_nld +%exclude %{_sbindir}/warnquota +%attr(0644,root,root) %{_mandir}/man1/* +%attr(0644,root,root) %{_mandir}/man8/* +%exclude %{_mandir}/man8/quota_nld.8* +%exclude %{_mandir}/man8/warnquota.8* +%doc Changelog + +%files nld +%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/quota_nld +%{_unitdir}/quota_nld.service +%attr(0755,root,root) %{_sbindir}/quota_nld +%attr(0644,root,root) %{_mandir}/man8/quota_nld.8* +%doc Changelog + +%files warnquota +%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/quotagrpadmins +%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/quotatab +%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/warnquota.conf +%attr(0755,root,root) %{_sbindir}/warnquota +%attr(0644,root,root) %{_mandir}/man5/* +%attr(0644,root,root) %{_mandir}/man8/warnquota.8* +%doc Changelog README.ldap-support README.mailserver + +%files nls -f %{name}.lang +%doc Changelog + +%files devel +%dir %{_includedir}/rpcsvc +%{_includedir}/rpcsvc/* +%attr(0644,root,root) %{_mandir}/man3/* + +%files doc +%doc doc/* ldap-scripts + + +%changelog +* Mon Nov 27 2017 Petr Pisar - 1:4.01-17 +- Print negative quota values properly (bug #1517822) + +* Mon Aug 21 2017 Petr Pisar - 1:4.01-16 +- Fix memory leaks when running quotacheck on ext file systems (bug #1483543) + +* Thu Nov 10 2016 Petr Pisar - 1:4.01-15 +- Use direct scanning also for ext4 (bug #1393849) + +* Thu Mar 10 2016 Petr Pisar - 1:4.01-14 +- Add nfs-rquotad.service alias for backward compatibility (bug #1207239) +- Start rpc-rquotad.service when starting nfs-server.service (bug #1207239) + +* Fri Mar 04 2016 Petr Pisar - 1:4.01-13 +- Prevent from grace period overflow in RPC transport (bug #1072858) + +* Thu Mar 03 2016 Petr Pisar - 1:4.01-12 +- Do not warn if rquotad RPC service is not registered (bug #1155584) +- Query kernel for next quota on XFS or file system with hidden quota files + (bug #1305968) +- Add rpc-rquotad.service file which was known as nfs-rquotad.service + in nfs-utils (bug #1207239) + +* Fri Jan 24 2014 Daniel Mach - 1:4.01-11 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 1:4.01-10 +- Mass rebuild 2013-12-27 + +* Wed Oct 16 2013 Petr Pisar - 1:4.01-9 +- Move /sbin/* files under /usr (bug #983179) +- Harden executables due to rpc.rquotad and quota_nld daemons (bug #983179) +- Document quotagrpadmins(5), quotatab(5), warnquota.conf(5), rcp.rquota(8) + (bug #983179) + +* Thu Jun 13 2013 Petr Pisar - 1:4.01-8 +- Close FILE handles on error too + +* Wed Jun 12 2013 Petr Pisar - 1:4.01-7 +- Allow to set limits using multiplicative units + +* Mon May 27 2013 Petr Pisar - 1:4.01-6 +- Add LGPLv2+ and GPLv2 to license declaration +- Correct changelog dates +- Package additional LDAP scripts as a documentation +- Package XFS-specific tools + +* Thu Mar 14 2013 Petr Pisar - 1:4.01-5 +- Add quotasync(1) manual page +- Fix quota, repquota, and quotasync usage help + +* Tue Feb 05 2013 Petr Pisar - 1:4.01-4 +- Do not fiddle with quota files on XFS and GFS (bug #846296) +- Make sure option -d at quotacheck provides at least as much information as + option -v (SF#3602777) + +* Mon Dec 03 2012 Petr Pisar - 1:4.01-3 +- Define charset in e-mails sent by warnquota (SF#3571589) + +* Tue Sep 25 2012 Petr Pisar - 1:4.01-2 +- Make group warning message more official + +* Fri Sep 07 2012 Petr Pisar - 1:4.01-1 +- 4.01 bump + +* Wed Aug 22 2012 Petr Pisar - 1:4.00-6 +- Modernize systemd scriptlets (bug #850288) + +* Sat Jul 21 2012 Fedora Release Engineering - 1:4.00-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jul 03 2012 Petr Pisar - 1:4.00-4 +- Fix editting more users with edquota +- Report all quotas on XFS (bug #837341) + +* Sat Jan 14 2012 Fedora Release Engineering - 1:4.00-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Sep 1 2011 Petr Pisar - 1:4.00-2 +- Remove unneeded cryptographic library build-time dependencies +- Fortify build-time configuration +- Migrate quota_nld service from sysvinit to systemd +- Document --print-below option in quota_nld service + +* Tue Aug 23 2011 Petr Pisar - 1:4.00-1 +- 4.00 bump +- Remove unneeded LDAP linking patch +- Prevent from stripping by configure option +- Remove unneeded sed scripts on sources +- Remove unneeded file removal + +* Thu Aug 18 2011 Petr Pisar - 1:4.00-0.17.pre1 +- Do not report missing utmp record to syslog (bug #731622) + +* Fri Jul 15 2011 Petr Pisar - 1:4.00-0.16.pre1 +- Report quotacheck failures by return code (bug #717982) +- Improve quotacheck error message (bug #717982) + +* Thu May 12 2011 Petr Pisar - 1:4.00-0.15.pre1 +- Make dirname static to work with nss_db (bug #703567) +- Clean spec file + +* Mon Apr 11 2011 Petr Pisar - 1:4.00-0.14.pre1 +- Initialize v2r1 ddquot padding in dump (bug #695409) +- Do not pass NULL to XGETQSTAT quotactl() + +* Mon Mar 21 2011 Petr Pisar - 1:4.00-0.13.pre1 +- Fix repquota to get latest quota info header (bug #689458) + +* Fri Mar 11 2011 Petr Pisar - 1:4.00-0.12.pre1 +- Fix ddquot buffer leak + +* Thu Mar 10 2011 Petr Pisar - 1:4.00-0.11.pre1 +- Disable grace period/times remote setting + +* Mon Feb 28 2011 Petr Pisar - 1:4.00-0.10.pre1 +- Do not use real domains in warnquota example + +* Thu Feb 17 2011 Petr Pisar - 1:4.00-0.9.pre1 +- Explain meaning of the second column in repquota output +- Make RPC handle properly host names with colons (i.e. IPv6 server host name) + +* Wed Feb 09 2011 Petr Pisar - 1:4.00-0.8.pre1 +- Initialize vfsold block and inode value boundries for new quota file + (bug #668688) + +* Tue Feb 08 2011 Fedora Release Engineering - 1:4.00-0.7.pre1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Feb 04 2011 Petr Pisar - 1:4.00-0.6.pre1 +- Store quota_nld PID into PID file (bug #634137) +- Do not allow non-root to control quota_nld service (bug #634137) +- Add quotasync tool (bug #596794) +- Implement quotacheck for GFS2 (bug #596794) + +* Wed Feb 02 2011 Petr Pisar - 1:4.00-0.5.pre1 +- Correct manual pages + +* Tue Jan 11 2011 Petr Pisar - 1:4.00-0.4.pre1 +- Make RPC block factor dynamic (bug #667757) +- Check whether set limits fit into the range supported by quota format + (bug #668688) +- Check set limits fit into the range supported by RPC transport (bug #668691) + +* Mon Jan 10 2011 Petr Pisar - 1:4.00-0.3.pre1 +- Document --always-resolve option + +* Tue Dec 14 2010 Petr Pisar - 1:4.00-0.2.pre1 +- Comment example quotatab to silent warnquota + +* Tue Nov 16 2010 Petr Pisar - 1:4.00-0.1.pre1 +- 4.00-pre1 bump +- Separate gettext catalogs becuase they are required by all binary sub-packages + +* Mon Nov 15 2010 Petr Pisar - 1:3.17-18 +- Break warnquota dependency on main package + +* Mon Nov 15 2010 Petr Pisar - 1:3.17-17 +- Convert Changelog to UTF-8 + +* Mon Nov 15 2010 Petr Pisar - 1:3.17-16 +- Break dependecies on main package as there are none +- Add plain text documentation to each sub-package +- Package additional documentation into `doc' sub-package + +* Thu Nov 11 2010 Petr Pisar - 1:3.17-15 +- Add quota_nld deamon init script (bug #634169) +- Sub-package quota_nld files to weak dependecies +- Sub-package warnquota files to weak dependecies + +* Wed Oct 06 2010 Petr Pisar - 1:3.17-14 +- Remove quotactl(2) as it's part of `man-pages' package (bug #640590) + +* Tue May 11 2010 Petr Pisar 1:3.17-13 +- Add GFS2 support + +* Mon May 10 2010 Petr Pisar 1:3.17-12 +- Prevent corruptive read/write from/to NULL address in rpc.rquotad + (Resolves #528581, example in #532342) +- Fix spelling in summary + +* Fri Mar 12 2010 Daniel Novotny 1:3.17-11 +- the require from previous fix deleted altogether (it will + be resolved automatically) + +* Fri Mar 12 2010 Daniel Novotny 1:3.17-10 +- Requires: e2fsprogs changed to e2fsprogs-libs (#570005) + +* Tue Feb 23 2010 Daniel Novotny 1:3.17-9 +- fix #565124 - FTBFS quota-3.17-8.fc13: ImplicitDSOLinking + +* Tue Sep 29 2009 Ondrej Vasik 1:3.17-8 +- add buildrequires for quota_nld, enable-netlink to build + quota_nld (#526047) + +* Fri Sep 18 2009 Ondrej Vasik 1:3.17-7 +- Fix headers and structs in quotactl manpage(#524138) + +* Fri Aug 28 2009 Ondrej Vasik 1:3.17-6 +- symlink manpage for rpc.rquotad + +* Sun Jul 26 2009 Fedora Release Engineering - 1:3.17-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Mar 13 2009 Ondrej Vasik 1:3.17-4 +- clarify statements about LDAP in warnquota conf + (related to #490106) +- fix parsing issue in warnquota.c(#490125) +- enable rpcsetquota by default(#159292, #469753) + +* Fri Mar 13 2009 Ondrej Vasik 1:3.17-3 +- add missing buildrequires needed to compile with + enable-ldapmail=try option with LDAP(#490106) + +* Wed Feb 25 2009 Fedora Release Engineering - 1:3.17-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Jan 13 2009 Ondrej Vasik 1:3.17-1 +- new upstream release, remove already applied patches + +* Mon Dec 08 2008 Ondrej Vasik 1:3.16-8 +- fix documentation inconsistency (now rpc(3) instead of + rpc(3N) in rquotad manpage) (#474836) + +* Fri Nov 14 2008 Ondrej Vasik 1:3.16-7 +- fix quotaoff --help output (was same as quotaon output) + +* Thu Oct 30 2008 Ondrej Vasik 1:3.16-6 +- fix implementation of ext4 support + (by Mingming Cao, #469127) + +* Wed Sep 10 2008 Ondrej Vasik 1:3.16-5 +- fix rpmlint warnings - absolute symlink and not using epoch + in version in changelog (#226353) +- rquota headers and manpage now in devel subpackage + +* Wed Aug 27 2008 Ondrej Vasik 3.16-4 +- fix bug in warnquota which could result in bogus hostname + and domainname (upstream) +- remove IMMUTABLE flag from quota file in quotacheck(upstream) + +* Tue Aug 05 2008 Ondrej Vasik 3.16-3 +- Add support for -h option (do not show invalid option + error) at edquota,setquota and quota (#457898) + +* Fri Jun 20 2008 Ondrej Vasik 3.16-2 +- upstream fix of some typos, string formats + 4TB+ fix + for repquota +- some additional stripping removal +- change default mode of binaries from 555 to 755 + (strip error messages in build log) + +* Wed Apr 23 2008 Ondrej Vasik 3.16-1 +- own directory of rpcsvc headers(#442143) +- new upstream release + +* Wed Mar 12 2008 Ondrej Vasik 3.15-6 +- added enable-ldapmail=try option(wonder how #133207 + got closed by FC-4 without it or warnquota.conf change) +- dropped with-ext2direct=no option - this option is + invalid and original bug was fixed in 3.07 + +* Thu Mar 6 2008 Ondrej Vasik 3.15-5 +- added symbolic link for quotaoff man page(#436110) +- don't ship xqmstats.8 man page as we don't ship those + binaries(#436100) + +* Thu Feb 21 2008 Ondrej Vasik 3.15-4 +- added pointers to quota_nld and warnquota to some + manpages(upstream, #83975) + +* Tue Feb 12 2008 Ondrej Vasik 3.15-3 +- allow to build with rpcsetquota enabled(disabled by + default, #159292) +- rebuild for gcc43 + +* Thu Jan 24 2008 Steve Dickson 3.15-2 +- More review comments: + - BuiltPreReq to BuiltReq + - Removed '.' From Summary + - Added 'GPLv2+' to License Tag + - Condensed the _sysconfdir entries in to one line + +* Thu Jan 24 2008 Steve Dickson 3.15-1 +- Upgraded to version 3.15 +- Updated spec file per Merge Review (bz 226353) + +* Thu Feb 15 2007 Steve Dickson 3.14-1 +- Upgraded to version 3.14 (bz# 213641) + +* Mon Dec 4 2006 Thomas Woerner 1:3.13-1.3 +- tcp_wrappers has a new devel and libs sub package, therefore changing build + requirement for tcp_wrappers to tcp_wrappers-devel + +* Wed Nov 1 2006 Steve Dickson 1:3.13-1.2.3.2 +- Added range checking on -p flag (bz 205145) +- Error message prints garbage characters (bz 201226) + +* Wed Jul 12 2006 Jesse Keating - 1:3.13-1.2.3.1 +- rebuild + +* Fri Jun 30 2006 Steve Dickson - 1:3.13-1.2.3 +- fix 192826 - quota config files should not be overwritten + +* Fri Feb 10 2006 Jesse Keating - 1:3.13-1.2.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 1:3.13-1.2 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Mon Oct 31 2005 Steve Dickson 3.13-1 +- Upgraded to version 3.13 (bz# 171245) + +* Thu Aug 18 2005 Florian La Roche +- change the "Requires: kernel" into a "Conflicts:" + +* Sun Sep 26 2004 Rik van Riel 3.12-5 +- add URL (bz# 131862) + +* Fri Sep 24 2004 Steve Dickson +- Fixed typos in warnquota.conf patch + (bz# 82250 and bz# 83974) + +* Mon Sep 13 2004 Steve Dickson +- upgraded to 3.12 + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Tue Jan 27 2004 Florian La Roche +- add -pie support +- update to 3.10 + +* Sat Aug 16 2003 Steve Dickson +- upgraded to 3.0.9 +- added quota-3.09-root_sbindir.patch + +* Sun Aug 10 2003 Elliot Lee 3.06-11 +- Rebuild + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Tue May 27 2003 Steve Dickson +- rebuilt for 7.3 errata + +* Tue Feb 25 2003 Elliot Lee +- rebuilt + +* Sun Feb 23 2003 Tim Powers +- add buildprereq on tcp_wrappers + +* Wed Jan 22 2003 Tim Powers +- rebuilt + +* Mon Nov 18 2002 Tim Powers +- rebuild on all arches + + +* Fri Sep 6 2002 Philip Copeland 3.06-5 +- added --with-ext2direct=no to fix #73244 + without this users with UID's > 65535 will not + be able to exist on a quota enabled FS + +* Wed Aug 7 2002 Philip Copeland 3.06-4 +- Man page change. #60108 + +* Tue Aug 6 2002 Philip Copeland 3.06-3 +- Bah, I'd dropped epoch from the spec file but seems + we need this if you want to upgrade as the epoch + number has precedence over the version/release + numbers. + +* Wed Jul 17 2002 Philip Copeland 3.06-2 +- Lets stop the makefile from stripping the + binaries as thats rpms job (apparently) + +* Mon Jul 01 2002 Philip Copeland 3.06-1 +- Ditched the 3.01-pre9 src base for 3.06 + Rebuilt without any patchs + +============================================================ + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Mon Feb 25 2002 Elliot Lee +- IfArch the badkernelinclude patch for ppc-only. +- Update to 3.03 + +* Wed Dec 12 2001 Guy Streeter +- Make #include of kernel header file work on non-x86 + +* Wed Sep 5 2001 Preston Brown +- require new initscripts + +* Thu Aug 30 2001 Preston Brown +- fixed bug #52075 (problem with ext2 labels) +- backup data files off by default in quotacheck, optional backup flag added +- fix bug where giving a bad directory or device would cause + quotaon/quotacheck to simulate "-a" behaviour +- if a device name (i.e /dev/hda1) is passed, look up the corresponding mount + point + +* Wed Aug 29 2001 Preston Brown +- return an error code in more cases in convertquota + +* Tue Aug 28 2001 Preston Brown +- 3.01pre9 + +* Fri Jul 20 2001 Preston Brown +- more cleanups on 3.01pre8 + +* Mon Jul 2 2001 Preston Brown +- 3.01 version, everything has changed again. :( + +* Sun Jun 24 2001 Elliot Lee +- Bump release + rebuild. + +* Fri Mar 30 2001 Preston Brown +- use rpc.rquotad from here again (#33738) + +* Thu Mar 15 2001 Preston Brown +- enable ALT_FORMAT for edquota + +* Tue Mar 13 2001 Preston Brown +- I broke passing devices on the cmd line. Fixed. + +* Fri Mar 09 2001 Preston Brown +- quota 3.00 is required by recent kernel 2.4 changes +- no warnquota included this time, not yet ported +- quite a bit of work on quotacheck to make is backwards compatible +- we will likely go back to "quota 2.00" as these projects merge... + +* Fri Feb 09 2001 Florian La Roche +- use "rm -f" instead of only "rm" + +* Wed Feb 7 2001 Preston Brown +- fix quotacheck man page for -a option (#26380) + +* Thu Feb 1 2001 Preston Brown +- 2.00 final, rolls in pretty much all our patches. :) +- fix reporting of in use dquot entries from quotastats +- change repquota man page to fix documentation of -v (#10330) +- include warnquota.conf + +* Mon Nov 20 2000 Bill Nottingham +- fix ia64 build + +* Mon Aug 21 2000 Jeff Johnson +- add LABEL=foo support (#16390). + +* Thu Jul 27 2000 Jeff Johnson +- remote NFS quotas with different blocksize converted incorrectly (#11932). + +* Wed Jul 12 2000 Prospector +- automatic rebuild + +* Thu Jun 15 2000 Jeff Johnson +- FHS packaging. + +* Wed May 10 2000 Jeff Johnson +- apply patch5 (H.J. Lu) + +* Wed Feb 02 2000 Cristian Gafton +- fix description +- man pages are compressed + +* Tue Jan 18 2000 Preston Brown +- quota 2.00 series +- removed unnecessary patches + +* Thu Aug 5 1999 Jeff Johnson +- fix man page FUD (#4369). + +* Thu May 13 1999 Peter Hanecak +- changes to allow non-root users to build too (Makefile patch, %%attr) + +* Tue Apr 13 1999 Jeff Johnson +- fix for sparc64 quotas (#2147) + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 5) + +* Mon Dec 28 1998 Cristian Gafton +- don't install rpc.rquotad - we will use the one from the knfsd package + instead + +* Thu Dec 17 1998 Jeff Johnson +- merge ultrapenguin 1.1.9 changes. + +* Thu May 07 1998 Prospector System +- translations modified for de, fr, tr + +* Thu Apr 30 1998 Cristian Gafton +- removed patch for mntent + +* Fri Mar 27 1998 Jakub Jelinek +- updated to quota 1.66 + +* Tue Jan 13 1998 Erik Troan +- builds rquotad +- installs rpc.rquotad.8 symlink + +* Mon Oct 20 1997 Erik Troan +- removed /usr/include/rpcsvc/* from filelist +- uses a buildroot and %%attr + +* Thu Jun 19 1997 Erik Troan +- built against glibc + +* Tue Mar 25 1997 Erik Troan +- Moved /usr/sbin/quota to /usr/bin/quota