Commit Graph

4577 Commits (203e13cf9cf0754efd1e322885b2099fa43cb3fa)

Author SHA1 Message Date
Theodore Ts'o 0d719bad86 libblkid: add error checking for rename() while saving the blkid cache
Addresses-Coverity-Id: #1049141

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-10 22:09:45 -05:00
Theodore Ts'o a8307ab8cc libblkid: fix integer width issue in probe_fat
Addresses-Coverity-Id: #1049162

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-10 21:56:29 -05:00
Theodore Ts'o 6e85adde78 libblkid: remove unneeded pointer checks
Addresses-Coverity-Id: #207522
Addresses-Coverity-Id: #207523

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-10 21:53:08 -05:00
Theodore Ts'o 6596c997f3 blkid: fix gcc -Wall nits
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-10 21:40:28 -05:00
Theodore Ts'o 250bf9a703 mke2fs, tune2fs: remove unneeded access() call
Addresses-Coverity-Id: #709536
Addresses-Coverity-Id: #709535

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-10 21:39:27 -05:00
Theodore Ts'o b7ef62b295 libss: fix potential null dereference if realloc() fails
Addresses-Coverity-Id: #1153630

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-10 21:13:15 -05:00
Theodore Ts'o f7d7905976 libuuid: add error checking to syscalls in get_clock()
Also remove redundant close() of state_fd, since the fclose() of
state_f will result in the fd being closed.

Addresses-Coverity-Id: #1049146
Addresses-Coverity-Id: #26092

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-10 21:06:07 -05:00
Theodore Ts'o 2500ebfc89 util: fix make dependencies for subst
Now that subst is using config.h, we need to fix its dependencies so
that if config.h is missing (i.e., after a "make clean" in the tree)
that it is rebuilt by the Makefile rule.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-09 23:26:08 -05:00
Theodore Ts'o 253a96500a Save and restore umask around calls to mkstemp()
The races would be hard to exploit, but let's close them off.

Addresses-Coverity-Id: #709504
Addresses-Coverity-Id: #709505
Addresses-Coverity-Id: #709506

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-09 15:18:44 -05:00
Theodore Ts'o e114288010 libuuid: check return value of uuid_parse() in test
Addresses-Coverity-Id: #709477

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-09 15:06:50 -05:00
Theodore Ts'o 46802efa15 blkid: add fallthrough comment
Addresses-Coverity-Id: #709484

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-09 15:03:40 -05:00
Theodore Ts'o d1da14b5b0 libblkid: clean up some integer promotion / signed issues
Addresses-Coverity-Id: #1049165
Addresses-Coverity-Id: #1049164
Addresses-Coverity-Id: #1049163
Addresses-Coverity-Id: #1049162
Addresses-Coverity-Id: #709508
Addresses-Coverity-Id: #709507
2014-01-09 14:56:54 -05:00
Theodore Ts'o 40ca5c4768 debugfs: fix typo in commit 5a1d25a7b
The typo causes a compiler warning, but it's otherwise harmless.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-09 14:30:43 -05:00
Theodore Ts'o 5a1d25a7b2 Fix up workarounds for dietlibc breakage
The dietlibc doesn't support the TZ environment variable, which is
required by the standard.  Work around this so that we can run the
regression test suite when building with dietlibc.  (This is useful
for finding problems.)

With this change, the only thing which doesn't work as far as dietlibc
is concerned is the posix_memalign test, and the MMP support tests
(because posix_memalign isn't provided by dietlibc, sigh.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-09 12:22:03 -05:00
Theodore Ts'o 1fc70c168c libss: fix memory leak if realloc() fails in ss_parse()
Addresses-Coverity-Id: #709491

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-08 19:46:05 -05:00
Theodore Ts'o 56087556e1 badblocks: print warning if set_o_direct() fails
Addresses-Coverity-Id: #1049148

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-08 19:46:05 -05:00
Theodore Ts'o b220a336d5 debugfs: remove dead code
Addresses-Coverity-Id: #1138573

Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-08 19:45:55 -05:00
Theodore Ts'o 1fb1a498ff libext2fs: fix memory leaks on error paths in ext2fs_create_icount_tdb
Addresses-Coverity-Id: #1138575

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-07 09:49:10 -05:00
Theodore Ts'o fa8b1c0281 libquota: add error checking to quota_remove_inode
Addresses-Coverity-Id: #709475

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-07 09:10:24 -05:00
Theodore Ts'o 3f10707d90 libquota: add error checking to quota_write_inode()
Addresses-Coverity-Id: #709476

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-07 09:10:24 -05:00
Theodore Ts'o 2641bf8991 libext2fs: remove redundant code in rb_print_stats()
Addresses-Coverity-Id: #709550

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-07 09:10:24 -05:00
Theodore Ts'o 2c98ce4b56 e2fsck: fix memory leak on error path in read_bad_blocks_files()
Addresses-Coverity-Id: #1049170

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-07 09:10:24 -05:00
Theodore Ts'o d887b93701 libext2fs: make ext2fs_group_desc_csum return 0 if meta_csum not enabled
Addresses-Coverity-Id: #1147784

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-07 09:10:24 -05:00
Theodore Ts'o 125f76e73b e2fsck: release allocated memory on error or abort in e2fsck_pass1()
Addresses-Coverity-Id: #1148450

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-07 09:10:19 -05:00
Theodore Ts'o 1d1f708e44 libss: fix potential memory leak on realloc() failure
Commit 191a03ac5f was an incorrect fix for this issue.  Fix it up.

Addresses-Coverity-ID: #295143
Addresses-Coverity-ID: #1148451

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-06 22:54:12 -05:00
Theodore Ts'o 340493b6bc e2fsck: add error checking when moving the quota inode
Addresses-Coverity-Bug: #1049140

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-05 22:58:16 -05:00
Theodore Ts'o 5d5576d8bb libblkid: fix memory overrun in probe_lvm2
Addresses-Coverity-ID: #1049167

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-05 22:58:16 -05:00
Theodore Ts'o c2c69597ab test_extents: fix a possible memory leak
Addresses-Coverity-Bug: #1049185

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-05 22:58:16 -05:00
Theodore Ts'o ece2d5884b libext2fs: fix potential memory leak in qcow2_write_raw_image()
Addresses-Coverity-ID: #1049179
Addresses-Coverity-ID: #1049180

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-05 22:58:16 -05:00
Theodore Ts'o 191a03ac5f libss: fix potential memory leak on realloc() failure
Addresses-Coverity-ID: #295143

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-05 22:58:16 -05:00
Theodore Ts'o ee781cff92 debian: renable use of internal uuid and blkid libraries for e2fsck.static
Now that the diet libc support is working again, we need to use the
internal uuid and blkid library in order for e2fsck.static to be
compiled properly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-05 22:58:16 -05:00
Theodore Ts'o 795c02def3 Use consistent e2fsprogs-standard types
Some different types such as u_int16_t and __uint32_t have snuck into
e2fsprogs.  These types are not guaranteed by any standard, and they
are not provided by dietlibc.  Convert them to __u16, __u32,
etc. since these are guaranteed to be provided by e2fsprogs' build.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-05 22:58:16 -05:00
Theodore Ts'o 6c59a665da configure: fix --with-diet-libc
Newer versions of autoconf pull in AC_PROG_GCC as part of
AC_CANONICAL_HOST.  So we need check for WITH_DIET_LIBC earlier in
configure.in.

Also, e2fsprogs now needs functions which are found in diet libc's
compat library.  So add support for autoconf's LIBS function, and
automatically set libs to include -lcompat.

Finally, disable compiling e4defrag by deault if --with-diet-libc is
specified because the program has too many glibc dependencies.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-05 22:58:16 -05:00
Baruch Siach 9a39389185 e4defrag: choose the best available posix_fadvise variant
Use posix_fadvise64() when available.  This allows 64bit offsets on
32bit systems.

[ Modified by tytso to try to use fadvise64() as well, and to remove
  the attempt to call the syscall directly, since because and
  complexities caused by required dummy arguments on some
  architectures, it's not worth the hair.  ]

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-01-05 22:55:10 -05:00
Theodore Ts'o 603fc2cb4b e2fsck: fix possible double free when searching for config file
This happens if there is an error while scanning a directory for
config file fragments.  This is rarely used, which is why we didn't
notice this.

Addresses-Coverity-Bug: #1138576

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-04 19:11:37 -05:00
Theodore Ts'o b34b94d5cd debugfs: clean up read_journal_block() to avoid Coverity complaint
The read_journal_block() function was needlessly complicated, which
made it harder to read/maintain, and it also tripped up Coverity.
Cleaning it up also avoided some signed/unsigned casts, and allows us
to avoid passing got back to the caller, since it wasn't needed.

Addresses-Coverity-Bug: #709539

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-04 19:11:37 -05:00
Theodore Ts'o 2873927d15 subst: clean up various coverity nits
Add appropriate error checking for all error returns, and only open
each file that we need to manipulate once, to avoid potential
time-of-check/time-of-use races.  (Not that this is likely for this
program, but the result is much more clean.)

We also preserve the atime in the case where the file has not changed.

Addresses-Coverty-Id: #709537
Addresses-Coverty-Id: #1049150
Addresses-Coverty-Id: #1049151

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-04 19:11:37 -05:00
Theodore Ts'o 75954ccf2a libblkid: fix sizeof(foo) vs sizeof(*foo) malloc() bug
Addresses-Coverity-Bug: #709510

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
2014-01-04 19:11:37 -05:00
Theodore Ts'o fa24c8faa1 e2image: avoid potential divide by zero
It's highly unlikely after five seconds that zero blocks would have
been written, but let's silence the Coverity warning.

Addresses-Coverity-ID: 1147780

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
2014-01-04 19:11:37 -05:00
Theodore Ts'o 781c0df508 e2image: eliminate division by zero
Dividing a floating point number by zero is undefined in C.  It
happens to work with gcc/glibc, but it's not something that's
guaranteed.

Addresses-Coverity-ID: #1147781

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
2014-01-04 19:11:37 -05:00
Theodore Ts'o e9b5923544 e2image: fix resource leak when running e2image -n
Addresses-Coverity-ID: #1147783

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
2014-01-04 19:11:37 -05:00
jon ernst e38bfbe912 e2image: mark strings for internationalization
Signed-off-by: Jon Ernst <jonernst07@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-01-04 19:11:36 -05:00
Theodore Ts'o 4f06566b78 e2fsck.conf: clarify man page's description of accept_time_fudge
Addresses-Debian-Bug: #719189

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-04 19:11:36 -05:00
Theodore Ts'o c32409aec6 e2fsck: improve the "superblock corrupt" message
Previously, this message used 8193 as the example alternate
superblock.  But for most file systems, the backup superblock is
located at 32768 (since most file systems have a block size of 4k, and
not 1k).

Addresses-Debian-Bug: #719185

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-04 19:11:30 -05:00
Theodore Ts'o 5c4c38763c mke2fs: use [^]feature instead of just feature in the man page
Addresses-Debian-Bug: #719184

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-31 22:53:52 -05:00
Theodore Ts'o a7da1af701 debian: add mention of the badblocks program in the package description
Addresses-Debian-Bug: #718725

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-31 22:34:52 -05:00
Theodore Ts'o 88ee023be2 mke2fs: add support to create the file system at an offset
This can be useful when creating a disk image for virtual machines.

Addresses-Debian-Bug: #497984

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-30 23:03:09 -05:00
Theodore Ts'o 4bd63b215f update config.h.in file to enable loopback mount detection
Commit fbabd5c44c added loopback mount detection.  However, we
failed to update the config.h file, so the code wasn't actually
enabled.  Fix this oversight.

Addresses-Debian-Bug: #497984

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-30 22:41:48 -05:00
Theodore Ts'o 091e984ee6 debian: update changelog for 1.42.9-2 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-30 17:40:31 -05:00
Theodore Ts'o efeda9d529 debian: rationalize configure options management
As part of the debian build, the e2fsprogs sources are built multiple
times --- for the udeb packages, for e2fsck.static, etc.  Make sure
that when we disable the use of the built-in blkid and uuid libraries
(in favor of the ones shipped with util-linux), that we do so for all
of the builds.

Previously we were using the internal blkid library for e2fsck.static.
While this isn't completely broken, the internal blkid library hasn't
been maintained in quite some time, so it's better to use the
util-linux blkid library instead.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-30 17:38:45 -05:00