New upstream release 4.07

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
This commit is contained in:
Lukas Czerner 2022-09-19 14:04:58 +02:00
parent 56e3765bbd
commit 76d06b5384
11 changed files with 8 additions and 401 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ quota-3.17.tar.gz
/quota-4.04.tar.gz
/quota-4.05.tar.gz
/quota-4.06.tar.gz
/quota-4.07.tar.gz

View File

@ -1,43 +0,0 @@
From 1959f3768a284315250acd4d17a9f5ef0b8ea189 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Mon, 30 Nov 2020 16:35:26 +0100
Subject: [PATCH] Drop sys/cdefs.h usage
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
quota.h header includes sys/cdefs.h because it uses __P() macro in
quotactl syscall declaration. However glibc currently defines __P() is
nop and it only causes issues with other libc implementations (e.g. musl
libc). So just drop __P() usage and sys/cdefs.h include.
Reported-by: 2xsaiko <git@dblsaiko.net>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
quota.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/quota.h b/quota.h
index 4c21411..845cbbd 100644
--- a/quota.h
+++ b/quota.h
@@ -1,7 +1,6 @@
#ifndef GUARD_QUOTA_H
#define GUARD_QUOTA_H
-#include <sys/cdefs.h>
#include <sys/types.h>
#include <stdint.h>
@@ -182,6 +181,6 @@ enum {
#endif
#endif
-long quotactl __P((int, const char *, qid_t, caddr_t));
+long quotactl(int, const char *, qid_t, caddr_t);
#endif /* _QUOTA_ */
--
2.26.2

View File

@ -1,43 +0,0 @@
From b0f95e3954f85d97a99f8a08645418945484dbca Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Wed, 1 Sep 2021 08:00:00 +0000
Subject: [PATCH 2/3] common.c: fix strncat usage
When quota is configured using --enable-werror, gcc -flto fails with
the following diagnostics:
In function 'strncat',
inlined from 'sstrncat' at common.c:113:2,
inlined from 'get_proc_num' at quotastats.c:46:2:
/usr/include/bits/string_fortified.h:122:10: error: '__builtin___strncat_chk' specified bound 4096 equals destination size [-Werror=str
ingop-overflow=]
122 | return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
| ^
This diagnostics is correct: when "src" contains "len" or more bytes,
strncat() writes "len"+1 bytes to "dest" ("len" from "src" plus
the terminating null byte).
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
---
common.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/common.c b/common.c
index 8be0428..b3e5ad2 100644
--- a/common.c
+++ b/common.c
@@ -110,8 +110,7 @@ void sstrncpy(char *d, const char *s, size_t len)
void sstrncat(char *d, const char *s, size_t len)
{
- strncat(d, s, len);
- d[len - 1] = 0;
+ strncat(d, s, len - 1);
}
char *sstrdup(const char *s)
--
2.31.1

View File

@ -1,34 +0,0 @@
From 25f16b1de313ce0d411f754572f94f051bfbe3c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 16 Mar 2021 17:28:15 +0100
Subject: [PATCH] quota_nld: Initialize sa_mask when registering PID file
removal
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
term_action.sa_mask is an automatic variable and and thus unitialized.
This patch empties the signal mask.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
quota_nld.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/quota_nld.c b/quota_nld.c
index 72d99a9..09c4775 100644
--- a/quota_nld.c
+++ b/quota_nld.c
@@ -466,7 +466,7 @@ static void use_pid_file(void)
term_action.sa_handler = remove_pid;
term_action.sa_flags = 0;
- if (sigaction(SIGTERM, &term_action, NULL))
+ if (sigemptyset(&term_action.sa_mask) || sigaction(SIGTERM, &term_action, NULL))
errstr(_("Could not register PID file removal on SIGTERM.\n"));
if (store_pid())
errstr(_("Could not store my PID %jd.\n"), (intmax_t )getpid());
--
2.26.3

View File

@ -1,32 +0,0 @@
From 55f1a0604bd4df6d591674b5bef123be1af84e55 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Fri, 20 Nov 2020 15:28:49 +0100
Subject: [PATCH] quotacheck: Remove a dead code from process_file()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The ret variable inicialization is useless because it is assigned in
all (two) subsequent code branches.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
quotacheck.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/quotacheck.c b/quotacheck.c
index 5810ced..1b81610 100644
--- a/quotacheck.c
+++ b/quotacheck.c
@@ -672,7 +672,6 @@ Please turn quotas off or use -f to force checking.\n"),
}
}
- ret = 0;
memset(old_info + type, 0, sizeof(old_info[type]));
if (is_tree_qfmt(cfmt))
ret = v2_buffer_file(qfname, fd, type, cfmt);
--
2.26.2

View File

@ -1,68 +0,0 @@
From 100b8a8814152ca6f52564cb65f33bf7cf033c22 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Fri, 20 Aug 2021 21:51:05 +0200
Subject: [PATCH 1/3] quotacheck, quotaon: Always display message about
deprecated usage
Visible quota files on ext4 filesystem are deprecated. Make sure we
always display the warning message and also expand the message to
explain how the filesystem can be converted.
Signed-off-by: Jan Kara <jack@suse.cz>
---
quotacheck.c | 7 +++++--
quotaon.c | 7 ++++---
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/quotacheck.c b/quotacheck.c
index 1b81610..bd62d9a 100644
--- a/quotacheck.c
+++ b/quotacheck.c
@@ -1198,7 +1198,7 @@ static int check_all(void)
debug(FL_DEBUG, _("Detected quota format %s\n"), fmt2name(cfmt));
}
- if (flags & (FL_VERBOSE | FL_DEBUG) && !warned) {
+ if (!warned) {
if (!strcmp(mnt->me_type, MNTTYPE_EXT4) &&
ext4_supports_quota_feature()) {
warned = 1;
@@ -1207,7 +1207,10 @@ static int check_all(void)
"external quota files. Please switch "
"your filesystem to use ext4 quota "
"feature as external quota files on "
- "ext4 are deprecated.\n"));
+ "ext4 are deprecated. You can enable "
+ "the feature by unmounting the file "
+ "system and running 'tune2fs -O quota "
+ "<device>'.\n"));
} else if (!str_hasmntopt(mnt->me_opts, MNTOPT_USRJQUOTA) &&
!str_hasmntopt(mnt->me_opts, MNTOPT_GRPJQUOTA) &&
(!strcmp(mnt->me_type, MNTTYPE_EXT3) ||
diff --git a/quotaon.c b/quotaon.c
index aceb6ec..125b934 100644
--- a/quotaon.c
+++ b/quotaon.c
@@ -270,15 +270,16 @@ static int newstate(struct mount_entry *mnt, int type, char *extra)
if (!me_hasquota(mnt, type))
return 0;
- if (flags & FL_VERBOSE && !warned &&
- !strcmp(mnt->me_type, MNTTYPE_EXT4) &&
+ if (!warned && !strcmp(mnt->me_type, MNTTYPE_EXT4) &&
ext4_supports_quota_feature()) {
warned = 1;
errstr(_("Your kernel probably supports ext4 quota "
"feature but you are using external quota "
"files. Please switch your filesystem to use "
"ext4 quota feature as external quota files "
- "on ext4 are deprecated.\n"));
+ "on ext4 are deprecated. You can enable the "
+ "feature by unmounting the file system and "
+ "running 'tune2fs -O quota <device>'.\n"));
}
if (fmt == -1) {
if (get_qf_name(mnt, type, QF_VFSV0,
--
2.31.1

View File

@ -1,72 +0,0 @@
From 43b6e31f39edbe7de4f4feeef4d0cf6be093e021 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Mon, 23 Nov 2020 17:12:27 +0100
Subject: [PATCH] quotaio_xfs: Warn when large kernel timestamps cannot be
handled
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When time_t is 32-bit, warn if the kernel returns anything that cannot
fit in these time stamps. This also fixes a compilation warning that
shift exceeds data type size. Similarly when converting data to pass to
kernel, just avoid the pointless shift (generating compiler warning)
when time_t is 32-bit.
Reported-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 | 2 ++
quotaio_xfs.c | 9 +++++++++
2 files changed, 11 insertions(+)
diff --git a/configure.ac b/configure.ac
index 2239b49..296b77a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,6 +82,8 @@ AS_IF([test x"$enable_werror" != "xno"], [
])
AC_SUBST([WARN_CFLAGS])
+AC_CHECK_SIZEOF([time_t], [], [#include <time.h>])
+
# =========
# Find ldap
# =========
diff --git a/quotaio_xfs.c b/quotaio_xfs.c
index 2db1c0c..5abb2c2 100644
--- a/quotaio_xfs.c
+++ b/quotaio_xfs.c
@@ -45,8 +45,13 @@ report: xfs_report
static inline time_t xfs_kern2utildqblk_ts(const struct xfs_kern_dqblk *k,
__s32 timer, __s8 timer_hi)
{
+#if SIZEOF_TIME_T > 4
if (k->d_fieldmask & FS_DQ_BIGTIME)
return (__u32)timer | (__s64)timer_hi << 32;
+#else
+ if (k->d_fieldmask & FS_DQ_BIGTIME && timer_hi != 0)
+ errstr(_("Truncating kernel returned time stamp."));
+#endif
return timer;
}
@@ -54,10 +59,14 @@ static inline void xfs_util2kerndqblk_ts(const struct xfs_kern_dqblk *k,
__s32 *timer_lo, __s8 *timer_hi, time_t timer)
{
*timer_lo = timer;
+#if SIZEOF_TIME_T > 4
if (k->d_fieldmask & FS_DQ_BIGTIME)
*timer_hi = timer >> 32;
else
*timer_hi = 0;
+#else
+ *timer_hi = 0;
+#endif
}
static inline int want_bigtime(time_t timer)
--
2.26.2

View File

@ -1,39 +0,0 @@
From 8a3321627bb9215ed40f8f7036a1e86bcaf10ad1 Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Sun, 22 Nov 2020 08:00:00 +0000
Subject: [PATCH] quotaops: fix compilation warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When quota is configured using --enable-werror --disable-bsd_behaviour,
the compilation fails with the following diagnostics:
quotaops.c: In function 'getprivs':
quotaops.c:143:1: error: label 'out_err' defined but not used [-Werror=unused-label]
Fixes: 7942290a ("quotaops: Do not leak dquot structures on failure")
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>
---
quotaops.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/quotaops.c b/quotaops.c
index ff4d16e..96086f4 100644
--- a/quotaops.c
+++ b/quotaops.c
@@ -140,7 +140,9 @@ 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, estr);
+#if defined(BSD_BEHAVIOUR)
out_err:
+#endif
freeprivs(qhead);
return NULL;
}
--
2.26.2

View File

@ -1,46 +0,0 @@
From d2256ac2d44b0a5be9c0b49ce4ce8e5f6821ce2a Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Wed, 1 Sep 2021 08:00:00 +0000
Subject: [PATCH 3/3] quotasys.c: fix strncpy usage
When quota is configured using --enable-werror, gcc -flto fails with
the following diagnostics:
In function 'strncpy',
inlined from 'sstrncpy' at common.c:107:2,
inlined from 'copy_mntoptarg' at quotasys.c:774:3,
inlined from 'copy_mntoptarg' at quotasys.c:769:13:
/usr/include/bits/string_fortified.h:91:10: error: '__builtin_strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
91 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^
quotasys.c: In function 'copy_mntoptarg':
quotasys.c:774:25: note: length computed here
774 | sstrncpy(buf, optarg, min(buflen, strlen(optarg) + 1));
| ^
This diagnostics is correct: strcpy() copies at most "len" bytes of the string
pointed to by "src", including the terminating null byte, to the buffer
pointed to by "dest".
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
---
quotasys.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/quotasys.c b/quotasys.c
index 885fb1f..3f50e32 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -771,7 +771,7 @@ static void copy_mntoptarg(char *buf, const char *optarg, int buflen)
char *sep = strchr(optarg, ',');
if (!sep)
- sstrncpy(buf, optarg, min(buflen, strlen(optarg) + 1));
+ sstrncpy(buf, optarg, buflen);
else
sstrncpy(buf, optarg, min(buflen, sep - optarg + 1));
}
--
2.31.1

View File

@ -12,8 +12,8 @@
Name: quota
Epoch: 1
Version: 4.06
Release: 8%{?dist}
Version: 4.07
Release: 1%{?dist}
Summary: System administration tools for monitoring users' disk usage
# quota_nld.c, quotaio_xfs.h: GPLv2
# bylabel.c copied from util-linux: GPLv2+
@ -59,22 +59,6 @@ Source4: rpc-rquotad.sysconfig
Patch0: quota-4.06-warnquota-configuration-tunes.patch
# Fix parsing a TCP port number
Patch1: quota-4.03-Validate-upper-bound-of-RPC-port.patch
# Remove a dead code from process_file(), in upstream after 4.06,
# <https://sourceforge.net/p/linuxquota/patches/54/>
Patch2: quota-4.06-quotacheck-Remove-a-dead-code-from-process_file.patch
# Fix a compilation warning in quotaops.c, in upstream after 4.06
Patch3: quota-4.06-quotaops-fix-compilation-warning.patch
# Warn when kernel XFS large time stamp does fit into (32-bit) user-space
# time_t, in upstream after 4.06
Patch4: quota-4.06-quotaio_xfs-Warn-when-large-kernel-timestamps-cannot.patch
# Do not use a pointless compiler-internal __P() macro, in upstream after 4.06
Patch5: quota-4.06-Drop-sys-cdefs.h-usage.patch
# Fix sa_mask initialization when registering PID file removal,
# upstream bug #141, in upstream after 4.06
Patch6: quota-4.06-quota_nld-Initialize-sa_mask-when-registering-PID-fi.patch
Patch7: quota-4.06-quotacheck-quotaon-Always-display-message-about-depr.patch
Patch8: quota-4.06-common.c-fix-strncat-usage.patch
Patch9: quota-4.06-quotasys.c-fix-strncpy-usage.patch
BuildRequires: autoconf
BuildRequires: automake
@ -198,11 +182,7 @@ Linux/UNIX environment.
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
# Regenerate build scripts
autoreconf -f -i
@ -352,6 +332,9 @@ make check
%changelog
* Tue Sep 20 2022 Lukas Czerner <lczerner@redhat.com> - 1:4.07-1
- New upstream release 4.07
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.06-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (quota-4.06.tar.gz) = cece46b8e3a82e8afcf8bfc9f6b310ec91afe034102cebc031bc7d7e04287fdbffb21ab1d3e6e1825175cffa4bad0a4ecbefec0efee028d961b14ac626d5c871
SHA512 (quota-4.07.tar.gz) = c31ab803979899fc5cd074c595f775ff94430bb190606016be47962b3764855f0bd131e1c4eef6e35b37067a80d7519d652720f919f1fd8937344f9cc5d8b33d