From 8f619f64daca645ba0ead37ebc480f65561c2c37 Mon Sep 17 00:00:00 2001 From: Petr Písař Date: Nov 10 2016 14:07:59 +0000 Subject: Fix checking a block read error --- diff --git a/quota-4.03-quotacheck-Fix-buggy-error-check-of-read-2.patch b/quota-4.03-quotacheck-Fix-buggy-error-check-of-read-2.patch new file mode 100644 index 0000000..976f3a7 --- /dev/null +++ b/quota-4.03-quotacheck-Fix-buggy-error-check-of-read-2.patch @@ -0,0 +1,34 @@ +From 2432de0526c282f05010cfa432059cbc9e794259 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Wed, 6 Jul 2016 11:10:49 +0200 +Subject: [PATCH] quotacheck: Fix buggy error check of read(2) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +'rd' was declared as size_t which is unsigned so it could never be less +than 0. Fix it by declaring 'rd' as ssize_t which is the real read(2) +return type. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotacheck_v2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/quotacheck_v2.c b/quotacheck_v2.c +index de4293f..4cc8558 100644 +--- a/quotacheck_v2.c ++++ b/quotacheck_v2.c +@@ -233,7 +233,7 @@ static int buffer_entry(dqbuf_t buf, uint blk, int *corrupted, uint * lblk, int + + static void check_read_blk(int fd, uint blk, dqbuf_t buf) + { +- size_t rd; ++ ssize_t rd; + + lseek(fd, blk << QT_BLKSIZE_BITS, SEEK_SET); + rd = read(fd, buf, QT_BLKSIZE); +-- +2.7.4 + diff --git a/quota.spec b/quota.spec index 8275a70..8e2067c 100644 --- a/quota.spec +++ b/quota.spec @@ -4,7 +4,7 @@ Name: quota Epoch: 1 Version: 4.03 -Release: 3%{?dist} +Release: 4%{?dist} Summary: System administration tools for monitoring users' disk usage # quota_nld.c, quotaio_xfs.h: GPLv2 # bylabel.c copied from util-linux: GPLv2+ @@ -44,6 +44,9 @@ Patch3: quota-4.03-Respect-enviroment-CFLAGS.patch # bug #1296455, reported to upstream # Patch4: quota-4.03-Work-around-an-AC_CHECK_LIB-bug-in-Autoconf.patch +# Fix checking a block read error, in upstream after 4.03, +# +Patch5: quota-4.03-quotacheck-Fix-buggy-error-check-of-read-2.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: bash @@ -155,6 +158,7 @@ Linux/UNIX environment. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 # Unpack forgotten LDAP scripts tar -xzkf %{SOURCE5} # Regenerate build scripts, also because of Respect-enviroment-CFLAGS.patch @@ -267,6 +271,9 @@ make check %changelog +* Thu Nov 10 2016 Petr Pisar - 1:4.03-4 +- Fix checking a block read error (upstream bug #123) + * Thu Mar 03 2016 Petr Pisar - 1:4.03-3 - Declare quota-rpc requires rpcbind because of the rpc.rquotad daemon