Commit Graph

154 Commits (2df733facd99261a4c462f76f72e143e803487d0)

Author SHA1 Message Date
Theodore Ts'o ad5d05d645 Merge branch 'maint' into next 2015-02-16 10:17:21 -05:00
Enrico Scholz 1ceb8093dc buildsystem: use 'chmod a-w' instead of 'chmod -w'
'chmod -w' is not portable and can break the build:

| chmod: chmod: ss_err.h: new permissions are r--rw-r--, not r--r--r--
| ss_err.h: new permissions are r--rw-r--, not r--r--r--
| chmod: ss_err.c: new permissions are r--rw-r--, not r--r--r--
| make[2]: *** [ss_err.h] Error 1

This happens because 'chmod -w' is affected by umask. Issue can be
reproduced e.g. by

$ mkdir /tmp/foo
$ setfacl -m dⓂ️rwx /tmp/foo

$ umask 022
$ touch /tmp/foo/x
$ chmod -w /tmp/foo/x
chmod: /tmp/foo/x: new permissions are r--rw-r--, not r--r--r--

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-01-23 12:05:19 -05:00
Theodore Ts'o 330cebc0e9 Merge branch 'maint' into next
Conflicts:
	debugfs/debugfs.c
	e2fsck/Makefile.in
	lib/ext2fs/Makefile.in
	tests/test_config
2014-09-11 12:40:43 -04:00
Michael Forney 53904ae543 Apply LDFLAGS when building tests
Signed-off-by: Michael Forney <forney@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-08 19:00:24 -04:00
Michael Forney 60abcd7394 tests: Add to LD_LIBRARY_PATH instead of overriding
Signed-off-by: Michael Forney <forney@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-08 18:55:42 -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
Eric Sandeen 2f8d025196 e2fsprogs: remove checker infrastructure
Per http://www.gnu.org/software/checker/ the gcc "-checker" option
is long deprecated.  Nuke it from e2fsprogs.

Most people would never hit this, but people who love to turn knobs,
such as the reporter of kernel.org bz#74171, might run into it and be
sad.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-07-04 23:59:30 -04:00
Theodore Ts'o 9361395106 aclocal.m4: update to newer versions of autoconf macros
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-07-04 23:49:23 -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
Theodore Ts'o c9bc7484cc Merge branch 'maint' into next
Conflicts:
	e2fsck/pass1.c
2014-05-11 18:30:11 -04:00
David Michael 4e2d9f7f4e Add a make variable for the pkgconfig install dir
Adding the pkgconfigdir variable allows specifying an installation
location for pkg-config files independent of libdir.

Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-07 10:51:50 -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 9b36ce0e19 libss: fix potential buffer overrun in list_rqs
Addresses-Coverity-Bug: #709516

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-30 18:25:15 -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 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 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 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 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
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
Darrick J. Wong e46c187aa6 libss: fix memory handling errors
Fix memory allocation calculations and check for NULL pointer returns.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-12 13:12:11 -05:00
Darrick J. Wong dc9da630d6 libss: fix fd error handling
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-12 13:11:07 -05: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
Theodore Ts'o 1ad3174af5 Try to use secure_getenv() in preference to __secure_getenv()
If secure_getenv() use it in preference to __secure_getenv().
Starting with (e)glibc version 2.17, secure_getenv() exists, while
__secure_getenv() only works with shared library links (where it is a
weak symbol), but not for static links with /lib/libc.a

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-06-16 14:34:59 -04:00
Theodore Ts'o d5aa6a82b3 Put ELF_OTHER_LIBS in the right place for the linker
Commit a7c17431b9 attempted to fix a problem where the system
libraries might get used instead of local libraries for things like
-lcom_err.  It tried to accomplish this by moving $(ELF_OTHER_LIBS) to
before $(LDFLAGS).

Unfortunately, this was the wrong fix; $(ELF_OTHER_LIBS) *MUST* be
after the object files, or the linker might not pull in the necessary
library and not include it into the DT_NEEDED section of the shared
library.  The proper fix is to add a -L$(LIB) before $(LDFLAGS), and
then remove the -L option from all of the ELF_OTHER_LIBS definitions
in the library Makefiles.

Addresses-Sourceforge-Bug: #3554345

Cc: Olivier Blin <olivier.blin@softathome.com>
Reported-by:  Mike Frysinger <vapier@gentoo.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-08-06 12:30:49 -04:00
Theodore Ts'o ae06582867 Change pkg-config files so that both <et/com_err.h> and <com_err.h> work
Change the include path in the Cflags field so that #include
<lib/foo.h> and <foo.h> will work.  We had originally used a C flags
which allowed <foo.h> to work, but many applications (especially those
not using pkg-config) had been using the <lob/foo.h> formulation which
didn't require an explicit -I{$includedir} option to the C compiler.

If those applications then converted over to pkg-config, and the
e2fsprogs libraries were installed with a prefix other than /usr, so
that the header files were in some directory such as
/usr/local/include, a program that used #include <lib/foo.h> would
fail to compile.

So change the pkg-config files to include both -I{$includedir} and
-I{$includir}/lib.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-14 12:45:54 -04:00
Theodore Ts'o 8a1da3c5ae debugfs: use ss_safe_getenv() instead of getenv()
In the case where debugfs (or rdebugfs) is installed setgid disk, or
some such, we need to disable the use of environment variables for the
obvious reasons.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-02-15 16:18:29 -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
Theodore Ts'o 822c10e84e libcom_err: Only output ^M when tty is in raw mode
This fixes a long-standing botch in the com_err library, and solves a
regression test problem for libss that gets tickled by source code
management systems (like Perforce) that don't preserve CRLF line
endings with fidelity.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-15 07:48:25 -04:00
Eric Sandeen 4e79a19fe0 libss: add newer libreadline to dlopen path
Rawhide now has libreadline.so.6 ... add it to the ever-expanding
list of libs to look for.

Unfortunately without commit 06ef971be5
this fails in a rather cryptic way.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-02-05 22:50:10 -05:00
Theodore Ts'o 06ef971be5 libss: initialize function pointer for readline_shutdown()
Clear the function pointer for readline_shutdown() so that if libss is
linking against a readline library which doesn't supply a
readline_shutdown() function, ss_delete_invocation() won't seg fault.

Thanks to Solar Designer <solar@openwall.com> for reporting this
problem to me.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-12 17:54:45 -05:00
Theodore Ts'o c13351f6c5 Add support for configure --enable-verbose-makecmds
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>
2009-07-02 00:11:17 -04:00
Theodore Ts'o a6a1c0815c Fix Makefile dependencies for libcom_err
The e2fsprogs makefiles were using the same Makefile variable
LIBCOM_ERR for the link-line arguments as well as the dependencies.
Since LIBCOM_ERR can now include non-file arguments such as
"-lpthread", we need to use a separate DEPLIBCOM_ERR variable that
only has build file dependencies.

Do the same thing for STATIC_LIBCOM_ERR and PROFILED_LIBCOM_ERR.

Addresses-Sourceforge-Patches: #2813809

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-01 22:06:51 -04:00
Theodore Ts'o 935a123f3b libss: Fix warn_unused_result warnings from gcc
Fixed a potential bug where by partial returns from the write system
call could the fallback pager to drop characters.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-22 14:48:59 -04:00
Theodore Ts'o 9ea68828f3 libss: ss_execute_line: reflect any error codes from system() to the caller
This is primarily to silence a gcc warning, but it's better to reflect
the error from system() up to the caller.  In this case we don't
actually use it for anything, but that's OK.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-22 14:46:48 -04:00
Jim Meyering 671326f625 libss: Avoid leak upon failed realloc in ss_add_request_table()
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-08 20:38:47 -04:00
Jim Meyering 45e338f533 remove useless if-before-free tests
In case you're wondering about whether this change is safe from a
portability standpoint, fear not.  This has been beaten to death
in other forums.  Here are a few threads:

  http://thread.gmane.org/gmane.comp.version-control.git/74187
  http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/12712
  http://thread.gmane.org/gmane.emacs.devel/98144
  http://thread.gmane.org/gmane.comp.lib.glibc.alpha/13092

There has been debate about whether it's a good idea from a
performance standpoint, too, but imho you'll have a hard time
finding an instance where this sort of change induces a
measurable performance penalty.  If you do, please let me know.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-08 20:37:12 -04:00
Theodore Ts'o 5299580c1c Use format strings directly to prevent -Werror=format-security failures
Gcc is too stupid to realize that:

    const char *usage="String which has no percent signs";

    com_err(progname, 0, usage);

is OK.  I refuse to bow to stupidity with:

   com_err(progname, 0, "%s", usage);

but I will use the string directly for the sake of people who like to
build with -Werror=format-security.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 13:05:25 -05:00
Theodore Ts'o 97be89b60b Fix pkg-config files: use Requires.private and fix the include directory
Addresses-Sourceforge-Bug: #2089537

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-02 21:20:44 -04:00
Theodore Ts'o efc6f628e1 Remove trailing whitespace for the entire source tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27 23:07:54 -04:00
Theodore Ts'o f56aa6e6ee Don't assume that /bin/true is always in /bin
... because it isn't on MacOS X

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-14 17:47:52 -04:00
Theodore Ts'o 2a7bfe8353 Flush stdio buffers before calling setbuf()
On Solaris setbuf() will discard any pending output to the stream, so
make we call fflush() before calling setbuf().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:06:57 -04:00
Theodore Ts'o 318824c1bb Fix Solaris shell script portability issues
Solaris ships with a pathetically ancient shell in /bin/sh,
so fix various shell scripts to accomodate.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:06:56 -04:00
Theodore Ts'o 81f6857b15 Fix LIBSS dependency problem for tests/test_icount and lib/ss/test_ss
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 22:19:52 -04:00
Theodore Ts'o a91b3f36dd Merge branch 'maint' 2008-04-17 16:32:28 -04:00
Theodore Ts'o 6a141f218e Fix non-POSIX ">&" in the Makefile for lib/ss's "make check" rule
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-09 15:40:43 -04:00
Theodore Ts'o fef2b38d8e Merge branch 'maint' into next
Conflicts:

	configure
	debian/rules
	e2fsck/swapfs.c
	lib/ext2fs/ext2_fs.h
2008-01-01 12:41:35 -05:00
Theodore Ts'o 0cfde3d15a libss: Remove unnecessary Makefile dependency for test_ss
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-01 01:19:19 -05:00
Theodore Ts'o b689b8dd14 Merge branch 'maint' into next
Conflicts:

	lib/ext2fs/closefs.c
2007-12-17 10:28:01 -05:00
Theodore Ts'o bef406047d libss: Fix "make check" test case to work portably
The "make check" test in lib/ss would fail if '.' is not in the user's
PATH, and if the libss shared library had not yet been installed yet.

Addresses-Sourceforge-Bug: #1848974

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-15 22:09:48 -05:00
Theodore Ts'o e6a4571eec Merge branch 'maint' into next
Conflicts:

	lib/ext2fs/closefs.c
2007-12-09 17:03:01 -05:00