Compare commits

...

No commits in common. "c9-beta" and "c10s" have entirely different histories.

12 changed files with 232 additions and 158 deletions

View File

@ -1 +0,0 @@
e6d7751fe5c61340d3b9ce15f2109c6e5563f267 SOURCES/exfatprogs-1.2.2.tar.xz

9
.gitignore vendored
View File

@ -1 +1,8 @@
SOURCES/exfatprogs-1.2.2.tar.xz
/exfatprogs-1.0.4.tar.xz
/exfatprogs-1.1.0.tar.xz
/exfatprogs-1.1.1.tar.xz
/exfatprogs-1.1.2.tar.xz
/exfatprogs-1.1.3.tar.xz
/exfatprogs-1.2.0.tar.xz
/exfatprogs-1.2.1.tar.xz
/exfatprogs-1.2.2.tar.xz

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# exfatprogs
The exfatprogs package

View File

@ -1,71 +0,0 @@
From cb641bd9b81179b7f039e6d0e64cd67e7fb4e11c Mon Sep 17 00:00:00 2001
From: Pavel Reichl <preichl@redhat.com>
Date: Wed, 6 Dec 2023 22:01:04 +0100
Subject: [PATCH] exfatprogs: Fix issues found by OpenScanHub tool
Fix some issues found by red hat internal OpenScanHub tool.
exfatprogs-1.2.2/exfat2img/exfat2img.c:893: check_return: Calling
"fsync" without checking return value (as is done elsewhere
6 out of 7 times).
exfatprogs-1.2.2/fsck/fsck.c:1251:2: warning[deadcode.DeadStores]:
Value stored to 'err' is never read
exfatprogs-1.2.2/lib/libexfat.c:983: returned_null: "malloc" returns
"NULL" (checked 20 out of 23 times)
Signed-off-by: Pavel Reichl <preichl@redhat.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
---
exfat2img/exfat2img.c | 5 ++++-
fsck/fsck.c | 1 -
lib/libexfat.c | 4 ++++
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/exfat2img/exfat2img.c b/exfat2img/exfat2img.c
index f1a4ef2..4774a56 100644
--- a/exfat2img/exfat2img.c
+++ b/exfat2img/exfat2img.c
@@ -890,7 +890,10 @@ static int restore_from_stdin(struct exfat2img *ei)
}
}
out:
- fsync(ei->out_fd);
+ if (fsync(ei->out_fd)) {
+ exfat_err("failed to fsync: %d\n", errno);
+ ret = -EIO;
+ }
exfat_free_buffer(ei->dump_bdesc, 2);
return ret;
}
diff --git a/fsck/fsck.c b/fsck/fsck.c
index 77272aa..a5517d2 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -1248,7 +1248,6 @@ static int exfat_root_dir_check(struct exfat *exfat)
err = exfat_read_volume_label(exfat);
if (err && err != EOF)
exfat_err("failed to read volume label\n");
- err = 0;
err = read_bitmap(exfat);
if (err) {
diff --git a/lib/libexfat.c b/lib/libexfat.c
index d7b8344..6ae5742 100644
--- a/lib/libexfat.c
+++ b/lib/libexfat.c
@@ -981,6 +981,10 @@ int read_boot_sect(struct exfat_blk_dev *bdev, struct pbr **bs)
unsigned int sect_size, clu_size;
pbr = malloc(sizeof(struct pbr));
+ if (!pbr) {
+ exfat_err("failed to allocate memory\n");
+ return -ENOMEM;
+ }
if (exfat_read(bdev->dev_fd, pbr, sizeof(*pbr), 0) !=
(ssize_t)sizeof(*pbr)) {
--
2.43.0

View File

@ -1,83 +0,0 @@
Name: exfatprogs
Version: 1.2.2
Release: 2%{?dist}
Summary: Userspace utilities for exFAT filesystems
License: GPLv2
URL: https://github.com/%{name}/%{name}
Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.xz
Patch0: for-next-1.2.2-exfat2img-fix-Missing-Initialization.patch
Patch1: for-next-1.2.2-exfatprogs-Fix-issues-found-by-OpenScanHub-tool.patch
Patch2: for-next-1.2.2-tune-label-fix-USE_AFTER_FREE.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc
BuildRequires: libtool
BuildRequires: make
%description
Utilities for formatting and repairing exFAT filesystems.
%prep
%autosetup -p1
%build
autoreconf -vif
%configure \
--enable-shared=yes \
--enable-static=no
%make_build
%install
%make_install
%files
%license COPYING
%doc README.md
%{_sbindir}/dump.exfat
%{_sbindir}/exfatlabel
%{_sbindir}/exfat2img
%{_sbindir}/fsck.exfat
%{_sbindir}/mkfs.exfat
%{_sbindir}/tune.exfat
%{_mandir}/man8/dump.exfat.*
%{_mandir}/man8/exfatlabel.*
%{_mandir}/man8/exfat2img.*
%{_mandir}/man8/fsck.exfat.*
%{_mandir}/man8/mkfs.exfat.*
%{_mandir}/man8/tune.exfat.*
%changelog
* Fri Dec 08 2023 Pavel Reichl <preichl@redhat.com> - 1.2.2-2
- Backport fixes for issues found by OpenScanHub
- Related: RHEL-7945
* Mon Nov 06 2023 Pavel Reichl <preichl@redhat.com> - 1.2.2-1
- Rebase to upstream v1.2.2
- Related: RHEL-15865
- Related: RHEL-14995
* Mon Mar 13 2023 Pavel Reichl <preichl@redhat.com> - 1.2.0-2
- Fix wrong BZ number in git log
Related: rhbz#2173273
* Mon Mar 06 2023 Pavel Reichl <preichl@redhat.com> - 1.2.0-1
- Rebase
Related: rhbz#2173273
* Tue May 24 2022 Pavel Reichl <preichl@redhat.com> - 1.1.3-3.test
- Fix some covscan issues
* Mon May 09 2022 Pavel Reichl <preichl@redhat.com> - 1.1.3-2
- Fix memomry leak
* Wed Apr 20 2022 Pavel Reichl <preichl@redhat.com> - 1.1.3-1
- Rebase
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.1.2-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Jun 1 2021 Pavel Reichl <preichl@redhat.com> - 1.1.2-1
- First build.

121
exfatprogs.spec Normal file
View File

@ -0,0 +1,121 @@
Name: exfatprogs
Version: 1.2.2
Release: 6%{?dist}
Summary: Userspace utilities for exFAT filesystems
License: GPL-2.0-only
URL: https://github.com/%{name}/%{name}
Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.xz
Patch0: v1.2.3-exfat2img-fix-Missing-Initialization.patch
Patch1: v1.2.3-tune-label-fix-USE_AFTER_FREE.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc
BuildRequires: libtool
BuildRequires: make
%description
Utilities for formatting and repairing exFAT filesystems.
%prep
%autosetup -p1
%build
autoreconf -vif
%configure \
--enable-shared=yes \
--enable-static=no
%make_build
%install
%make_install
%files
%license COPYING
%doc README.md
%{_sbindir}/dump.exfat
%{_sbindir}/exfat2img
%{_sbindir}/exfatlabel
%{_sbindir}/fsck.exfat
%{_sbindir}/mkfs.exfat
%{_sbindir}/tune.exfat
%{_mandir}/man8/dump.exfat.*
%{_mandir}/man8/exfat2img.*
%{_mandir}/man8/exfatlabel.*
%{_mandir}/man8/fsck.exfat.*
%{_mandir}/man8/mkfs.exfat.*
%{_mandir}/man8/tune.exfat.*
%changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1.2.2-6
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Jul 01 2024 Pavel Reichl <preichl@redhat.com> - 1.2.2-5
- Fox High impact true positive findings
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.2.2-4
- Bump release for June 2024 mass rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Oct 30 2023 Pavel Reichl <preichl@redhat.com> - 1.2.2-2
- Convert License tag to SPDX format
* Sat Oct 28 2023 Simone Caronni <negativo17@gmail.com> - 1.2.2-1
- Update to 1.2.2.
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Mon May 22 2023 Simone Caronni <negativo17@gmail.com> - 1.2.1-1
- Update to 1.2.1.
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Oct 28 2022 Simone Caronni <negativo17@gmail.com> - 1.2.0-1
- Update to 1.2.0.
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sun Nov 21 2021 Simone Caronni <negativo17@gmail.com> - 1.1.3-1
- Update to 1.1.3.
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue May 25 2021 Simone Caronni <negativo17@gmail.com> - 1.1.2-1
- Update to 1.1.2.
* Thu Apr 22 2021 Simone Caronni <negativo17@gmail.com> - 1.1.1-1
- Update to 1.1.1.
* Tue Mar 23 2021 Simone Caronni <negativo17@gmail.com> - 1.1.0-1
- Update to 1.1.0.
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Dec 04 2020 Simone Caronni <negativo17@gmail.com> - 1.0.4-1
- Update to 1.0.4.
* Wed May 20 2020 Simone Caronni <negativo17@gmail.com> - 1.0.3-1
- Update to 1.0.3, no more shared libraries.
* Mon Apr 27 2020 Simone Caronni <negativo17@gmail.com> - 1.0.2-1
- Review fixes.
- Update to 1.0.2.
* Thu Apr 23 2020 Simone Caronni <negativo17@gmail.com> - 1.0.1-2
- Rename to exfatprogs.
- Removed provides/obsoletes on Fuse implementation.
* Wed Apr 15 2020 Simone Caronni <negativo17@gmail.com> - 1.0.1-1
- First build.

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (exfatprogs-1.2.2.tar.xz) = 51ff77860704a7a4a2986e0090514d46614d6d6ce5ad07ea622e4dd806f06f034959a0c35d7e67689a7eb6836a1de967e302d5ec1c9ca6d33fa80d68d574741e

View File

@ -0,0 +1,80 @@
#!/usr/bin/env bash
IMG=exfat.img
MKFS=mkfs.exfat
FSCK=fsck.exfat
MNT=mount
MNT_POINT=/mnt/exfattest
PASS_COUNT=0
TEST_COUNT=4
cleanup() {
umount $MNT_POINT
rm -rf $IMG
echo ""
echo "Passed ${PASS_COUNT} of ${TEST_COUNT}"
if [ ${PASS_COUNT} -ne ${TEST_COUNT} ]; then
exit 1
else
exit 0
fi
}
#Create img:
dd if=/dev/zero of=$IMG bs=1M count=200
if [ $? -ne 0 ]; then
echo "ERR: Make img failed!"
exit 1
else
echo "--- Created img file: $IMG ---"
fi
#mkfs test
echo ""
$MKFS $IMG --verbose
if [ $? -ne 0 ]; then
echo "ERR: mkfs.exfat failed!"
exit 1
else
echo "--- mkfs test done ---"
PASS_COUNT=$((PASS_COUNT + 1))
fi
#fsck test
echo ""
$FSCK $IMG --verbose
if [ $? -ne 0 ]; then
echo "ERR: fsck.exfat failed!"
exit 1
else
echo "--- fsck test done ---"
PASS_COUNT=$((PASS_COUNT + 1))
fi
#mount test
echo ""
mkdir -p $MNT_POINT
$MNT -o loop $IMG $MNT_POINT
$MNT | grep $MNT_POINT | grep exfat
if [ $? -ne 0 ]; then
echo "ERR: mount failed!"
exit 1
else
echo "--- mount test done ---"
PASS_COUNT=$((PASS_COUNT + 1))
fi
#RW test
mkdir -p $MNT_POINT/testdir
echo "This is a test" > $MNT_POINT/testdir/testfile
cat $MNT_POINT/testdir/testfile | grep "This is a test"
if [ $? -ne 0 ]; then
echo "ERR: Read or write failed!"
exit 1
else
echo "--- RW test done ---"
PASS_COUNT=$((PASS_COUNT + 1))
fi
cleanup

11
tests/tests.yml Normal file
View File

@ -0,0 +1,11 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
tests:
- simple:
dir: scripts
run: ./basic_test.sh
required_packages:
- exfatprogs

View File

@ -25,5 +25,5 @@ index 3f83588..f1a4ef2 100644
unsigned int clu, end_clu;
unsigned int cc_clu_count;
--
2.43.0
2.45.2

View File

@ -39,5 +39,5 @@ index f883556..fdb8c94 100644
goto close_fd_out;
}
--
2.43.0
2.45.2