Commit Graph

6766 Commits

Author SHA1 Message Date
Theodore Ts'o
10f9b11b76 badblocks: add error checking for command-line arguments for -b and -c
Also remove a dead assignment (the value of try is overwritten after
the continue statement).

Addresses-Coverity-Bug: 1297515
Addresses-Coverity-Bug: 1464573
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12 11:53:23 -05:00
Theodore Ts'o
46fcf7087b ext2_fs.h: use the ext2fs_has_feature_64bits() instead of open coded check
This makes the code a bit cleaner and fixes a false positive warning by
Coverity.  (CID #1464576)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12 00:10:06 -05:00
Theodore Ts'o
ea41284998 e2fsck: add error checking for ext2fs_extent_get_info()
This function can't actually fail today, but in the future it could
return an error, so it's better to add the appropriate error check.

Addresses-Coverity-Bug: #1464579
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-11 23:47:32 -05:00
Theodore Ts'o
33b9a60c36 Fix clang warnings on architectures with a 64-bit long
On most systems where we compile e2fsprogs, the u64 type is an
unsigned long long.  However, there are platforms (such as the
PowerPC) where a long 64-bits and so u64 is typedef'ed to be unsigned
long instead of a unsigned long long.  Fix this by using explicit
casts in printf statements.  For scanf calls, we need to receive the
value into a unsigned long long, and then assign it to a u64, after
doing range checks.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-11 10:55:21 -05:00
Theodore Ts'o
fb874e6ff4 mke2fs: fix resource leak on error path when creating inodes
Addresses-Coverity-Bug: 1472856
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-11 10:45:13 -05:00
Theodore Ts'o
b79f56ce5d tests: fix environmental dependency in m_rootdir_acl
The test script had a dependency on the group id for the "adm" group
being 4.  Fixed by hard-coding the group id for the default acl for
the acl_dir directory.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-10 11:12:49 -05:00
Theodore Ts'o
df0fe7c9a3 Update release notes, etc., for the 1.46.1 release
(Also update some inaccuracies in the 1.46.0 release.)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 18:36:32 -05:00
Yuri Chornoivan
d50ffa90a4 po: update uk.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Göran Uddeborg
66b6b4869b po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Pedro Albuquerque
4a9730000f po: update pt.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Jakub Bogusz
1f1b285c2c po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Sharuzzaman Ahmat Raslan
1d4a6b2a1e po: update ms.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Samuel Thibault
a9c317cc50 po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Petr Pisar
77e1dd3fc0 po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Theodore Ts'o
67e6ae0a35 mke2fs: fix a importing a directory with an ACL and inline data
If an inode which is copied into a file system using "mke2fs -d" has
an ACL (or extended attributes) and it is also using inline data, when
the extended attribute(s) are copied in, the inline data gets dropped due to a missing call to ext2fs_xattrs_read().

Addresses-Debian-Bug: #971014
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:11:23 -05:00
Theodore Ts'o
b637c57d12 debian: add build profiles noudeb and pkg.e2fsprogs.no-static
Addresses-Debian-Bug: #966686
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 15:56:12 -05:00
Theodore Ts'o
8c9e2921ec configure.ac: convert all help strings to use AS_HELP_STRING
Some help strings were using the deprecated AC_HELP_STRING, and others
were completely hard-coded.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 15:54:12 -05:00
Theodore Ts'o
319b6c4f1c Provide and use sort_r() instead of qsort_r() for portability reasons
The qsort_r() function is specific to glibc.  It is not present in the
musl C library.  Worse, FreeBSD supports qsort_r, but with an
incompatible interface.  So use sort_r() from commit c8c65c1e183d
from the git repository: https://github.com/noporpoise/sort_r

https://github.com/tytso/e2fsprogs/issues/58

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 15:27:51 -05:00
Harshad Shirwadkar
4e95b37230 e2fsck: endianness fixes for fast commit replay
There are a few places where the endianness conversion wasn't done
right. This patch fixes that. Verified that after this patch,
j_recover_fast_commit passes on big endian qemu VM.

root@debian-powerpc:~/e2fsprogs/tests# make j_recover_fast_commit
j_recover_fast_commit: : ok

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-08 23:36:48 -05:00
Harshad Shirwadkar
2fae964a0e ext2fs: initialize handle to NULL in ext2fs_count_blks
Initialize the handle to NULL to ensure that in error cases,
ext2fs_free_mem can be called on it.

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-08 23:36:21 -05:00
Andreas Dilger
f15b1aaf8f e2fsck: fix check of directories over 4GB
If directories grow larger than 4GB in size with the large_dir
feature, e2fsck will consider them to be corrupted and clear
the high bits of the size.

Since it isn't very common to have directories this large, and
unlike sparse files that don't have ill effects if the size is
too large, an too-large directory will have all of the sparse
blocks filled in by e2fsck, so huge directories should still
be viewed with suspicion.  Check for consistency between two of
the three among block count, inode size, and superblock large_dir
flag before deciding whether the directory inode should be fixed
or cleared, or if large_dir should be set in the superblock.

Update the f_recnect_bad test case to match new output.

Fixes: 49f28a06b7 ("e2fsck: allow to check >2GB sized directory")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Lustre-bug-id: https://jira.whamcloud.com/browse/LU-14345
Change-Id: I1b898cdab95d239ba1a7b37eb96255acadce7057
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-08 22:40:42 -05:00
Theodore Ts'o
d9844883a1 libext2fs: fix more compiler warnings
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-07 23:27:56 -05:00
Theodore Ts'o
9f4e9fbbe2 libext2fs: fix segault when setting an xattr with an unknown prefix
Also avoid unnecessary calls to find_ea_index() by caching the short
name and name index in the ext2_attr structure.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-07 23:21:58 -05:00
Andreas Dilger
f41c7da2e4 misc: fix minor llvm warnings
Fix a couple minor type mismatch warnings.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-07 20:30:21 -05:00
Theodore Ts'o
ee2ee8343e debian: drop transitional packages
We renamed the libcomerr2, e2fslibs, and e2fslibs-dev packages to
match Debian package naming convetions in Debian 10 (Buster).  Now
that Debian 11 (Bullseye) is about to be released, we no longer need
the transitional packages.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 23:35:38 -05:00
Theodore Ts'o
24487a7fa6 configure.ac: fix build failure on systems with pthreads && !fuse support
The configure script checks for pthread.h as part of double-checking
that the FUSE support works correctly, which implicitly defined
HAVE_PHREAD_H.  If the FUSE libraries are not present (or fuse support
is explicitly disabled), this check doesn't happen and so
HAVE_PTHREAD_H is not defined, and this causes a build failure.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 22:28:31 -05:00
Theodore Ts'o
2b0d66bbec Update release notes, etc., for the 1.46.0 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 17:02:31 -05:00
Theodore Ts'o
30d07316e5 Update makefile dependencies
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 17:00:06 -05:00
Theodore Ts'o
2eebc9949c Update debian/libext2fs2.symbols with the additions to the shared library
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 01:56:41 -05:00
Theodore Ts'o
e678ab3970 Merge branch 'maint' into next 2021-01-29 01:13:18 -05:00
Theodore Ts'o
35b67cab5c e2fsck: drop use of sysctl(2)
Remove the use of the binary interface using the sysctl(2) system call
since sys/sysctl.h has been deprecated.  We can find the total memory
available in the system using the POSIX standard sysconf(2) interface.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 01:10:29 -05:00
Theodore Ts'o
3fb16e7424 configure.ac: add substitution for @mkdir_p@ since po/Makefile.in.in uses it
Fixes: e598c29b4d ("Update gettext files to version 0.19.8")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 01:10:18 -05:00
Theodore Ts'o
fa86b5c2aa Update release notes, etc., for the 1.45.7 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 00:51:02 -05:00
Мирослав Николић
37226f12ba po: update sr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28 14:27:00 -05:00
Benno Schulenberg
43d9f902b8 po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28 14:27:00 -05:00
Sharuzzaman Ahmat Raslan
d863dafb60 po: update ms.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28 14:27:00 -05:00
Theodore Ts'o
5162872480 misc: fix a spelling nit in the mke2fs man page
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28 14:21:09 -05:00
Theodore Ts'o
7f69ca1757 Update Makefile dependencies for lib/e2p and lib/ext2fs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28 01:31:21 -05:00
Theodore Ts'o
6be3ce7a54 Merge branch 'maint' into next 2021-01-28 00:52:22 -05:00
Jiyong Park
e1af9546e6 AOSP: Add assemble_cvd to com.android.virt
assemble_cvd directly or indirectly depends on these modules. To add
assemble_cvd to the com.anroid.virt APEX, these modules are marked as
being available to the APEX.

Google-Bug-Id: 174639526
Test: m com.android.virt
Change-Id: Ibc28d24abd358fb1f8608b3f3d6d06c2746f2d72
From AOSP commit: e70718ecae3cf1e2a26af800734130e003186e7e
2021-01-28 00:05:08 -05:00
Yifan Hong
643ee34074 AOSP: tune2fs/resize2fs: make vendor_ramdisk_available.
The vendor_ramdisk variant is dynamic, unlike the ramdisk variant.

Test: builds
Google-Bug-Id: 173425293
Change-Id: I45547b5ea99aae98727121c038129844b7930ed6
From AOSP commit: 073ede3200afeffd82889cb61a71fa1947314476
2021-01-28 00:04:14 -05:00
David Anderson
851d899646 AOSP: Make libext2_uuid and e2fsprogs headers vendor_ramdisk_available.
This is needed to build snapuserd into the vendor ramdisk.

Google-Bug-Id: 173463595
Test: snapuserd builds
Change-Id: I05d85357ebf47abd0d82e9c6211e854bdf0d5ae9
From AOSP commit: b28c0ef21cf8ebd172a07cfd09551af38366a5a7
2021-01-28 00:01:54 -05:00
Justin Yun
d89e06515b AOSP: Add "product_available" to product available modules
"vendor_available" modules were available to product modules.
However, not all "vendor_available" modules are required to be
available to product modules. Some modules want to be available only
to product modules but not vendor modules.

To cover the requirement, we separate "product_available" from
"vendor_available".
"vendor_available" will not provide product available module.

Google-Bug-Id: 150902910
Test: build
Change-Id: I316da0d24bde8b6231114aa80841c59547691152
From AOSP commit: df51b0de40581f52c6515f8775ecd84dc4a50bb0
2021-01-27 23:59:58 -05:00
Daniel Rosenberg
61421ee588 AOSP: ANDROID: e2fsck: Handle casefolded encryption
Adds support for EXT2_HASH_SIPHASH, and reading the hash from disk in
that case. We cannot compute the siphash without the key, so we must
not modify the names of any encrypted and casefolded directories,
which limits some recovery options, and we must assume the hashes
stored in dirents are correct.
This is in preparation for upcoming kernel support for encryption and
casefolding at the same time.

Google-Bug-Id: 138322712
Test: Create fs with casefold and encryption enabled via mke2fs and
      tune2fs, run fsck after creating casefolded + encrypted folder

Change-Id: Icca32d7d9dd3c7f52da03d60e4d89273cbec0a7d
From AOSP commit: 67eae926bdac1a54dbb8335731c5e1581f93e4bb
2021-01-27 23:53:36 -05:00
Daniel Rosenberg
b22c36e60c AOSP: ANDROID: mke2fs: Support encrypt+casefold
In preparation for upcoming kernel changes that will make the kernel
support both encryption and casefolding at the same time, allow mke2fs
to enable both features at the same time.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Google-Bug-Id: 138322712
Test: Create fs with casefold and encryption enabled via mke2fs
Change-Id: I4e2350e43e21cffb3d972310cd74df1e662bf87e
From AOSP commit: f8fc427df385260f3424e1e9d5485c8640606920
2021-01-27 23:48:46 -05:00
Daniel Rosenberg
23fc0e6e46 AOSP: ANDROID: tune2fs: Support encrypt+casefold
In preparation for upcoming kernel changes that will make the kernel
support both encryption and casefolding at the same time, allow tune2fs
to enable both features at the same time.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Google-Bug-Id: 138322712
Test: Create fs with casefold and encryption enabled via tune2fs

Change-Id: I36537a8b6dc5e2997b7016212f9b574c76673067
From AOSP commit: 44ac9dccd9853cc9807f0d6ce952bdcdeb93954a
2021-01-27 23:46:39 -05:00
Daniel Rosenberg
79661036b4 AOSP: ANDROID: e2fsck: Do not mutate encrypted names
We can't mutate a name without the key, as this will at best cause the
name to become gibberish, and at worst may introduce invalid characters
or even fail to be unique after decoding, so drop duplicates instead.
Files lost in this way will be reconnected to lost+found

Fixes: dbff534ec6 ("e2fsck: suppress bad name checks for encrypted directories")
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Google-Bug-Id: 138322712
Test: f_dup_de_crypt
Change-Id: I8d6cc3984872868a845fafabc554abdd86351fcc
From AOSP commit: 80b85f8a0b2ba7090a927f692ff9d2097ffd8d1f
2021-01-27 23:35:15 -05:00
Daniel Rosenberg
b437e1ed5f AOSP: ANDROID: tune2fs: Allow setting the casefold feature
This allows tune2fs to enable casefolding on an existing filesystem.
At the moment, casefolding is incompatible with encryption.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Google-Bug-Id: 138322712
Test: Create fs without casefold and enable it via tune2fs
Change-Id: Ic9ed63180ef28c36e083cee85ade432e4bfcc654
From AOSP commit: eb5b168decac07058e90ead191350be80c75aff4
2021-01-27 23:35:09 -05:00
Howard Chen
0ea0a9e790 AOSP: Make e2fsck depends on badblocks
The e2fsck may invoke the badblocks when -c is specified.
Also the badblocks is required by Mediatek devices. Add it for
completeness.

Test: compile wembley-userdebug
Google-Bug-Id: 157393160

Change-Id: I1163129c925e93ef386e86a60c93e9c314397134
From AOSP commit: dffec44dd56175b80810657f95f8e09a7e3ab0bf
2021-01-27 23:34:30 -05:00
Gabriel Krisman Bertazi
3304da1696 tests: test case-folding checks in e2fsck
Add the test f_bad_fname which test fixes of invalid filenames and
duplicates.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27 23:09:49 -05:00