Commit Graph

130 Commits (master)

Author SHA1 Message Date
Theodore Ts'o a2143b5160 Fix build reproducibility for mk_cmds and compile_et
The mk_cmds and compile_et scripts include the build directory, which
breaks the build reproducibility goal of Debian.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 22:25:22 -04:00
Adrien Schildknecht d4e5abfb1b libext2fs: replace 'unsigned long' by 'uintptr_t'
This is needed for win64:
    sizeof(unsigned long) != sizeof(void*)

Signed-off-by: Adrien Schildknecht <adriens@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-08-10 17:07:00 -04:00
Theodore Ts'o 478360f50b Fix Android build warnings
Also fix some additional gcc -Wall build warnings in a traditional
Linux environment.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-29 23:51:08 -04:00
Theodore Ts'o 749f07121d Add configure --disable-tdb which disables e2fsck's scratch_files feature
The scratch_files feature is not really needed except on 32-bit
platforms, since tdb's performance is pretty awful given how we are
using it.  Maybe SQLite would be faster, but for 64-bit platforms,
enabling swap works fairly well, especially using the rbtree for the
bitmap abstraction.

We leave tdb for Android since it's unlikely that someone will be
trying to connect petabyte+ sized file systems to a mobile handset.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-29 21:52:52 -04:00
Theodore Ts'o c2ff6bac50 Fix "make gcc-wall" for library code
Commit fd1677e80: "Add --enable-hardening which builds e2fsprogs with
security hardening" broken the gcc warnings mode by changing how
CFLAGS were used to build static and shared library objects.

Also shut up GCC's whining about casting the return value from
dlsym(2) to function pointers --- since due to conflicing standards,
there is no way to use dlsym() without causing gcc to whine one way or
another.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-29 17:07:17 -04:00
Theodore Ts'o 06ac2561c5 util: remove lib/support from the e2fsprogs-libs tar distribution
The lib/support library is only used for internal e2fsprogs programs,
and it won't compile correctly due to the fact that lib/ext2fs isn't
included in the e2fsprogs-libs distribution anyway.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-10 16:18:44 -04:00
Theodore Ts'o 855c5e0dfb util: add get-var script
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 16:29:19 -04:00
Damien Miller 9dd404897d gen-android-files: create the MODULE_LICENSE_GPL and README.version files
These package version metadata files will be used for automated
notification of external vulnerability reports in Android.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-15 00:45:03 -04:00
Theodore Ts'o dcb8e1fa04 Merge branch 'maint' into next 2016-03-06 20:37:49 -05:00
Andreas Dilger 7fd5374012 misc: add missing declarations on maint
Fix compile warnings for missing declarations on the maint branch.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 18:12:06 -05:00
Theodore Ts'o e5a82003d1 subst: work around an NFS bug
When running on NFS, opening files with 0444 perms for writing can
sometimes fail.  This is arguably an NFS server bug, but work around
it by creating the file with 0644 permissions, and only change the
permissions to be 0444 right before we close the file.

URL: https://bugs.gentoo.org/550986
Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-09-18 21:37:53 -04:00
Theodore Ts'o 956b0f18a5 Merge branch 'maint' into next 2015-07-22 00:18:14 -04:00
Tobias Stoeckmann 9bcfea2a89 util: avoid off-by-one on long symlinks
readlink does not nul terminate its result, therefore one extra byte
has to be taken into account.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-22 00:17:07 -04:00
Theodore Ts'o f7134a9ece Remove dropped const warning and enable pread/pwrite for Android build
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-13 10:58:33 -04:00
Theodore Ts'o cf491d3a64 Eliminate unused variable and unused label warnings from Android build
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-13 10:47:16 -04:00
Theodore Ts'o 25f291c9b3 Eliminate unused parameter warnings from Android build
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-13 09:12:23 -04:00
Theodore Ts'o f1644c324b Eliminate doubly defined _LARGEFILE_SOURCE warning
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 22:54:37 -04:00
Theodore Ts'o 99ceb8ec1a Move the check_plausibility() function from misc to lib/support
The check_plausibility() function is now used all over the place, so
we should move the plausible.c file to lib/support and remove the
special case handling for that file that had been in the build system.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 22:01:17 -04:00
Theodore Ts'o 1dc16b0b95 Move the profile parsing functions from e2fsck to lib/support
The profile functions started as something specific to e2fsck.  It's
now used by mke2fs and e2fsck, so it's better to move it into
libsupport.a.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 21:39:31 -04:00
Theodore Ts'o 1bf3f386f3 gen-android-files: implement 'Add MODULE_LICENSE and NOTICE files"
Sync up with aosp's e2fsprogs commits:

    e1b2879841453d799dc6077f857c5c9db5e83fee
    e64b83185148d359b9b6cc1310172a3c213a61fb
    b823193090c770fe79507df2413a825250b1dcd2
    9652dd6589d10675573c9a0acc90f6df5ac33397
    a5f85097aed09890d03dba31f9d18db75ce50cd7

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 18:09:14 -04:00
Theodore Ts'o 4ac4a41b8b android_config: remove HAVE_TERMIO_H
Sync up with aosp's e2fsprogs commits:

    dc351db427e667b9f954c4338f69da83fa16222b
    2ca3c65991609bb5b48004ec3c7a66f6b417beed
    4ef951aa5e69116963f1836fe5ddcf6b87afbecd

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 16:56:39 -04:00
Theodore Ts'o 9e8fcd6e01 configure: remove support to disable quota support
For the 1.43 release, quota support will be the default.  It's much
simpler if we don't try to make quota support optional.  This was done
originally because the quota feature wasn't fully tested.  It is now,
so we can remove this as an option.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-03 22:02:30 -04:00
Theodore Ts'o 149640fabc configure: remove support to disable htree support
The presence of --disable-htree is very much a legacy thing.  Remove
it since supporting the lack of htree support is pretty silly.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-03 16:29:35 -04:00
Theodore Ts'o 59a220dd9f Fix "make clean" and "make distclean"
There were some generated files that weren't getting removed by the
clean and distclean targets; fix this.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-01 19:40:23 -04:00
Theodore Ts'o beb19fce8a Allow debugfs to be built for use in Android
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-25 22:26:20 -04:00
Theodore Ts'o 2df733facd Update Android build files so the 1.43 branch builds on AOSP
Recent changes in the 1.43 branch as well as the latest AOSP caused
the Android build to break; fix them.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-25 20:25:28 -04:00
Theodore Ts'o 4fb758aa4b Clean up and fix Android build files
Add missing new lib/ext2fs source files that were added for encryption
support.  Also move configuration #define's from individual Android.mk
to the android_config.h file, since we've moved away from specifying
configuration #define's on the command-line upstream.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-30 14:50:55 -04:00
Theodore Ts'o 321f3446f3 Add files to build on Android
The Android.mk files were taken from the Android AOSP sources, and
updated for the 1.43 next branch.  The intention is that this will
allow the repository which is currently located in external/e2fsprogs
with one which is based off of the upstream e2fsprogs.  Right now
external/e2fsprogs was not created using "git clone", so it means that
git merges don't work.  After the external/e2fsprogs Android
repository is replaced, with one based off the upstream repository,
Android will be able to synchronize with the upstream repository by
pulling and merging from upstream, and then running the script
"./util/gen-android-files" to update any generated files.  (This is
necessary because in the Android build system, the Android.mk files
are rather stylized and don't make it easy to run arbitrary shell
scripts during the build phase.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2015-03-01 15:45:11 -05:00
Theodore Ts'o 8b779489ea Merge branch 'maint' into next
Conflicts:
	configure
2014-11-04 11:20:09 -05:00
Theodore Ts'o 441eb337a8 util: allow subst to build on systems that do not have utimes()
Make subst more portable so it can deal with such oler systems that do
not have utimes().  Note that it is important that subst build
correctly without an autoconf-generated config.h (since that is what
happens on a cross-compile), as well as using whatever features are
available as determined by autoconf when doing a native build.  We
currently assume the presence of utime(), but not utimes() or
futimes().

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-10-19 22:13:09 -04:00
Theodore Ts'o 50972e1f7d Merge branch 'maint' into next
Conflicts:
	debugfs/debugfs.c
	e2fsck/pass5.c
2014-07-26 09:46:50 -04:00
Theodore Ts'o d4ecec45ab libext2fs: use C99 initializers for the io_manager structure
Using C99 initializers makes the code a bit more readable, and it
avoids some gcc -Wall warnings regarding missing initializers.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-07-26 00:49:14 -04:00
Andreas Dilger 8b90ab2b1c build: fix unused/uninitialized variable warnings
Fix a few warnings about unused and uninitialized variables.

Also fix util/subst.c to include <sys/time.h> to avoid using
undeclared functions gettimeofday() and futimes().

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-07-25 22:48:01 -04:00
Theodore Ts'o 7f7d1cb462 Merge branch 'maint' into next
Conflicts:
	debugfs/set_fields.c
	tests/f_mmp/script
	tests/f_mmp_garbage/script
	tests/m_mmp/script
	tests/t_mmp_1on/script
	tests/t_mmp_2off/script
2014-07-06 00:09:27 -04:00
Theodore Ts'o e7822c1f40 fix cross-compilation support
Commit 2500ebfc89 (util: fix make dependencies for subst) broke cross
compilation because it unconditionally used config.h without setting a
includes path so that the config.h file could be found.

The proposed fix of adding the include path (such as was proposed at
http://patchwork.ozlabs.org/patch/355662/ or in Debian Bug #753375)
isn't really the right way to go, since the information in config.h is
for the target environment, and not the build environment.  So using
config.h when building helper programs used as part of the build can
potentially cause more problems than it solves.

In general, build helpers must be written to be as portable as
possible, and to not require any autoconf defined #ifdef's whenever
possible.  The subst program broke this rule to (1) address a Coverity
security complaint by using futimes(2) instad of utimes(2) if present,
and (2) to preserve the nanosecond portion of the file timestamp.

Oh, well.  We won't be able to do the latter when cross compiling, and
as to the former, if an attacker has write access to your build tree
while you are building programs that will be run as root, you've got
bigger problems.  :-)

Fix the problem that commit 2500ebfc89 was trying to address by
explicitly adding @DEFS@ to CFLAGS, so that -DHAVE_CONFIG_H is passed
to make depend.  This fixes up the make depend without forcing the use
of config.h when cross-compiling.

Addresses-Debian-Bug: #753375
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Helmut Grohne <helmut@subdivi.de>
Cc: 753375@bugs.debian.org
2014-07-05 20:49:52 -04:00
Darrick J. Wong a46300fe70 misc: create better-packaged static analysis reports
Fix some minor bugs relating to passing CFLAGS to cppcheck, and
package the cppcheck output into nicer looking reports.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-11 18:32:07 -04:00
Darrick J. Wong 8a6cc1aebd misc: fix header complaints and resource leaks in e2fsprogs
Fix a few minor bugs that cppcheck complained about.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-03-14 09:53:19 -04:00
Darrick J. Wong 24997f1cd2 misc: cppcheck cleanups
Fix a number of things that cppcheck complains about.  Most of these
are minor resource leaks and forgotten declarations.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-03-14 09:34:11 -04:00
Darrick J. Wong f1605243a4 all: Introduce cppcheck static checking for make C=1
Introduce more static checking via cppcheck.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-03-14 09:32:50 -04:00
Theodore Ts'o fedfb27fe5 Add coverage testing using gcov
To check the coverage of e2fsprogs's regression test, do the
following:

	configure --enable-gcov
	make -j8 ; make -j8 check ; make coverage.txt

The coverage information will be the coverage.txt and *.gcov files in
the build directories.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-02-23 00:17:09 -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 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 de3088402b gen-tarball: ignore all of the build* directories
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-28 15:57:29 -05:00
Theodore Ts'o f404167dda Clean up sparse warnings
Mostly by adding static and removing excess extern qualifiers.  Also
convert a few remaining non-ANSI function declarations to ANSI.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-16 18:56:36 -05:00
Eric Sandeen f5589f4c18 mke2fs: remove quota docs if not configured in
If quota isn't turned on with --enable-quota, then comment
quota documentation out of the mke2fs manpage.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-10-14 08:57:17 -04:00
Darrick J. Wong 832cb612f8 e2fsprogs: add (optional) sparse checking to the build
Run sparse against source files when building e2fsprogs with 'make C=1'.  If
instead C=2, it configures basic ext2 types for bitwise checking with sparse,
which can help find the (many many) spots where conversion errors are
(possibly) happening.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-10-11 23:12:40 -04:00
Mike Frysinger 993c455552 util: respect HAVE_MALLOC_H
Most places respect this define, but this one doesn't.

Reported-by: Dmitri Bogomolov <4glitch@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-08-19 17:57:17 -04:00
Theodore Ts'o 183c73b026 Teach build system to install relative symlinks if requested
Add a configure option, --enable-relative-symlinks, which will use
relative symlinks for the ELF shared library files.

Addresses-Sourceforge-Bug: #3520767

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-12 23:34:33 -04:00
Theodore Ts'o 564826e284 util: add build.profiled to list of files/directories to ignore
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-02-17 15:28:12 -05:00
Theodore Ts'o d1154eb460 Shorten compile commands run by the build system
The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and
this was starting to cause some tools heartburn.  It also made "make
V=1" almost useless, since trying to following the individual commands
run by make was lost in the noise of all of the defines.

So fix this by putting the configure-generated defines in lib/config.h
and the directory pathnames to lib/dirpaths.h.

In addition, clean up some vestigal defines in configure.in and in the
Makefiles to further shorten the cc command lines.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-18 17:34:37 -04:00