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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
in add_subst(), if the malloc of ent->name fails, we goto fail;
which will free ent->name (which is null, so OK) but also free
ent->value (which is uninitialized). There is no case where
we must free ent->value on an error (it is allocated last, and
if it fails it of course doesn't need to be freed) so just
remove it.
Also "retval" is only assigned once to the constant ENOMEM,
so we can just return that explicitly in the failure case.
Signed-off-by: Eric Saneeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Some people don't want to see the concise "kernel-style" make output.
This configure option allows build engines that want to see the full
set of commands executed by the makefile to get what they want. Most
people will find this more distracting than useful, unless they need
to debug the Makefiles.
(It is not necessary to rerun configure to enable this verbose make
output temprarily; if a developer wants to do a quick debug of a
directory's makefile, he or she can simply edit the definition of the
$(E) and $(Q) variables in the Makefile; instructions can be found in
the MCONFIG file which is included in at the beginning of every
Makefile.)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
gen-tarball currently assumes that the top-level directory is called
e2fsprogs, which breaks building the tarball if it's named differently.
Since we have already computed the basename, let's use it.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Documentation about UUID's is available in enough places, and it's
awkward to deal with debian-legal's insanities. So I'm caving in the
"more-lunatic-than-RMS" wing of Debian by removing RFC-4122 so we don't
have do the dfsg tarball. Also remove the rule that only tried to
install RFC-4122 on Ubuntu, since Ubuntu seems to want to fetch
e2fsprogs exclusively from Debian.
Addresses Debian Bug: #407107
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Need to close old_f before returning since it had been successfully opened
before.
Coverity ID: 19: Resource Leak
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Fixed version number generation so that the same common
algorithm is used for Debian and RPM version numbering schemes.
This allows the RPM spec file to do the right thing for WIP releases.
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Autoconf versions before 2.60 don't have datarootdir defined, and so this
resulted in a @datarootdir@ --> @datarootdir@ infinite expansion.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Remove I-D because of DFSG license Nazi's.
Make e2fsck and uuid-dev have its own /usr/share/doc directories, and make
the e2fsck-static package not depend on the e2fsprogs package.
Addresses Debian Bug: #383521
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Use BUILD_CCFLAGS and BUILD_LDFLAGS instead of CCFLAGS and LDFLAGS in
the build system when building files in the util directory which are
needed during the build process. This avoids potential problems when
cross-compiling some of the options are not recognized as valid by the
host compiler. (Addresses Sourceforge Bug #1261547)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Since e2fsprogs is now being managed by Mercurial instead of BK,
remove BitKeeper and add ".hg", ".hgignore", ".pc", and "patches" to
the list of files/directories not included in the tar file.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>