Commit Graph

133 Commits (b9f95911e9e89a456c9b7bdc0ca68c111a931b30)

Author SHA1 Message Date
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 b79e338d2c Use makeinfo --html instead of texi2html
The texi2html utility from the texi2html ceased being developed
upstream in 2011, and upstream has declared it superseded by the
makeinfo utility from the texinfo package.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-28 15:40:56 -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 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 ccfedb17b1 Clean up texinfo files
Fix up the com_err.texinfo file so it will produce a valid printed
output, by cleaning up some errors in the texinfo file, and updating
texinfo.tex to be consistent with the version in the doc subdirectory.

Also add rules so we can generate pdf and ps files from
com_err.texinfo and libext2fs.texinfo.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-01-02 10:06:09 -05: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
Daniel Norberg f6243c10db com_err.pc: correct include path
compile_et puts #include <et/com_err.h> in
generated header files so pkg-config --cflags
com_err should provide the path to the directory
containing et/.
2012-04-10 15:24:53 +02:00
Theodore Ts'o 299a1e8efa libcom_err: declare com_err_gettext to be static
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-10-05 03:03:44 -04:00
Theodore Ts'o 4259052093 libcom_err: add set_com_err_gettext()
This function allows programs to pass in a pointer to the gettext
function so that error table strings will can be internationalized.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-10-05 00:58:40 -04:00
Theodore Ts'o da5a6b4317 compile_et: generate *_err.c files that have strings marked for xgettext
This allows error code strings to be internationalized.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-10-05 00:39:40 -04: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 1e082c6209 libcom_err: Fix install rule if installing with hard links
If $(LINK_INSTALL_FLAGS) is -f instead of -sf, the Makefile's install
rule would not work correctly while installing com_err.h

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-04 11:24:18 -04:00
Eric Sandeen b6d274f7c6 e2fsprogs: create com_err.h link in includedir
After debian bug #192277, debian/rules started making a symlink
to com_err.h in /usr/include.  Now I have Fedora bug #550889
for the same issue, and perhaps it's time to make this link
by default, rather than fixing it up in packaging steps?

[ Changed by tytso to remove the explicit -s option; this will default
  to creating a hard link by default, which slightly faster.  If
  people want to use symlinks for all links during the install
  process, they can use configure option --enable-symlink-install.
  The reason for this change is that some file systems, like AFS,
  don't support symlinks, and AFS users complain when they can't build
  or install into AFS.  So I don't want to use symlinks
  unconditionally without a way of switching things back and forth,
  and it's easier if we just make all links made during the install
  process to be hard links or sym links. ]

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-02-20 18:10:21 -05: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
Theodore Ts'o 1601b10e65 libcom_err: Add support for Heimdal com_right_r function()
Addresses-Sourceforge-Bug: #2963865
Addresses-Debian-Bug: #558910

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:14:12 -04:00
Theodore Ts'o 4534f8bc3f debian: Fix FTBFS problem caused by texi2html changing its output location
Unfortunately, texi2html gratuitously changed its behavior of where
its output html files are placed when the -split_chapter is in effect.
(First it was in a subdirectory; then it was in the current directory;
now it's back to putting the output html files in a subdirectory
again.)

Support either way of doing things since the texi2html team seems to
be indecisive...

Addresses-Debian-Bug: #552934

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 20:19:10 -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 d3395ae71a libcom_err: Declare prototypes for et_list_lock/unlock in com_err.h
Define the prototypes for et_list_lock() and et_list_unlock() in
com_err.h.  This promotes better error checking and avoids warnings
when compiling the library and programs that call these functions.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-22 14:41:32 -04:00
Theodore Ts'o 98e9fb9d53 libcom_err: Add missing type declarations to clean up -Wall warnings
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-02 08:52:38 -04:00
Theodore Ts'o 902be4ab7d libcom_err: Fix file descriptor leak after an exec
Some applications repeatedly re-exec themselves, and if they use the
com_err library, they can leak a file descriptor for each re-exec.
Fix this by setting the close-on-exec flag on the debug file
descriptor.  In addition, if the COMERR_DEBUG environment variable
isn't set, don't open the file handle at all.

Addresses-Red-Hat-Bugzilla: #464689

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-01 21:13:46 -04:00
Theodore Ts'o d7f45af802 libcom_err: Use sem_post/sem_init to prevent race conditions
SuSE has been carrying a patch for a long time to prevent a largely
theoretical race condition if a multi-threaded application adds and
removes error tables in multiple threads.  Unfortunately SuSE's
approach breaks compatibility by forcing applications to link and
compile with the -pthread option; using pthread mutexes has
historically been problematic.

This commit fixes things in a more portable way by using
sem_post/sem_wait instead, which is an older interface that doesn't
require the pthreads library.  Linux happens to implement
sem_post/sem_init using futexes, and -lrt ends up pulling in
-lpthread, but the advantage of using POSIX semaphores is that
applications don't have to be built using -pthread, unlike the use of
pthread mutexes.

The add_error_table() and remove_error_table() interfaces are the
preferred interfaces and locking protection have been added to only
these interfaces.  I have not added locking protection to the
generated initialize_xxx_error_table and initialize_xxx_error_table_r
interfaces, to avoid adding symbol dependencies that would cause a
library to fail to work when linking against older com_err libraries
that do not export et_list_lock() and et_list_unlock().  Threaded
applications shouldn't be using these interfaces in any case.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-12 10:15:26 -04: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 ef80fdc8ad Merge branch 'maint' into next 2008-02-10 08:03:54 -05:00
Theodore Ts'o 47526e3568 libcom_err: Use thread local storage to fix reentrancy problems
Address the theoretical problem of two threads trying to format a
different unknown error code by using TLS.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-09 23:49: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 6b6c27fb8a libcom_err: Fix sign-extension problem on 64-bit systems in error_message()
On 64-bit systems (or anything with sizeof(long) > sizeof(int)), we
sometimes get error codes passed to error_message which have been cast
from an (int) to an (unsigned int). This almost always happens if
you're using libgssapi_krb5, which returns an error code which is less
than 0 but is returned in an (unsigned int).

For example, -1765328377L gets cast to 2529638919, which is
0x96c73a07, not 0xffffffff96c73a07, so error_message() fails to find a
matching error table.

When error_message() then calls the error_table_name() function to get a
name to use in the "unknown code" message, it gets a correct value back.

This happens because error_table_name() drops most of the higher bits of
the parameter it's passed before doing anything else with it (& 077777777f,
or & 0xffffff). If we did the same thing in error_message(), we wouldn't
have a problem there, either.

Problem reported and fixed by: Nalin Dahyabhai

Addresses-Sourceforge-Bug: #1809658

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-15 22:31:03 -05:00
Dmitry V. Levin 710bac86a5 texinfo: Fix directory entries
According to texinfo documentation, @dircategory and
@direntry...@end direntry commands are more appropriate.

For details see
http://www.gnu.org/software/texinfo/manual/texinfo/html_node/Installing-Dir-Entries.html

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2007-11-01 00:25:02 -04:00
Theodore Ts'o 424a3e4a23 Remove Changelog files since they're not used after the git migration
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 08:50:41 -04:00
Theodore Ts'o d7b64725ee Update Release Notes, Changelogs, version.h, etc. for 1.40 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-24 17:32:47 -04:00
Theodore Ts'o 0d8b6733c7 Fix the info-dir line for the com_err.texinfo file
Fix the info-dir line so that the menu name does not contain a .info
prefix.  First of all, it's ugly, secondly, it causes the install-info
command to fail to remove the com_err info file from the
/usr/share/info/dir file when the comerr-dev package is removed and
purged.

Addresses Debian Bug: #401711

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-24 16:59:36 -04:00
Andreas Dilger de8f3a7621 Fix gcc -Wall warnings, especially on 64-bit systems
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-25 11:18:11 -04:00
Theodore Ts'o ec84b746f5 Add debugging code to the com_err library
If the environment variable COMERR_DEBUG is set to 1, print out debugging
messages as error tables are added and removed from the com_err library.
If the COMERR_DEBUG_FILE environment variable is set (and the process is
not setuid) the debugging messages may be redirected to a file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-12-22 13:38:38 -05:00
Theodore Ts'o 05155f9bff Set local environment variables to C so mk_cmds and compile_et always work
Addresses SourceForge Bug: #1532177

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-11-12 10:43:31 -05:00
Theodore Ts'o b6b65c3de4 Add datarootdir definition for compatibility with autoconf 2.60
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-10-22 00:14:26 -04:00
Andreas Dilger 3f5ef9642b Create the generated files read-only to remind developers not to edit them.
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-08-05 14:41:00 -04:00
Theodore Ts'o 3ded50b37c Address parallel build problem in the library Makefiles
Add a dependency to make sure that the subdirectories are created before 
creating all of the object files.

Addresses Sourceforge Bug: #1261553

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-12-10 22:23:01 -05:00
Theodore Ts'o 5bf9b4cd51 Fix com_err bug in compile_et: # of error messages can be wrong
Fixed bug where error messages using continuations wouldn't increment
the message count.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-07-19 08:24:59 -05:00
Theodore Ts'o 1f965c8d96 Update for e2fsprogs 1.38 release. 2005-06-30 20:06:45 -04:00
Theodore Ts'o d51b819e54 error_message.c, init_et.c: Segregate error tables registered
via add_error_table() and the other dynamic methods from
	the ones allocated via initialize_xxx_error_table() so
	that we won't fail even for error tables created using old
	versions of compile_et.  Thanks to Nalin Dahyabhai for
	this suggested patch.
2005-06-20 17:59:06 -04:00
Theodore Ts'o e7d32fcb56 et_c.awk: Use a dynamically allocated structure in
initialize_xxx_error_table(), to prevent segfaults if an
	old library calls initialize_xxx_error_table, and another
	library/application calls add_error_table() on the same
	error table, and then calls remove_error_table().
	(Addresses Sourcefroge Bug #1150146)
2005-06-20 16:24:04 -04:00
Theodore Ts'o 153b4495c1 If the .c and .h file already exist, and they have not changed, use the
original versions of the files, so as to avoid rebuilding files when not
necessary.  Also fixes a potential SMP/Parallel build problem when one 
make process runs compile_et to generate the .h file, and a partially
generated .c file is compiled by another make process.  (Addresses
Sourceforge Bug: #1157933)
2005-05-06 09:42:34 -04:00
Theodore Ts'o fd4b28efd3 Update for the e2fsprogs 1.37 release. 2005-03-21 22:37:03 -05:00