diff --git a/.gitignore b/.gitignore index e69de29..55691d5 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,9 @@ +quota-3.17.tar.gz +/quota-4.00-pre1.tar.gz +/quota-4.00.tar.gz +/quota-4.01.tar.gz +/quota-4.02.tar.gz +/quota-4.03.tar.gz +/ldap-scripts.tar.gz +/quota-4.04.tar.gz +/quota-4.05.tar.gz diff --git a/quota-4.03-Validate-upper-bound-of-RPC-port.patch b/quota-4.03-Validate-upper-bound-of-RPC-port.patch new file mode 100644 index 0000000..aa0d12b --- /dev/null +++ b/quota-4.03-Validate-upper-bound-of-RPC-port.patch @@ -0,0 +1,29 @@ +From c9a2a6fea0668579f5fb8d77cb219f51d104581f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 6 Jan 2016 17:58:22 +0100 +Subject: [PATCH] Validate upper bound of RPC port +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Písař +--- + rquota_svc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rquota_svc.c b/rquota_svc.c +index 338b70f..93472e0 100644 +--- a/rquota_svc.c ++++ b/rquota_svc.c +@@ -142,7 +142,7 @@ static void parse_options(int argc, char **argv) + 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); +-- +2.5.0 + diff --git a/quota-4.04-warnquota-configuration-tunes.patch b/quota-4.04-warnquota-configuration-tunes.patch new file mode 100644 index 0000000..9030e2e --- /dev/null +++ b/quota-4.04-warnquota-configuration-tunes.patch @@ -0,0 +1,76 @@ +From 67a0dbf6434552e720b0d311597553b3a76f779e 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 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Rest of changes (378a64006bb1e818e84a1c77808563b802b028fa) not +accepted by upstream (we had root@... addresses and more enterprise +wordings usually there). + +Signed-off-by: Petr Písař +--- + warnquota.c | 2 +- + warnquota.conf | 17 ++++++++--------- + 2 files changed, 9 insertions(+), 10 deletions(-) + +diff --git a/warnquota.c b/warnquota.c +index 0d911e4..2c8e084 100644 +--- a/warnquota.c ++++ b/warnquota.c +@@ -837,7 +837,7 @@ cc_parse_err: + } + #ifdef USE_LDAP_MAIL_LOOKUP + 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 b06f81f..7e00947 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,|\ + your group %i is using too much disk space at %h.|\ +-- +2.13.5 + diff --git a/quota-4.05-COPYING-Update-mailing-address.patch b/quota-4.05-COPYING-Update-mailing-address.patch new file mode 100644 index 0000000..3896eb2 --- /dev/null +++ b/quota-4.05-COPYING-Update-mailing-address.patch @@ -0,0 +1,106 @@ +From b6bb53e1124e6b813fe4de5682b9d9a9f8a1fba8 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Tue, 2 Apr 2019 16:54:49 +0200 +Subject: [PATCH] COPYING: Update mailing address +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + COPYING | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +diff --git a/COPYING b/COPYING +index 784e9cf..bb6a5e0 100644 +--- a/COPYING ++++ b/COPYING +@@ -1,16 +1,16 @@ + This package, the quota tools, are made available under the GNU Public License + version 2. +----------------------------------------------------------------------- ++----------------------------------------------------------------------- + +- GNU GENERAL PUBLIC LICENSE +- Version 2, June 1991 ++ GNU GENERAL PUBLIC LICENSE ++ Version 2, June 1991 + +- Copyright (C) 1989, 1991 Free Software Foundation, Inc. +- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ Copyright (C) 1989, 1991 Free Software Foundation, Inc., ++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +- Preamble ++ Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public +@@ -19,7 +19,7 @@ software--to make sure the software is free for all its users. This + General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to + using it. (Some other Free Software Foundation software is covered by +-the GNU Library General Public License instead.) You can apply it to ++the GNU Lesser General Public License instead.) You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not +@@ -59,8 +59,8 @@ patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and + modification follow. +- +- GNU GENERAL PUBLIC LICENSE ++ ++ GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +@@ -114,7 +114,7 @@ above, provided that you also meet all of these conditions: + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) +- ++ + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in +@@ -172,7 +172,7 @@ access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. +- ++ + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is +@@ -229,7 +229,7 @@ impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. +- ++ + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License +@@ -259,7 +259,7 @@ make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + +- NO WARRANTY ++ NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +@@ -281,4 +281,4 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + +- END OF TERMS AND CONDITIONS ++ END OF TERMS AND CONDITIONS +-- +2.20.1 + diff --git a/quota-4.05-Fix-ignoring-disabled-quotas.patch b/quota-4.05-Fix-ignoring-disabled-quotas.patch new file mode 100644 index 0000000..6aad8de --- /dev/null +++ b/quota-4.05-Fix-ignoring-disabled-quotas.patch @@ -0,0 +1,49 @@ +From 110b4a4011655fb650f82c88312ba44d7e249060 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Fri, 21 Feb 2020 10:00:05 +0100 +Subject: [PATCH] Fix ignoring disabled quotas +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +quota(1) command ignores file systems without enabled quotas. (In +contrast to "quota -f".) This works for local file systems and it used +to work for NFS file system until commit 4cd287f3fa38 ("rpc: Clarify error +message when cannot connect to rpc.rquotad"). quota(1) command now reports +an error whenever at least one NFS-mounted file system has disabled the +quotas. This renders the tool unusable. + +This patch readds an exception for the ENOENT errno that was removed +with the commit probably by a mistake. + +[JK: Improve commit message, make getprivs() print more descriptive +message in case quota is not enabled] + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + quotaops.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/quotaops.c b/quotaops.c +index 1a8d7fe..ff4d16e 100644 +--- a/quotaops.c ++++ b/quotaops.c +@@ -127,11 +127,13 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int ignore_noquo + char *estr; + + /* If rpc.rquotad is not running, filesystem might be just without quotas... */ +- if (ignore_noquota && errno == ECONNREFUSED) ++ if (ignore_noquota && (errno == ENOENT || errno == ECONNREFUSED)) + continue; + + if (errno == ECONNREFUSED) { + estr = _("Cannot connect to RPC quota service"); ++ } else if (errno == ENOENT) { ++ estr = _("Quota not enabled"); + } else { + estr = strerror(errno); + } +-- +2.21.1 + diff --git a/quota-4.05-Fix-limits-setting-on-XFS-filesystem.patch b/quota-4.05-Fix-limits-setting-on-XFS-filesystem.patch new file mode 100644 index 0000000..92de36d --- /dev/null +++ b/quota-4.05-Fix-limits-setting-on-XFS-filesystem.patch @@ -0,0 +1,42 @@ +From 13bb8c2daca0f1c1099ce6ba9dcb23319f7955d0 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Wed, 20 May 2020 16:22:52 +0200 +Subject: [PATCH 2/2] Fix limits setting on XFS filesystem +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +xfs_commit_dquot() always set FS_DQ_LIMIT_MASK when calling +Q_XFS_SETQLIM. So far this wasn't a problem since quota tools didn't +support setting of anything else for XFS but now that kernel will start +supporting setting of grace times for XFS, we need to be more careful +and set limits bits only if we really want to update them. Also +FS_DQ_LIMIT_MASK contains real-time limits as well. Quota tools +currently don't support them in any way so avoid telling kernel to set +them. + +Reviewed-by: Eric Sandeen +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotaio_xfs.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/quotaio_xfs.c b/quotaio_xfs.c +index a4d6f67..3333bb1 100644 +--- a/quotaio_xfs.c ++++ b/quotaio_xfs.c +@@ -165,7 +165,9 @@ static int xfs_commit_dquot(struct dquot *dquot, int flags) + if (flags & COMMIT_USAGE) /* block usage */ + xdqblk.d_fieldmask |= FS_DQ_BCOUNT; + } else { +- xdqblk.d_fieldmask |= FS_DQ_LIMIT_MASK; ++ if (flags & COMMIT_LIMITS) /* warn/limit */ ++ xdqblk.d_fieldmask |= FS_DQ_BSOFT | FS_DQ_BHARD | ++ FS_DQ_ISOFT | FS_DQ_IHARD; + if (flags & COMMIT_TIMES) /* indiv grace period */ + xdqblk.d_fieldmask |= FS_DQ_TIMER_MASK; + } +-- +2.25.4 + diff --git a/quota-4.05-Make-a-directory-for-quota_nld-PID-file-configurable.patch b/quota-4.05-Make-a-directory-for-quota_nld-PID-file-configurable.patch new file mode 100644 index 0000000..51a9aa2 --- /dev/null +++ b/quota-4.05-Make-a-directory-for-quota_nld-PID-file-configurable.patch @@ -0,0 +1,74 @@ +From bbcf9eedb2299ab55a0ae208e196eb2ca59ad97e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Thu, 30 May 2019 13:20:25 +0200 +Subject: [PATCH] Make a directory for quota_nld PID file configurable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +While Filesystem Hierarchy Standard prescribes /var/run path for +storing PID files, some (systemd-based) distributions uses /run. + +This patch adds a --with-pid-dir=DIRECTORY option to the ./configure +script. The option enables to change the path. Default one is +/var/run as used to be until now. + +(I did not use $localstatedir environment variable because Autoconf +manual allows using "precious" variables only in a makefile.) + +Signed-off-by: Petr Písař +--- + configure.ac | 10 ++++++++++ + quota_nld.c | 4 ++-- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index b783568..3cb57c5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -277,6 +277,15 @@ AS_IF([test "$with_proc_mounts" != "no"], [ + AC_DEFINE_UNQUOTED([ALT_MTAB], ["$with_proc_mounts"], [File with mounted filesystems]) + ]) + ++AC_ARG_WITH([pid-dir], ++ [AS_HELP_STRING([--with-pid-dir=DIRECTORY], [Create PID files in this directory instead of /var/run])], ++ [with_pid_dir="$withval"] ++) ++AS_IF([test "X$with_pid_dir" == "X" -o "$with_pid_dir" == "yes" -o "$with_pid_dir" == "no"],[ ++ with_pid_dir="/var/run" ++]) ++AC_DEFINE_UNQUOTED([PID_DIR], ["$with_pid_dir"], [Directory for PID files]) ++ + AC_DEFINE_UNQUOTED([COMPILE_OPTS], ["$COMPILE_OPTS"], [Configuration options]) + + AC_CONFIG_FILES([ +@@ -297,6 +306,7 @@ Build configuration: + libwrap: ${build_libwrap} + netlink: ${build_netlink} + nls: ${enable_nls} ++ pid-dir: ${with_pid_dir} + proc-mounts: ${with_proc_mounts} + rpc: ${build_rpc} + rpcsetquota: ${enable_rpcsetquota} +diff --git a/quota_nld.c b/quota_nld.c +index ac24bdb..72d99a9 100644 +--- a/quota_nld.c ++++ b/quota_nld.c +@@ -403,12 +403,12 @@ static char *build_pid_file_name(void) + errstr(_("Undefined program name.\n")); + return NULL; + } +- pid_name = malloc(9 + strlen(progname) + 4 + 1); ++ pid_name = malloc(strlen(PID_DIR) + 1 + strlen(progname) + 4 + 1); + if (!pid_name) { + errstr(_("Not enough memory to build PID file name.\n")); + return NULL; + } +- sprintf(pid_name, "/var/run/%s.pid", progname); ++ sprintf(pid_name, "%s/%s.pid", PID_DIR, progname); + return pid_name; + } + +-- +2.20.1 + diff --git a/quota-4.05-Make-messages-about-failures-for-NFS-consistent-with.patch b/quota-4.05-Make-messages-about-failures-for-NFS-consistent-with.patch new file mode 100644 index 0000000..f78274b --- /dev/null +++ b/quota-4.05-Make-messages-about-failures-for-NFS-consistent-with.patch @@ -0,0 +1,112 @@ +From a4b0af23e1e3761825e9d4ac075e3fcae8ab91cb Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Fri, 24 May 2019 12:03:27 +0200 +Subject: [PATCH 1/4] Make messages about failures for NFS consistent with + local filesystems +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Currently, some types for failures when fetching quota information for +NFS filesystem were silent (e.g. when rpc.rquotad was not running) while +others were reporting error message (e.g. when rpc connection failed). +There's no big difference in these for the user / administrator and also +is inconsistent with how we deal with local filesystems - there we +report error if the filesystem was explicitely specified on command line +and silently ignore it for "scan all" operations. + +So change error reporting for NFS to report errors about quota not being +supported if and only if filesystem was explicitely specified on command +line. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + edquota.c | 4 ++-- + quota.c | 2 +- + quotaops.c | 2 +- + setquota.c | 6 +++--- + 4 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/edquota.c b/edquota.c +index 912f833..a77106c 100644 +--- a/edquota.c ++++ b/edquota.c +@@ -176,7 +176,7 @@ static void copy_prototype(int argc, char **argv, struct quota_handle **handles) + protoprivs = getprivs(protoid, handles, 0); + while (argc-- > 0) { + id = name2id(*argv, quotatype, !!(flags & FL_NUMNAMES), NULL); +- curprivs = getprivs(id, handles, 0); ++ curprivs = getprivs(id, handles, !dirname); + if (!curprivs) + die(1, _("Cannot get quota information for user %s\n"), *argv); + argv++; +@@ -296,7 +296,7 @@ int main(int argc, char **argv) + else { + for (; argc > 0; argc--, argv++) { + id = name2id(*argv, quotatype, !!(flags & FL_NUMNAMES), NULL); +- curprivs = getprivs(id, handles, 0); ++ curprivs = getprivs(id, handles, !dirname); + if (!curprivs) + die(1, _("Cannot get quota information for user %s.\n"), *argv); + if (flags & FL_EDIT_TIMES) { +diff --git a/quota.c b/quota.c +index 8235013..be494e3 100644 +--- a/quota.c ++++ b/quota.c +@@ -168,7 +168,7 @@ static int showquotas(int type, qid_t id, int mntcnt, char **mnt) + ((flags & FL_NOAUTOFS) ? MS_NO_AUTOFS : 0) + | ((flags & FL_LOCALONLY) ? MS_LOCALONLY : 0) + | ((flags & FL_NFSALL) ? MS_NFS_ALL : 0)); +- qlist = getprivs(id, handles, !!(flags & FL_QUIETREFUSE)); ++ qlist = getprivs(id, handles, !mntcnt || (flags & FL_QUIETREFUSE)); + if (!qlist) { + over = 1; + goto out_handles; +diff --git a/quotaops.c b/quotaops.c +index 976e6b3..ad29fd9 100644 +--- a/quotaops.c ++++ b/quotaops.c +@@ -125,7 +125,7 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int quiet) + + if (!(q = handles[i]->qh_ops->read_dquot(handles[i], id))) { + /* If rpc.rquotad is not running filesystem might be just without quotas... */ +- if (errno != ENOENT && (errno != ECONNREFUSED || !quiet)) { ++ if (!quiet || (errno != ENOENT && errno != ECONNREFUSED)) { + int olderrno = errno; + + id2name(id, handles[i]->qh_type, name); +diff --git a/setquota.c b/setquota.c +index bfd6682..08fdbfc 100644 +--- a/setquota.c ++++ b/setquota.c +@@ -314,7 +314,7 @@ static int setlimits(struct quota_handle **handles) + struct dquot *q, *protoq, *protoprivs = NULL, *curprivs; + int ret = 0; + +- curprivs = getprivs(id, handles, 0); ++ curprivs = getprivs(id, handles, !!(flags & FL_ALL)); + if (flags & FL_PROTO) { + protoprivs = getprivs(protoid, handles, 0); + for (q = curprivs, protoq = protoprivs; q && protoq; q = q->dq_next, protoq = protoq->dq_next) { +@@ -435,7 +435,7 @@ static int batch_setlimits(struct quota_handle **handles) + int ret = 0; + + while (!read_entry(&id, &isoftlimit, &ihardlimit, &bsoftlimit, &bhardlimit)) { +- curprivs = getprivs(id, handles, 0); ++ curprivs = getprivs(id, handles, !!(flags & FL_ALL)); + for (q = curprivs; q; q = q->dq_next) { + q->dq_dqb.dqb_bsoftlimit = bsoftlimit; + q->dq_dqb.dqb_bhardlimit = bhardlimit; +@@ -474,7 +474,7 @@ static int setindivgraces(struct quota_handle **handles) + int ret = 0; + struct dquot *q, *curprivs; + +- curprivs = getprivs(id, handles, 0); ++ curprivs = getprivs(id, handles, !!(flags & FL_ALL)); + for (q = curprivs; q; q = q->dq_next) { + if (q->dq_dqb.dqb_bsoftlimit && toqb(q->dq_dqb.dqb_curspace) > q->dq_dqb.dqb_bsoftlimit) + q->dq_dqb.dqb_btime = toset.dqb_btime; +-- +2.20.1 + diff --git a/quota-4.05-Revert-configure.ac-fix-pkg_check_modules-calls.patch b/quota-4.05-Revert-configure.ac-fix-pkg_check_modules-calls.patch new file mode 100644 index 0000000..e28d5f1 --- /dev/null +++ b/quota-4.05-Revert-configure.ac-fix-pkg_check_modules-calls.patch @@ -0,0 +1,73 @@ +From 00d61f21bfa3ccf40826ce22de12cfeeab8a40a5 Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" +Date: Mon, 1 Apr 2019 02:23:59 +0300 +Subject: [PATCH] Revert "configure.ac: fix pkg_check_modules calls" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +CFLAGS and LIBS are variables that users are entitled to modify in order +to compile the package, so do not tamper with CFLAGS and LIBS. + +COM_ERR_CFLAGS, EXT2FS_CFLAGS, DBUS_CFLAGS, LIBNL3_CFLAGS, TIRPC_CFLAGS, +COMM_ERR_LIBS, EXT2FS_LIBS, DBUS_LIBS, LIBNL3_LIBS, and TIRPC_LIBS +should be used directly where appropriate and apparently they already +are. + +This reverts commit b54d97d677481287faa5d6b98c92f111141c1af3. + +Signed-off-by: Dmitry V. Levin +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + configure.ac | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/configure.ac b/configure.ac +index e8e6412..ff7b9df 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -104,13 +104,13 @@ AC_ARG_ENABLE([ext2direct], + ) + AS_IF([test "x$enable_ext2direct" != "xno"], [ + build_ext2direct="yes" +- PKG_CHECK_MODULES([COM_ERR],[com_err], [CFLAGS="$CFLAGS $COM_ERR_CFLAGS" LIBS="$LIBS $COMM_ERR_LIBS"], [ ++ PKG_CHECK_MODULES([COM_ERR],[com_err], [], [ + build_ext2direct="no" + AS_IF([test "x$enable_ext2direct" = "xyes"], [ + AC_MSG_ERROR([Ext2direct requested but required com_err library not found]) + ]) + ]) +- PKG_CHECK_MODULES([EXT2FS],[ext2fs], [CFLAGS="$CFLAGS $EXT2FS_CFLAGS" LIBS="$LIBS $EXT2FS_LIBS"], [ ++ PKG_CHECK_MODULES([EXT2FS],[ext2fs], [], [ + build_ext2direct="no" + AS_IF([test "x$enable_ext2direct" = "xyes"], [ + AC_MSG_ERROR([Ext2direct requested but required ext2fs library not found]) +@@ -138,13 +138,13 @@ AC_ARG_ENABLE([netlink], + ) + AS_IF([test "x$enable_netlink" != "xno"], [ + build_netlink="yes" +- PKG_CHECK_MODULES([DBUS], [dbus-1], [CFLAGS="$CFLAGS $DBUS_CFLAGS" LIBS="$LIBS $DBUS_LIBS"], [ ++ PKG_CHECK_MODULES([DBUS], [dbus-1], [], [ + build_netlink="no" + AS_IF([test "x$enable_netlink" = "xyes"] , [ + AC_MSG_ERROR([Required dbus libraries for quota netlink daemon not found.]) + ]) + ]) +- PKG_CHECK_MODULES([LIBNL3], [libnl-3.0 >= 3.1 libnl-genl-3.0], [CFLAGS="$CFLAGS $LIBNL3_CFLAGS" LIBS="$LIBS $LIBNL3_LIBS"], [ ++ PKG_CHECK_MODULES([LIBNL3], [libnl-3.0 >= 3.1 libnl-genl-3.0], [], [ + build_netlink="no" + AS_IF([test "x$enable_netlink" = "xyes"] , [ + AC_MSG_ERROR([Required libnl3 libraries for quota netlink daemon not found.]) +@@ -207,7 +207,7 @@ AS_IF([test x"$enable_rpc" != "xno"], [ + build_rpc="no" + ]) + +- PKG_CHECK_MODULES([TIRPC], [libtirpc], [CFLAGS="$CFLAGS $TIRPC_CFLAGS" LIBS="$LIBS $TIRPC_LIBS"], [ ++ PKG_CHECK_MODULES([TIRPC], [libtirpc], [], [ + AS_IF([test x"$enable_rpc" = "xyes"], [ + AC_MSG_ERROR([could not locate required libtirpc]) + ], [ +-- +2.20.1 + diff --git a/quota-4.05-quota-tools-Set-FS_DQ_TIMER_MASK-for-individual-xfs-.patch b/quota-4.05-quota-tools-Set-FS_DQ_TIMER_MASK-for-individual-xfs-.patch new file mode 100644 index 0000000..b12b3f7 --- /dev/null +++ b/quota-4.05-quota-tools-Set-FS_DQ_TIMER_MASK-for-individual-xfs-.patch @@ -0,0 +1,39 @@ +From be96da2353669d433b0abddb85b26ccaf35e3451 Mon Sep 17 00:00:00 2001 +From: Eric Sandeen +Date: Thu, 14 May 2020 12:17:29 +0200 +Subject: [PATCH 1/2] quota-tools: Set FS_DQ_TIMER_MASK for individual xfs + grace times +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +xfs quota code doesn't currently allow increasing an individual +user's grace time, but kernel patches are in development for this. + +In order for setquota to be able to send this update via +setquota -T, we need to add the FS_DQ_TIMER_MASK when we are trying +to update the grace times on an individual user's dquot. + +Signed-off-by: Eric Sandeen +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotaio_xfs.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/quotaio_xfs.c b/quotaio_xfs.c +index b22c7b4..a4d6f67 100644 +--- a/quotaio_xfs.c ++++ b/quotaio_xfs.c +@@ -166,6 +166,8 @@ static int xfs_commit_dquot(struct dquot *dquot, int flags) + xdqblk.d_fieldmask |= FS_DQ_BCOUNT; + } else { + xdqblk.d_fieldmask |= FS_DQ_LIMIT_MASK; ++ if (flags & COMMIT_TIMES) /* indiv grace period */ ++ xdqblk.d_fieldmask |= FS_DQ_TIMER_MASK; + } + + qcmd = QCMD(Q_XFS_SETQLIM, h->qh_type); +-- +2.25.4 + diff --git a/quota-4.05-quota-tools-pass-quota-type-to-QCMD-for-Q_XFS_GETQST.patch b/quota-4.05-quota-tools-pass-quota-type-to-QCMD-for-Q_XFS_GETQST.patch new file mode 100644 index 0000000..d1e987e --- /dev/null +++ b/quota-4.05-quota-tools-pass-quota-type-to-QCMD-for-Q_XFS_GETQST.patch @@ -0,0 +1,56 @@ +From fdd774bf08e56872ae4c0420e0f01efa25e715d6 Mon Sep 17 00:00:00 2001 +From: Eric Sandeen +Date: Fri, 8 May 2020 14:36:46 -0500 +Subject: [PATCH] quota-tools: pass quota type to QCMD for Q_XFS_GETQSTAT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Older kernels ignored the type sent to Q_XFS_GETQSTAT, and returned +timer information for the first quota type which was found to be +enabled. + +As of 555b2c3da1fc ("quota: honor quota type in Q_XGETQSTAT[V] calls") +the kernel now honors the quota type requested, so send that from the +Q_XFS_GETQSTAT calls in quota tools. + +Older kernels ignore the type altogether, so this change should be +backwards compatible with no change in behavior. + +Signed-off-by: Eric Sandeen +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotaio_xfs.c | 2 +- + quotaon_xfs.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/quotaio_xfs.c b/quotaio_xfs.c +index 56daf89..b22c7b4 100644 +--- a/quotaio_xfs.c ++++ b/quotaio_xfs.c +@@ -81,7 +81,7 @@ static int xfs_init_io(struct quota_handle *h) + struct xfs_mem_dqinfo info; + int qcmd; + +- qcmd = QCMD(Q_XFS_GETQSTAT, 0); ++ qcmd = QCMD(Q_XFS_GETQSTAT, h->qh_type); + memset(&info, 0, sizeof(struct xfs_mem_dqinfo)); + if (quotactl(qcmd, h->qh_quotadev, 0, (void *)&info) < 0) + return -1; +diff --git a/quotaon_xfs.c b/quotaon_xfs.c +index d557a75..d137240 100644 +--- a/quotaon_xfs.c ++++ b/quotaon_xfs.c +@@ -32,7 +32,7 @@ static int xfs_state_check(int qcmd, int type, int flags, const char *dev, int r + if (flags & STATEFLAG_ALL) + return 0; /* noop */ + +- if (quotactl(QCMD(Q_XFS_GETQSTAT, 0), dev, 0, (void *)&info) < 0) { ++ if (quotactl(QCMD(Q_XFS_GETQSTAT, type), dev, 0, (void *)&info) < 0) { + errstr(_("quotactl() on %s: %s\n"), dev, strerror(errno)); + return -1; + } +-- +2.25.4 + diff --git a/quota-4.05-quotacheck-Skip-checking-of-filesystems-with-hidded-.patch b/quota-4.05-quotacheck-Skip-checking-of-filesystems-with-hidded-.patch new file mode 100644 index 0000000..0ae3917 --- /dev/null +++ b/quota-4.05-quotacheck-Skip-checking-of-filesystems-with-hidded-.patch @@ -0,0 +1,42 @@ +From 61e57e73a6c63ad50825182ca80bc2a5fcb3e1e2 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Tue, 30 Jul 2019 17:25:46 +0200 +Subject: [PATCH] quotacheck: Skip checking of filesystems with hidded quota + files early +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Currently when filesystem tracks quotas in hidden quota files (but is +also capable of tracking it in regular files), we scan the whole +filesystem and only after that find out we cannot actually make use of +newly created quota files. Just detect this case before scanning the fs +and skip it. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotacheck.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/quotacheck.c b/quotacheck.c +index 2cdf475..1311c10 100644 +--- a/quotacheck.c ++++ b/quotacheck.c +@@ -1181,11 +1181,11 @@ static int check_all(void) + continue; + } + cfmt = fmt; +- if (uwant && me_hasquota(mnt, USRQUOTA)) ++ if (uwant && me_hasquota(mnt, USRQUOTA) && mnt->me_qfmt[USRQUOTA] != QF_META) + ucheck = 1; + else + ucheck = 0; +- if (gwant && me_hasquota(mnt, GRPQUOTA)) ++ if (gwant && me_hasquota(mnt, GRPQUOTA) && mnt->me_qfmt[GRPQUOTA] != QF_META) + gcheck = 1; + else + gcheck = 0; +-- +2.21.0 + diff --git a/quota-4.05-quotaops-Do-not-leak-dquot-structures-on-failure.patch b/quota-4.05-quotaops-Do-not-leak-dquot-structures-on-failure.patch new file mode 100644 index 0000000..9090359 --- /dev/null +++ b/quota-4.05-quotaops-Do-not-leak-dquot-structures-on-failure.patch @@ -0,0 +1,68 @@ +From 7942290a0a6230fcc56eae42bf436e6eeca88777 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Fri, 24 May 2019 12:25:15 +0200 +Subject: [PATCH 3/4] quotaops: Do not leak dquot structures on failure +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some error paths in getprivs() were not properly freeing already fetched +structures. Free them properly in case of error. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotaops.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/quotaops.c b/quotaops.c +index 3d65490..e067d29 100644 +--- a/quotaops.c ++++ b/quotaops.c +@@ -80,7 +80,7 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int ignore_noquo + if (euid != id && euid != 0) { + uid2user(id, name); + errstr(_("%s (uid %d): Permission denied\n"), name, id); +- return (struct dquot *)NULL; ++ goto out_err; + } + break; + case GRPQUOTA: +@@ -92,7 +92,7 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int ignore_noquo + if (!gidsetp) { + gid2group(id, name); + errstr(_("%s (gid %d): gid set allocation (%d): %s\n"), name, id, ngroups, strerror(errno)); +- return (struct dquot *)NULL; ++ goto out_err; + } + } + else +@@ -103,7 +103,7 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int ignore_noquo + free(gidsetp); + gid2group(id, name); + errstr(_("%s (gid %d): error while trying getgroups(): %s\n"), name, id, strerror(errno)); +- return (struct dquot *)NULL; ++ goto out_err; + } + + for (j = 0; j < ngroups; j++) +@@ -115,7 +115,7 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int ignore_noquo + gid2group(id, name); + errstr(_("%s (gid %d): Permission denied\n"), + name, id); +- return (struct dquot *)NULL; ++ goto out_err; + } + break; + default: +@@ -134,6 +134,7 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int ignore_noquo + id2name(id, handles[i]->qh_type, name); + errstr(_("error while getting quota from %s for %s (id %u): %s\n"), + handles[i]->qh_quotadev, name, id, strerror(olderrno)); ++out_err: + freeprivs(qhead); + return NULL; + } +-- +2.20.1 + diff --git a/quota-4.05-quotaops-Do-not-return-partial-list-from-getprivs.patch b/quota-4.05-quotaops-Do-not-return-partial-list-from-getprivs.patch new file mode 100644 index 0000000..13e07d0 --- /dev/null +++ b/quota-4.05-quotaops-Do-not-return-partial-list-from-getprivs.patch @@ -0,0 +1,61 @@ +From e6decbfe6c44935584954ab01c8be2f5d02acf1b Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Fri, 24 May 2019 12:21:46 +0200 +Subject: [PATCH 2/4] quotaops: Do not return partial list from getprivs() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When we failed to get some dquots from NFS server, we just reported +error, didn't include the dquot in the list built in getprivs() but +otherwise continued operation. Fail getprivs() in case of error instead +so that the failure propagates properly to the caller. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotaops.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/quotaops.c b/quotaops.c +index ad29fd9..3d65490 100644 +--- a/quotaops.c ++++ b/quotaops.c +@@ -61,7 +61,7 @@ void update_grace_times(struct dquot *q) + /* + * Collect the requested quota information. + */ +-struct dquot *getprivs(qid_t id, struct quota_handle **handles, int quiet) ++struct dquot *getprivs(qid_t id, struct quota_handle **handles, int ignore_noquota) + { + struct dquot *q, *qtail = NULL, *qhead = NULL; + int i; +@@ -124,15 +124,18 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int quiet) + #endif + + if (!(q = handles[i]->qh_ops->read_dquot(handles[i], id))) { ++ int olderrno = errno; ++ + /* If rpc.rquotad is not running filesystem might be just without quotas... */ +- if (!quiet || (errno != ENOENT && errno != ECONNREFUSED)) { +- int olderrno = errno; ++ if (ignore_noquota && ++ (errno == ENOENT || errno == ECONNREFUSED)) ++ continue; + +- id2name(id, handles[i]->qh_type, name); +- errstr(_("error while getting quota from %s for %s (id %u): %s\n"), +- handles[i]->qh_quotadev, name, id, strerror(olderrno)); +- } +- continue; ++ id2name(id, handles[i]->qh_type, name); ++ errstr(_("error while getting quota from %s for %s (id %u): %s\n"), ++ handles[i]->qh_quotadev, name, id, strerror(olderrno)); ++ freeprivs(qhead); ++ return NULL; + } + if (qhead == NULL) + qhead = q; +-- +2.20.1 + diff --git a/quota-4.05-quotaops-Make-error-string-translatable.patch b/quota-4.05-quotaops-Make-error-string-translatable.patch new file mode 100644 index 0000000..54dba05 --- /dev/null +++ b/quota-4.05-quotaops-Make-error-string-translatable.patch @@ -0,0 +1,32 @@ +From d9996b2b6b3cdcd41485804eabadbf576506c8fa Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Tue, 28 May 2019 16:39:22 +0200 +Subject: [PATCH] quotaops: Make error string translatable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add forgotten translation quotes to the error string. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotaops.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/quotaops.c b/quotaops.c +index 16475e8..1a8d7fe 100644 +--- a/quotaops.c ++++ b/quotaops.c +@@ -131,7 +131,7 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int ignore_noquo + continue; + + if (errno == ECONNREFUSED) { +- estr = "Cannot connect to RPC quota service"; ++ estr = _("Cannot connect to RPC quota service"); + } else { + estr = strerror(errno); + } +-- +2.20.1 + diff --git a/quota-4.05-rpc-Clarify-error-message-when-cannot-connect-to-rpc.patch b/quota-4.05-rpc-Clarify-error-message-when-cannot-connect-to-rpc.patch new file mode 100644 index 0000000..257f2fe --- /dev/null +++ b/quota-4.05-rpc-Clarify-error-message-when-cannot-connect-to-rpc.patch @@ -0,0 +1,127 @@ +From 4cd287f3fa3838a31eb6636366f8ce26ee6e1425 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Tue, 28 May 2019 10:52:49 +0200 +Subject: [PATCH] rpc: Clarify error message when cannot connect to rpc.rquotad +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Currently when RPC rquota service is not registered, we report somewhat +confusing "No such file of directory" error. For other errors when +creating rquota request we report "Connection refused". There's no big +difference for user between these errors and neither of them tells what +really happened. So just unify handling of these errors and report more +general error telling the user where the problem is. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotaops.c | 14 +++++++++----- + rquota_client.c | 14 -------------- + 2 files changed, 9 insertions(+), 19 deletions(-) + +diff --git a/quotaops.c b/quotaops.c +index e067d29..16475e8 100644 +--- a/quotaops.c ++++ b/quotaops.c +@@ -124,16 +124,20 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int ignore_noquo + #endif + + if (!(q = handles[i]->qh_ops->read_dquot(handles[i], id))) { +- int olderrno = errno; ++ char *estr; + +- /* If rpc.rquotad is not running filesystem might be just without quotas... */ +- if (ignore_noquota && +- (errno == ENOENT || errno == ECONNREFUSED)) ++ /* If rpc.rquotad is not running, filesystem might be just without quotas... */ ++ if (ignore_noquota && errno == ECONNREFUSED) + continue; + ++ if (errno == ECONNREFUSED) { ++ estr = "Cannot connect to RPC quota service"; ++ } else { ++ estr = strerror(errno); ++ } + id2name(id, handles[i]->qh_type, name); + errstr(_("error while getting quota from %s for %s (id %u): %s\n"), +- handles[i]->qh_quotadev, name, id, strerror(olderrno)); ++ handles[i]->qh_quotadev, name, id, estr); + out_err: + freeprivs(qhead); + return NULL; +diff --git a/rquota_client.c b/rquota_client.c +index a3a4ae3..7f8e821 100644 +--- a/rquota_client.c ++++ b/rquota_client.c +@@ -148,7 +148,6 @@ 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; + + /* +@@ -210,8 +209,6 @@ int rpc_rquota_get(struct dquot *dquot) + } + else { + result = NULL; +- if (rpc_createerr.cf_stat == RPC_PROGNOTREGISTERED) +- rquotaprog_not_registered = 1; + } + + if (result == NULL || !result->status) { +@@ -251,16 +248,12 @@ int rpc_rquota_get(struct dquot *dquot) + clnt_destroy(clnt); + } else { + result = NULL; +- if (rpc_createerr.cf_stat == RPC_PROGNOTREGISTERED) +- rquotaprog_not_registered = 1; + } + } + } + free(fsname_tmp); + if (result) + ret = result->status; +- else if (rquotaprog_not_registered) +- ret = Q_NOQUOTA; + else + ret = -1; + return rquota_err(ret); +@@ -280,7 +273,6 @@ 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. */ +@@ -340,8 +332,6 @@ int rpc_rquota_set(int qcmd, struct dquot *dquot) + } + else { + result = NULL; +- if (rpc_createerr.cf_stat == RPC_PROGNOTREGISTERED) +- rquotaprog_not_registered = 1; + } + + if (result == NULL || !result->status) { +@@ -383,16 +373,12 @@ int rpc_rquota_set(int qcmd, struct dquot *dquot) + clnt_destroy(clnt); + } else { + result = NULL; +- if (rpc_createerr.cf_stat == RPC_PROGNOTREGISTERED) +- rquotaprog_not_registered = 1; + } + } + } + free(fsname_tmp); + if (result) + ret = result->status; +- else if (rquotaprog_not_registered) +- ret = Q_NOQUOTA; + else + ret = -1; + return rquota_err(ret); +-- +2.20.1 + diff --git a/quota-4.05-setquota-Report-failure-to-obtain-quota-information.patch b/quota-4.05-setquota-Report-failure-to-obtain-quota-information.patch new file mode 100644 index 0000000..2c438ac --- /dev/null +++ b/quota-4.05-setquota-Report-failure-to-obtain-quota-information.patch @@ -0,0 +1,73 @@ +From daba90fb6d9b8c8f1361457bf2bea7b18f4e35ec Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Fri, 24 May 2019 12:53:32 +0200 +Subject: [PATCH 4/4] setquota: Report failure to obtain quota information +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +setquota currently silently ignored when it could not obtain quota +information to update and just skipped updating for the filesystem. Make +it report error and exit properly. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + setquota.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/setquota.c b/setquota.c +index 08fdbfc..993d920 100644 +--- a/setquota.c ++++ b/setquota.c +@@ -315,8 +315,17 @@ static int setlimits(struct quota_handle **handles) + int ret = 0; + + curprivs = getprivs(id, handles, !!(flags & FL_ALL)); ++ if (!curprivs) { ++ errstr(_("Error getting quota information to update.\n")); ++ return -1; ++ } + if (flags & FL_PROTO) { + protoprivs = getprivs(protoid, handles, 0); ++ if (!protoprivs) { ++ errstr(_("Error getting prototype quota information.\n")); ++ ret = -1; ++ goto out; ++ } + for (q = curprivs, protoq = protoprivs; q && protoq; q = q->dq_next, protoq = protoq->dq_next) { + q->dq_dqb.dqb_bsoftlimit = protoq->dq_dqb.dqb_bsoftlimit; + q->dq_dqb.dqb_bhardlimit = protoq->dq_dqb.dqb_bhardlimit; +@@ -337,6 +346,7 @@ static int setlimits(struct quota_handle **handles) + } + if (putprivs(curprivs, COMMIT_LIMITS) == -1) + ret = -1; ++out: + freeprivs(curprivs); + return ret; + } +@@ -436,6 +446,10 @@ static int batch_setlimits(struct quota_handle **handles) + + while (!read_entry(&id, &isoftlimit, &ihardlimit, &bsoftlimit, &bhardlimit)) { + curprivs = getprivs(id, handles, !!(flags & FL_ALL)); ++ if (!curprivs) { ++ errstr(_("Error getting quota information to update.\n")); ++ return -1; ++ } + for (q = curprivs; q; q = q->dq_next) { + q->dq_dqb.dqb_bsoftlimit = bsoftlimit; + q->dq_dqb.dqb_bhardlimit = bhardlimit; +@@ -475,6 +489,10 @@ static int setindivgraces(struct quota_handle **handles) + struct dquot *q, *curprivs; + + curprivs = getprivs(id, handles, !!(flags & FL_ALL)); ++ if (!curprivs) { ++ errstr(_("Error getting quota information to update.\n")); ++ return -1; ++ } + for (q = curprivs; q; q = q->dq_next) { + if (q->dq_dqb.dqb_bsoftlimit && toqb(q->dq_dqb.dqb_curspace) > q->dq_dqb.dqb_bsoftlimit) + q->dq_dqb.dqb_btime = toset.dqb_btime; +-- +2.20.1 + diff --git a/quota-4.05-warnquota-Clarify-that-CC_TO-gets-resolved-through-L.patch b/quota-4.05-warnquota-Clarify-that-CC_TO-gets-resolved-through-L.patch new file mode 100644 index 0000000..5075b2f --- /dev/null +++ b/quota-4.05-warnquota-Clarify-that-CC_TO-gets-resolved-through-L.patch @@ -0,0 +1,34 @@ +From 662e9e93babc9be39bb2d6267ffe428703ca137e Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Thu, 12 Sep 2019 10:18:01 +0200 +Subject: [PATCH] warnquota: Clarify that CC_TO gets resolved through LDAP +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Clarify that CC_TO field from warnquota.conf gets resolved through LDAP +lookup similarly to normal message recifient. + +Signed-off-by: Jan Kara +Petr Písař: Ported to Fedora 32. +Signed-off-by: Petr Písař +--- + warnquota.conf | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/warnquota.conf b/warnquota.conf +index 7e00947..34bfe53 100644 +--- a/warnquota.conf ++++ b/warnquota.conf +@@ -8,6 +8,8 @@ MAIL_CMD = "/usr/sbin/sendmail -t" + FROM = "root@example.com" + # but they don't have to be: + SUBJECT = NOTE: You are exceeding your allocated disk space limits ++# Note that if LDAP is configured, the name in CC_TO gets looked up in LDAP ++# to obtain email address similarly to email recipient address. + 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, +-- +2.21.0 + diff --git a/quota-4.05-warnquota-Fix-help-text.patch b/quota-4.05-warnquota-Fix-help-text.patch new file mode 100644 index 0000000..0e812c5 --- /dev/null +++ b/quota-4.05-warnquota-Fix-help-text.patch @@ -0,0 +1,33 @@ +From 1ae10f8692981285ad52af9e9ae3e5f16201b187 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Mon, 12 Aug 2019 16:31:31 +0200 +Subject: [PATCH] warnquota: Fix help text +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The help text was wrongly saying that -v is equivalent to --version. +It should be -V. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + warnquota.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/warnquota.c b/warnquota.c +index 5158094..606b7cc 100644 +--- a/warnquota.c ++++ b/warnquota.c +@@ -1042,7 +1042,7 @@ static void usage(void) + -q, --quota-tab=quotatab-file non-default quotatab\n\ + -a, --admins-file=admins-file non-default admins file\n\ + -h, --help display this help message and exit\n\ +--v, --version display version information and exit\n\n")); ++-V, --version display version information and exit\n\n")); + errstr(_("Bugs to %s\n"), PACKAGE_BUGREPORT); + wc_exit(1); + } +-- +2.21.0 + diff --git a/quota-4.05-warnquota-Free-LDAP-error-message.patch b/quota-4.05-warnquota-Free-LDAP-error-message.patch new file mode 100644 index 0000000..af8a680 --- /dev/null +++ b/quota-4.05-warnquota-Free-LDAP-error-message.patch @@ -0,0 +1,36 @@ +From a543b200cdd1e798383cc1070e51ad13ff424543 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 5 Nov 2019 12:11:14 +0100 +Subject: [PATCH] warnquota: Free LDAP error message +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +ldap_get_option(3) documents that a pointer set by +LDAP_OPT_DIAGNOSTIC_MESSAGE must be freed with ldap_memfree(3). + +Signed-off-by: Petr Písař +--- + warnquota.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/warnquota.c b/warnquota.c +index d54b4c1..f6b42d5 100644 +--- a/warnquota.c ++++ b/warnquota.c +@@ -190,8 +190,11 @@ static void print_ldap_error(int err, char *prefix) + sstrncat(outbuf, ": %s\n", LDAP_ERR_BUF_SIZE); + errstr(outbuf, ldap_err2string(err)); + ldap_get_option(ldapconn, LDAP_OPT_DIAGNOSTIC_MESSAGE, (void *)&msg); +- if (msg && strcmp(msg, "")) ++ if (msg) { ++ if (strcmp(msg, "")) + errstr(_("Additional error info: %s\n"), msg); ++ ldap_memfree(msg); ++ } + } + + static int setup_ldap(struct configparams *config) +-- +2.21.0 + diff --git a/quota-4.05-warnquota-Initialize-all-members-of-a-configparams-s.patch b/quota-4.05-warnquota-Initialize-all-members-of-a-configparams-s.patch new file mode 100644 index 0000000..bd8f10c --- /dev/null +++ b/quota-4.05-warnquota-Initialize-all-members-of-a-configparams-s.patch @@ -0,0 +1,61 @@ +From 50c3f30d610ed9979a1291422e8641e05f881212 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 5 Nov 2019 14:20:46 +0100 +Subject: [PATCH] warnquota: Initialize all members of a configparams structure +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Running warnquota under valgrind reported many "Conditional jump or +move depends on uninitialised value" mistakes because readconfigfile() +did not initizalize ldap_bindpw member if some of the configuration +options were missing from the configuration file. + +This patch simply initializes all bytes of the configparams structure +to 0 instead of settting each of the members explicitly. + +Signed-off-by: Petr Písař +--- + warnquota.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/warnquota.c b/warnquota.c +index f6b42d5..2882fee 100644 +--- a/warnquota.c ++++ b/warnquota.c +@@ -759,13 +759,13 @@ static int readconfigfile(const char *filename, struct configparams *config) + char *locale; + + /* set default values */ ++ memset(config, 0, sizeof(*config)); + sstrncpy(config->mail_cmd, MAIL_CMD, CNF_BUFFER); + sstrncpy(config->from, FROM, CNF_BUFFER); + sstrncpy(config->subject, SUBJECT, CNF_BUFFER); + sstrncpy(config->cc_to, CC_TO, CNF_BUFFER); + 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); + #ifdef HAVE_NL_LANGINFO +@@ -775,17 +775,11 @@ static int readconfigfile(const char *filename, struct configparams *config) + } + #endif + maildev[0] = 0; +- config->user_signature = config->user_message = config->group_signature = config->group_message = NULL; + config->cc_before = -1; + + #ifdef USE_LDAP_MAIL_LOOKUP +- config->use_ldap_mail = 0; +- config->ldap_starttls = 0; + config->ldap_tls = LDAP_OPT_X_TLS_NEVER; + config->ldap_vers = LDAP_VERSION3; +- config->ldap_port = config->ldap_is_setup = 0; +- config->ldap_host[0] = 0; +- config->ldap_uri[0] = 0; + #endif + + if (!(fp = fopen(filename, "r"))) { +-- +2.21.0 + diff --git a/quota-4.05-warnquota-Print-also-additional-error-info-for-LDAP-.patch b/quota-4.05-warnquota-Print-also-additional-error-info-for-LDAP-.patch new file mode 100644 index 0000000..4742fc2 --- /dev/null +++ b/quota-4.05-warnquota-Print-also-additional-error-info-for-LDAP-.patch @@ -0,0 +1,82 @@ +From 52ead0d37dcbce59338dcb765527712c9ee656e1 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Thu, 12 Sep 2019 10:06:38 +0200 +Subject: [PATCH] warnquota: Print also additional error info for LDAP errors +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +LDAP library provides additional error information in some cases. Print +it make debugging LDAP setup easier. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + warnquota.c | 26 +++++++++++++++++++++----- + 1 file changed, 21 insertions(+), 5 deletions(-) + +diff --git a/warnquota.c b/warnquota.c +index 24d7410..d54b4c1 100644 +--- a/warnquota.c ++++ b/warnquota.c +@@ -178,6 +178,22 @@ static void wc_exit(int ex_stat) + } + + #ifdef USE_LDAP_MAIL_LOOKUP ++ ++#define LDAP_ERR_BUF_SIZE 1024 ++ ++static void print_ldap_error(int err, char *prefix) ++{ ++ char *msg = NULL; ++ char outbuf[LDAP_ERR_BUF_SIZE]; ++ ++ sstrncpy(outbuf, prefix, LDAP_ERR_BUF_SIZE); ++ sstrncat(outbuf, ": %s\n", LDAP_ERR_BUF_SIZE); ++ errstr(outbuf, ldap_err2string(err)); ++ ldap_get_option(ldapconn, LDAP_OPT_DIAGNOSTIC_MESSAGE, (void *)&msg); ++ if (msg && strcmp(msg, "")) ++ errstr(_("Additional error info: %s\n"), msg); ++} ++ + static int setup_ldap(struct configparams *config) + { + int ret; +@@ -187,7 +203,7 @@ static int setup_ldap(struct configparams *config) + ret = ldap_initialize(&ldapconn, config->ldap_uri); + + if (ret != LDAP_SUCCESS) { +- errstr(_("ldap_initialize() failed: %s\n"), ldap_err2string(ret)); ++ print_ldap_error(ret, _("ldap_initialize() failed")); + return -1; + } + +@@ -196,13 +212,13 @@ static int setup_ldap(struct configparams *config) + ldap_set_option(ldapconn, LDAP_OPT_X_TLS_REQUIRE_CERT, &(config->ldap_tls)); + ret = ldap_start_tls_s(ldapconn, NULL, NULL); + if (ret != LDAP_SUCCESS) { +- errstr(_("ldap_start_tls_s() failed: %s\n"), ldap_err2string(ret)); +- return -1; ++ print_ldap_error(ret, _("ldap_start_tls_s() failed")); ++ return -1; + } + } + ret = ldap_sasl_bind_s(ldapconn, config->ldap_binddn, LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL); + if (ret != LDAP_SUCCESS) { +- errstr(_("ldap_sasl_bind_s() failed: %s\n"), ldap_err2string(ret)); ++ print_ldap_error(ret, _("ldap_sasl_bind_s() failed")); + return -1; + } + return 0; +@@ -428,7 +444,7 @@ static char *lookup_user(struct configparams *config, char *user) + + if (ret != LDAP_SUCCESS) { + errstr(_("Error with %s.\n"), user); +- errstr(_("ldap_search_ext_s() failed: %s\n"), ldap_err2string(ret)); ++ print_ldap_error(ret, _("ldap_search_ext_s() failed")); + return NULL; + } + +-- +2.21.0 + diff --git a/quota-4.05-warnquota-Properly-detect-LDAP-errors.patch b/quota-4.05-warnquota-Properly-detect-LDAP-errors.patch new file mode 100644 index 0000000..9ec11f7 --- /dev/null +++ b/quota-4.05-warnquota-Properly-detect-LDAP-errors.patch @@ -0,0 +1,42 @@ +From 3615f3ec7dd3c867a8394640c0fc4736189315df Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Thu, 5 Sep 2019 16:29:08 +0200 +Subject: [PATCH] warnquota: Properly detect LDAP errors +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +ldap_search_ext_s() and ldap_sasl_bind_s() can return also positive +error result codes. Catch them properly. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + warnquota.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/warnquota.c b/warnquota.c +index 53da671..24d7410 100644 +--- a/warnquota.c ++++ b/warnquota.c +@@ -201,7 +201,7 @@ static int setup_ldap(struct configparams *config) + } + } + ret = ldap_sasl_bind_s(ldapconn, config->ldap_binddn, LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL); +- if(ret < 0) { ++ if (ret != LDAP_SUCCESS) { + errstr(_("ldap_sasl_bind_s() failed: %s\n"), ldap_err2string(ret)); + return -1; + } +@@ -426,7 +426,7 @@ static char *lookup_user(struct configparams *config, char *user) + searchbuf, NULL, 0, NULL, NULL, NULL, + 0, &result); + +- if (ret < 0) { ++ if (ret != LDAP_SUCCESS) { + errstr(_("Error with %s.\n"), user); + errstr(_("ldap_search_ext_s() failed: %s\n"), ldap_err2string(ret)); + return NULL; +-- +2.21.0 + diff --git a/quota.rpmlintrc b/quota.rpmlintrc new file mode 100644 index 0000000..d165974 --- /dev/null +++ b/quota.rpmlintrc @@ -0,0 +1,10 @@ +from Config import * +addFilter("summary-not-capitalized C quota_nld"); +addFilter("spelling-error .* (cron|Gettext|netlink)"); +# We do not package any programs as SUID or SGID, thus the programs do not +# change EUID of EGID. Also the programs do not edit a set of supplementary +# groups before dropping the priviledges by calling setgid() and setuid(). +# Thus no foreign supplementary groups can leak into the priviledge-lowered +# program. I.e. the priviledge-lowered program has the same supplementary +# groups as the user that executed the high-priviledged program. +addFilter("quota..*: E: missing-call-to-setgroups-before-setuid"); diff --git a/quota.spec b/quota.spec new file mode 100644 index 0000000..87a418b --- /dev/null +++ b/quota.spec @@ -0,0 +1,1069 @@ +# Scan ext file systems directly to increase performace of a quota +# initialization and check +%bcond_without quota_enables_extdirect +# Use netlink to monitor quota usage and warn interactive users +%bcond_without quota_enables_netlink +# Enable getting quotas over remotely +%bcond_without quota_enables_rpc +# Allow setting quota remotely +%bcond_without quota_enables_rpcsetquota +# Disable TCP Wrappers guard in RPC quota daemon +%bcond_with quota_enables_tcpwrappers + +Name: quota +Epoch: 1 +Version: 4.05 +Release: 16%{?dist} +Summary: System administration tools for monitoring users' disk usage +# quota_nld.c, quotaio_xfs.h: GPLv2 +# bylabel.c copied from util-linux: GPLv2+ +# doc/quotas.ms, edquota.c: BSD +# COPYING: GPLv2 text and license declaration +## Only in quota-rpc binary package +# rquota_server.c: GPLv2+ +## Only in quota-rpc and quota-nls binary packages +# rquota_svc.c: GPLv2+ +# svc_socket.c copied from glibc: LGPLv2+ +## Only in quota-nls binary package +# po/cs.po: GPLv2+ +## Only in quota-warnquota binary package +# warnquota.c: GPLv2+ +## Not involved in any binary package +# aclocal.m4: FSFULLR and (GPLv2+ with exception) +# ar-lib: GPLv2 with exception +# depcomp: GPLv2+ with exception +# compile: GPLv2+ with exception +# config.guess: GPLv3+ with exception +# config.rpath: GPLv2+ with exception +# config.sub: GPLv3+ with exception +# configure: FSFUL +# install-sh: MIT and Public Domain +# m4/gettext.m4: GPL with exception +# m4/iconv.m4: GPL with exception +# m4/lib-ld.m4: GPL with exception +# m4/lib-link.m4: GPL with exception +# m4/lib-prefix.m4: GPL with exception +# m4/nls.m4: GPL with exception +# m4/po.m4: GPL with exception +# m4/progtest.m4: GPL with exception +# Makefile.in: FSFULLR +# missing: GPLv2+ with exception +# mkinstalldirs: Public Domain +License: BSD and GPLv2 and GPLv2+ +URL: http://sourceforge.net/projects/linuxquota/ +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) +Patch0: quota-4.04-warnquota-configuration-tunes.patch +Patch1: quota-4.03-Validate-upper-bound-of-RPC-port.patch +# Fix modifying CFLAGS and LDFLAGS by pkgconfig, in upstream after 4.05 +Patch2: quota-4.05-Revert-configure.ac-fix-pkg_check_modules-calls.patch +# 1/6 Report an error if an RPC fails on an explicitly requested file system, +# , in upstream after 4.05 +Patch3: quota-4.05-Make-messages-about-failures-for-NFS-consistent-with.patch +# 2/6 +Patch4: quota-4.05-quotaops-Do-not-return-partial-list-from-getprivs.patch +# 3/6 +Patch5: quota-4.05-quotaops-Do-not-leak-dquot-structures-on-failure.patch +# 4/6 +Patch6: quota-4.05-setquota-Report-failure-to-obtain-quota-information.patch +# 5/6 +Patch7: quota-4.05-rpc-Clarify-error-message-when-cannot-connect-to-rpc.patch +# 6/6 +Patch8: quota-4.05-quotaops-Make-error-string-translatable.patch +# Fix Free Software Foundation's postal address, +# , in upstream after 4.05 +Patch9: quota-4.05-COPYING-Update-mailing-address.patch +# Move quota_nld.pid file to /run, +# , in upstream after 4.05 +Patch10: quota-4.05-Make-a-directory-for-quota_nld-PID-file-configurable.patch +# Optimize out useless checking of file systems with hidden quota files, +# in upstream after 4.05 +Patch11: quota-4.05-quotacheck-Skip-checking-of-filesystems-with-hidded-.patch +# Fix warnquota --help output, in upstream after 4.05 +Patch12: quota-4.05-warnquota-Fix-help-text.patch +# Fix checking for the LDAP failures in the warnquota tool, +# in upstream after 4.05 +Patch13: quota-4.05-warnquota-Properly-detect-LDAP-errors.patch +# 1/2 Report detailed LDAP failures, in upstream after 4.05 +Patch14: quota-4.05-warnquota-Print-also-additional-error-info-for-LDAP-.patch +# 2/2 Report detailed LDAP failures, in upstream after 4.05, +# +Patch15: quota-4.05-warnquota-Free-LDAP-error-message.patch +# Document CC_TO in warquota.conf is looked up with LDAP, +# in upstream after 4.05 +Patch16: quota-4.05-warnquota-Clarify-that-CC_TO-gets-resolved-through-L.patch +# Initialize all members of a configparams structure in warnquota, +# in upstream after 4.05, +Patch17: quota-4.05-warnquota-Initialize-all-members-of-a-configparams-s.patch +# Fix ignoring disabled quotas, bug #1805110, in upstream after 4.05, +# +Patch18: quota-4.05-Fix-ignoring-disabled-quotas.patch +# Pass quota type for Q_XFS_GETQSTAT, in upstream after 4.05 +Patch19: quota-4.05-quota-tools-pass-quota-type-to-QCMD-for-Q_XFS_GETQST.patch +# 1/2 Support setting individual grace times for XFS, in upstream after 4.05 +Patch20: quota-4.05-quota-tools-Set-FS_DQ_TIMER_MASK-for-individual-xfs-.patch +# 2/2 Support setting individual grace times for XFS, in upstream after 4.05 +Patch21: quota-4.05-Fix-limits-setting-on-XFS-filesystem.patch +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: bash +BuildRequires: coreutils +BuildRequires: e2fsprogs-devel +BuildRequires: gcc +BuildRequires: gettext-devel +BuildRequires: make +BuildRequires: openldap-devel +%if %{with quota_enables_extdirect} +BuildRequires: pkgconfig(com_err) +BuildRequires: pkgconfig(ext2fs) +%endif +%if %{with quota_enables_netlink} +BuildRequires: pkgconfig(dbus-1) +BuildRequires: pkgconfig(libnl-3.0) >= 3.1 +BuildRequires: pkgconfig(libnl-genl-3.0) +BuildRequires: systemd-rpm-macros +%endif +%if %{with quota_enables_rpc} +BuildRequires: rpcgen +BuildRequires: pkgconfig(libtirpc) +BuildRequires: systemd-rpm-macros +%if %{with quota_enables_tcpwrappers} +BuildRequires: tcp_wrappers-devel +%endif +%endif +Requires: quota-nls = %{epoch}:%{version}-%{release} +Conflicts: kernel < 2.4 + +%description +The quota package contains system administration tools for monitoring +and limiting user and or group disk usage per file system. + + +%if %{with quota_enables_netlink} +%package nld +Summary: quota_nld daemon +License: GPLv2 and GPLv2+ +Requires: quota-nls = %{epoch}:%{version}-%{release} +# For %%{_unitdir} directory +Requires: systemd + +%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. +%endif + + +%if %{with quota_enables_rpc} +%package rpc +Summary: RPC quota daemon +License: LGPLv2+ and GPLv2 and GPLv2+ +Requires: quota-nls = %{epoch}:%{version}-%{release} +Requires: rpcbind +# For %%{_unitdir} directory +Requires: systemd +%if %{with quota_enables_tcpwrappers} +Requires: tcp_wrappers +%endif +Conflicts: quota < 1:4.02-3 + +%description rpc +The RPC daemon allows to query and set disk quotas over network. If you run +the daemon on NFS server, you could use quota tools to manage the quotas from +NFS client. +%endif + + +%package warnquota +Summary: Send e-mail to users over quota +License: GPLv2 and GPLv2+ +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 +License: BSD and LGPLv2+ and GPLv2 and GPLv2+ +BuildArch: noarch + +%description nls +Disk quota tools messages translated into different natural languages. + + +%if %{with quota_enables_rpc} +%package devel +Summary: Development files for quota RPC +License: GPLv2 +# libtirpc-devel for an included +Requires: libtirpc-devel +# Do not run-require main package, the header files define RPC API to be +# implemented by the developer, not an API for an existing quota library. + +%description devel +This package contains development header files for implementing disk quotas +on remote machines. +%endif + + +%package doc +Summary: Additional documentation for disk quotas +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 +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +# Regenerate build scripts +autoreconf -f -i + +%build +%global _hardened_build 1 +%configure \ + --enable-bsd-behaviour \ +%if %{with quota_enables_extdirect} + --enable-ext2direct=yes \ +%else + --enable-ext2direct=no \ +%endif + --enable-ldapmail=yes \ +%if %{with quota_enables_tcpwrappers} + --enable-libwrap=yes \ +%else + --disable-libwrap \ +%endif +%if %{with quota_enables_netlink} + --enable-netlink=yes \ +%else + --disable-netlink \ +%endif + --enable-nls \ + --with-pid-dir=/run \ + --disable-rpath \ +%if %{with quota_enables_rpc} + --enable-rpc=yes \ +%else + --disable-rpc \ +%endif +%if %{with quota_enables_rpcsetquota} + --enable-rpcsetquota=yes \ +%else + --disable-rpcsetquota \ +%endif + --disable-silent-rules \ + --disable-xfs-roothack +%{make_build} + + +%install +%{make_install} +rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name} + +%if %{with quota_enables_netlink} +install -p -m644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/quota_nld.service +install -p -m644 -D %{SOURCE2} \ + $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/quota_nld +%endif +%if %{with quota_enables_rpc} +install -p -m644 -D %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/rpc-rquotad.service +install -p -m644 -D %{SOURCE4} \ + $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/rpc-rquotad +%endif + +%find_lang %{name} + + +%check +make check + + +%if %{with quota_enables_netlink} +%post nld +%systemd_post quota_nld.service + +%preun nld +%systemd_preun quota_nld.service + +%postun nld +%systemd_postun_with_restart quota_nld.service +%endif + + +%if %{with quota_enables_rpc} +%post rpc +%systemd_post rpc-rquotad.service + +%preun rpc +%systemd_preun rpc-rquotad.service + +%postun rpc +%systemd_postun_with_restart rpc-rquotad.service +%endif + + +%files +%{_bindir}/* +%{_sbindir}/* +%exclude %{_sbindir}/quota_nld +%if %{with quota_enables_rpc} +%exclude %{_sbindir}/rpc.rquotad +%endif +%exclude %{_sbindir}/warnquota +%{_mandir}/man1/* +%{_mandir}/man8/* +%exclude %{_mandir}/man8/quota_nld.8* +%if %{with quota_enables_rpc} +%exclude %{_mandir}/man8/rpc.rquotad.8* +%endif +%exclude %{_mandir}/man8/warnquota.8* +%doc Changelog + +%if %{with quota_enables_netlink} +%files nld +%config(noreplace) %{_sysconfdir}/sysconfig/quota_nld +%{_unitdir}/quota_nld.service +%{_sbindir}/quota_nld +%{_mandir}/man8/quota_nld.8* +%doc Changelog +%endif + +%if %{with quota_enables_rpc} +%files rpc +%config(noreplace) %{_sysconfdir}/sysconfig/rpc-rquotad +%{_unitdir}/rpc-rquotad.service +%{_sbindir}/rpc.rquotad +%{_mandir}/man8/rpc.rquotad.8* +%doc Changelog +%endif + +%files warnquota +%config(noreplace) %{_sysconfdir}/quotagrpadmins +%config(noreplace) %{_sysconfdir}/quotatab +%config(noreplace) %{_sysconfdir}/warnquota.conf +%{_sbindir}/warnquota +%{_mandir}/man5/* +%{_mandir}/man8/warnquota.8* +%doc Changelog README.ldap-support README.mailserver + +%files nls -f %{name}.lang +# All the other packages require quota-nls, COPYING here is enough. +%license COPYING +%doc Changelog + +%if %{with quota_enables_rpc} +%files devel +%license COPYING +%dir %{_includedir}/rpcsvc +%{_includedir}/rpcsvc/* +%{_mandir}/man3/* +%endif + +%files doc +%doc doc/* ldap-scripts + + +%changelog +* Wed Sep 02 2020 Petr Pisar - 1:4.05-16 +- Require libtirpc-devel by quota-devel because of rpc/rpc.h + +* Mon Aug 24 2020 Petr Pisar - 1:4.05-15 +- Fix setting individual limits for XFS +- Modernize systemd unit packaging + +* Sat Aug 01 2020 Fedora Release Engineering - 1:4.05-14 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 1:4.05-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon May 18 2020 Petr Pisar - 1:4.05-12 +- Set kernel option when setting XFS grace times + +* Mon May 11 2020 Petr Pisar - 1:4.05-11 +- Pass quota type for Q_XFS_GETQSTAT + +* Thu Mar 26 2020 Petr Pisar - 1:4.05-10 +- Use an upstream's patch for ignoring disabled quotas (bug #1805110) + +* Fri Feb 21 2020 Petr Pisar - 1:4.05-9 +- Fix ignoring disabled quotas (bug #1805110) + +* Thu Jan 30 2020 Fedora Release Engineering - 1:4.05-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Nov 06 2019 Petr Pisar - 1:4.05-7 +- Remove a patch for freeing a parsed configuration in warnquota + +* Tue Nov 05 2019 Petr Pisar - 1:4.05-6 +- Optimize out useless checking of file systems with hidden quota files +- Fix warnquota --help output +- Fix checking for the LDAP failures in the warnquota tool +- Report detailed LDAP failures +- Document CC_TO in warquota.conf is looked up with LDAP +- Initialize all members of a configparams structure in warnquota +- Free parsed configuration in warnquota + +* Fri Jul 26 2019 Fedora Release Engineering - 1:4.05-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu May 30 2019 Petr Pisar - 1:4.05-4 +- Move quota_nld.pid file to /run (upstream patch #49) + +* Wed May 29 2019 Petr Pisar - 1:4.05-3 +- Run quota_nld service as tty group + +* Mon May 27 2019 Petr Pisar - 1:4.05-2 +- Report an error if an RPC fails on an explicitly requested file system + (upstream bug #134) +- Fix Free Software Foundation's postal address (upstream bug #133) + +* Tue Apr 02 2019 Petr Pisar - 1:4.05-1 +- 4.05 bump +- License changed (only edquota tool contains a BSD code now) +- quot tool was removed + +* Sat Feb 02 2019 Fedora Release Engineering - 1:4.04-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Aug 23 2018 Petr Pisar - 1:4.04-10 +- Fix file descriptor leaks in error code paths + +* Tue Jul 24 2018 Petr Pisar - 1:4.04-9 +- Distinguish between none quota limits and no allocated resources in quota(1) + tool output + +* Sat Jul 14 2018 Fedora Release Engineering - 1:4.04-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed May 30 2018 Petr Pisar - 1:4.04-7 +- Fix current block usage limit in RPC client + +* Tue May 22 2018 Petr Pisar - 1:4.04-6 +- Fix busy loop in rpc.rquotad (bug #1575956) + +* Fri Feb 09 2018 Fedora Release Engineering - 1:4.04-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Mon Feb 05 2018 Petr Pisar - 1:4.04-4 +- Avoid questions in quotacheck non-interactive mode +- Report an error when quotacheck fails to cache quota files +- Report an error if quota file magic is invalid + +* Mon Feb 05 2018 Petr Pisar - 1:4.04-3 +- rpcgen tool split from glibc-common package +- Pass TIRPC header files location to all RPC compilation units +- Do not iterate over negative UIDs in repquota +- Fix mistakes in warnquota reported by GCC 8 + +* Thu Nov 30 2017 Petr Pisar - 1:4.04-2 +- Disable TCP wrappers (bug #1518778) + +* Wed Sep 06 2017 Petr Pisar - 1:4.04-1 +- 4.04 bump + +* Mon Aug 28 2017 Petr Pisar - 1:4.03-12 +- Fix memory leaks when running quotacheck on ext file systems (bug #1483543) + +* Thu Aug 03 2017 Fedora Release Engineering - 1:4.03-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1:4.03-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Tue Jul 04 2017 Petr Pisar - 1:4.03-9 +- Fix disabling features at build time +- Fix a race between checking for and opening a directory to be scanned +- Fix an undefined behavior on parsing yes-no answer +- Check for setuid and setgid calls failure in edquota tool +- Check for failures when reading edquota input +- Check for failures when duplicating a file handle + +* Sat Feb 11 2017 Fedora Release Engineering - 1:4.03-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Nov 10 2016 Petr Pisar - 1:4.03-7 +- Fix checking a block read error (upstream bug #123) +- Use direct scanning also for ext4 + +* Fri Jun 10 2016 Petr Pisar - 1:4.03-6 +- Correct repquota indentation for file systems with hiden quota files +- Remove unnecessary quota dependency from quota-devel package +- Break licenses down to each package + +* Thu Mar 10 2016 Petr Pisar - 1:4.03-5 +- Start rpc-rquotad.service when starting nfs-server.service + +* Thu Mar 03 2016 Petr Pisar - 1:4.03-4 +- Declare quota-rpc requires rpcbind because of the rpc.rquotad daemon + +* Mon Feb 22 2016 Petr Pisar - 1:4.03-3 +- Query kernel for next quota on XFS or file system with hidden quota files + (bug #1306195) + +* Thu Feb 04 2016 Fedora Release Engineering - 1:4.03-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jan 06 2016 Petr Pisar - 1:4.03-1 +- 4.03 bump +- Work around Autoconf bug not to link ldap library to everything + (bug #1296455) + +* Thu Jun 18 2015 Fedora Release Engineering - 1:4.02-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu Apr 02 2015 Petr Pisar - 1:4.02-3 +- Move rpc.rquotad daemon into quota-rpc sub-package + +* Thu Apr 02 2015 Petr Pisar - 1:4.02-2 +- Add rpc-rquotad.service file which was known as nfs-rquotad.service + in nfs-utils (bug #1206260) + +* Wed Nov 26 2014 Petr Pisar - 1:4.02-1 +- 4.02 bump + +* Sun Aug 17 2014 Fedora Release Engineering - 1:4.01-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sun Jun 08 2014 Fedora Release Engineering - 1:4.01-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed Mar 05 2014 Petr Pisar - 1:4.01-12 +- Prevent from grace period overflow in RPC transport (bug #1072769) + +* Wed Oct 16 2013 Petr Pisar - 1:4.01-11 +- 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) + +* Sun Aug 04 2013 Fedora Release Engineering - 1:4.01-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Jun 13 2013 Petr Pisar - 1:4.01-9 +- Close FILE handles on error too + +* Wed Jun 12 2013 Petr Pisar - 1:4.01-8 +- Allow to set limits using multiplicative units + +* Mon May 27 2013 Petr Pisar - 1:4.01-7 +- Add LGPLv2+ and GPLv2 to license declaration +- Correct changelog dates +- Package additional LDAP scripts as a documentation +- Package XFS-specific tools + +* Mon May 20 2013 Petr Pisar - 1:4.01-6 +- Remove code for migration from systemv-style init script +- Drop useless dependency on initscripts (bug #964440) + +* 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 daemon 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 diff --git a/quota_nld.service b/quota_nld.service new file mode 100644 index 0000000..d533d01 --- /dev/null +++ b/quota_nld.service @@ -0,0 +1,13 @@ +[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=/run/quota_nld.pid +Group=tty + +[Install] +WantedBy=multi-user.target diff --git a/quota_nld.sysconfig b/quota_nld.sysconfig new file mode 100644 index 0000000..51df5be --- /dev/null +++ b/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/rpc-rquotad.service b/rpc-rquotad.service new file mode 100644 index 0000000..f9c794e --- /dev/null +++ b/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/rpc-rquotad.sysconfig b/rpc-rquotad.sysconfig new file mode 100644 index 0000000..4c67c13 --- /dev/null +++ b/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/sources b/sources new file mode 100644 index 0000000..ed8f628 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (quota-4.05.tar.gz) = a13ca93fb6fad032cb032874dda2f5d792e619b41e89b481e6aaa4f06ac5774e2728b09dd625addfbe22efccb1d85892b093736084c72f75675a60df168b92f2