RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/quota#716ce4c86c0271c5f4d3601bd5d5713e16e98da6
This commit is contained in:
parent
ab45d0f0de
commit
a6e0b265bb
9
.gitignore
vendored
9
.gitignore
vendored
@ -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
|
||||
29
quota-4.03-Validate-upper-bound-of-RPC-port.patch
Normal file
29
quota-4.03-Validate-upper-bound-of-RPC-port.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From c9a2a6fea0668579f5fb8d77cb219f51d104581f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
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ř <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
76
quota-4.04-warnquota-configuration-tunes.patch
Normal file
76
quota-4.04-warnquota-configuration-tunes.patch
Normal file
@ -0,0 +1,76 @@
|
||||
From 67a0dbf6434552e720b0d311597553b3a76f779e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
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ř <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
106
quota-4.05-COPYING-Update-mailing-address.patch
Normal file
106
quota-4.05-COPYING-Update-mailing-address.patch
Normal file
@ -0,0 +1,106 @@
|
||||
From b6bb53e1124e6b813fe4de5682b9d9a9f8a1fba8 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
49
quota-4.05-Fix-ignoring-disabled-quotas.patch
Normal file
49
quota-4.05-Fix-ignoring-disabled-quotas.patch
Normal file
@ -0,0 +1,49 @@
|
||||
From 110b4a4011655fb650f82c88312ba44d7e249060 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
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ř <ppisar@redhat.com>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
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
|
||||
|
||||
42
quota-4.05-Fix-limits-setting-on-XFS-filesystem.patch
Normal file
42
quota-4.05-Fix-limits-setting-on-XFS-filesystem.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From 13bb8c2daca0f1c1099ce6ba9dcb23319f7955d0 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <sandeen@redhat.com>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
From bbcf9eedb2299ab55a0ae208e196eb2ca59ad97e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
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ř <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,112 @@
|
||||
From a4b0af23e1e3761825e9d4ac075e3fcae8ab91cb Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
From 00d61f21bfa3ccf40826ce22de12cfeeab8a40a5 Mon Sep 17 00:00:00 2001
|
||||
From: "Dmitry V. Levin" <ldv@altlinux.org>
|
||||
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 <ldv@altlinux.org>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
From be96da2353669d433b0abddb85b26ccaf35e3451 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Sandeen <sandeen@redhat.com>
|
||||
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 <sandeen@redhat.com>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
From fdd774bf08e56872ae4c0420e0f01efa25e715d6 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Sandeen <sandeen@redhat.com>
|
||||
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 <sandeen@redhat.com>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
From 61e57e73a6c63ad50825182ca80bc2a5fcb3e1e2 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,68 @@
|
||||
From 7942290a0a6230fcc56eae42bf436e6eeca88777 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
From e6decbfe6c44935584954ab01c8be2f5d02acf1b Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
32
quota-4.05-quotaops-Make-error-string-translatable.patch
Normal file
32
quota-4.05-quotaops-Make-error-string-translatable.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From d9996b2b6b3cdcd41485804eabadbf576506c8fa Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,127 @@
|
||||
From 4cd287f3fa3838a31eb6636366f8ce26ee6e1425 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
From daba90fb6d9b8c8f1361457bf2bea7b18f4e35ec Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
From 662e9e93babc9be39bb2d6267ffe428703ca137e Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <jack@suse.cz>
|
||||
Petr Písař: Ported to Fedora 32.
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
33
quota-4.05-warnquota-Fix-help-text.patch
Normal file
33
quota-4.05-warnquota-Fix-help-text.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From 1ae10f8692981285ad52af9e9ae3e5f16201b187 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
36
quota-4.05-warnquota-Free-LDAP-error-message.patch
Normal file
36
quota-4.05-warnquota-Free-LDAP-error-message.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From a543b200cdd1e798383cc1070e51ad13ff424543 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
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ř <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
From 50c3f30d610ed9979a1291422e8641e05f881212 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
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ř <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
@ -0,0 +1,82 @@
|
||||
From 52ead0d37dcbce59338dcb765527712c9ee656e1 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
42
quota-4.05-warnquota-Properly-detect-LDAP-errors.patch
Normal file
42
quota-4.05-warnquota-Properly-detect-LDAP-errors.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From 3615f3ec7dd3c867a8394640c0fc4736189315df Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
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 <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
10
quota.rpmlintrc
Normal file
10
quota.rpmlintrc
Normal file
@ -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");
|
||||
1069
quota.spec
Normal file
1069
quota.spec
Normal file
File diff suppressed because it is too large
Load Diff
13
quota_nld.service
Normal file
13
quota_nld.service
Normal file
@ -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
|
||||
5
quota_nld.sysconfig
Normal file
5
quota_nld.sysconfig
Normal file
@ -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=""
|
||||
15
rpc-rquotad.service
Normal file
15
rpc-rquotad.service
Normal file
@ -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
|
||||
8
rpc-rquotad.sysconfig
Normal file
8
rpc-rquotad.sysconfig
Normal file
@ -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=""
|
||||
Loading…
Reference in New Issue
Block a user