Commit Graph

146 Commits (4f858546e1c3c452f400a34198b10cb7a1ed2760)

Author SHA1 Message Date
Theodore Ts'o 14b596d409 configure.in: add --disable-libblkid option
Add an option to switch between the private (in-tree) libblkid and
public (in-system installed) library.  The private version is still
enabled by default.

If --disable-libblkid is specified the findfs(8) program, which is a
variant of tune2fs, is also not built or installed.

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-22 09:18:30 -04:00
Theodore Ts'o 1207e36d0a libuuid: Close all file descriptors before running uuidd
This avoids problems when the calling program has open file
descriptors (especially sockets) open.

Also fix up some warn_unused_result warnings from gcc.

Addresses-Launchpad-bug: #305057

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-15 13:12:56 -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 55da987650 Improve ELF shared library handling
Pass in -rpath-link option to the linker so that blkid will build
correctly on systems that don't have libcom_err.so.2 installed.

Fix debugfs to only try to link with -ldl when building without shared
libraries; with ELF shared libraries, the library which requires -ldl
(libss.so) can required the library dependency itself.

Fix how we build tune2fs.static so that we use @LDFLAG_STATIC@, via
$(LDFLAGS_STATIC), instead of hard-coding the use of -static.

Addresses-Sourceforge-Bug: #2088537

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-02 23:12:38 -04:00
Theodore Ts'o af773654b2 Enable test_io debugging by default
Test I/O debugging is incredibly useful for rooting out problems, so
let's enable by default, especially now that its overhead is only
incurred when it is needed.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-01 11:36:59 -04:00
Theodore Ts'o 7515a74478 Remove use of devmapper library by the blkid library
The devmapper library is no longer needed given commit f4e89bcd.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-26 23:56:00 -04:00
Theodore Ts'o 1aaaa82901 configure.in: Respect LDFLAGS environment variable if passed into configure
If the --with-ldopts option is not passed on the command line, respect
the LDFLAGS environment variable instead of forcing LDFLAGS to be
unset.  "configure --help" documents LDFLAGS as part of the standard
configure script calling convention.

Addresses-Sourceforge-Feature-Request: #1937287

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-22 12:26:07 -04:00
Theodore Ts'o 6ec9ef1881 libuuid: Windows portability fixes
Make the uuid library (more) portable for Windows.

Addresses-Sourceforge-Feature-Request: #1937287

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-22 12:15:56 -04:00
Theodore Ts'o 02d04db494 configure.in: use AC_MSG_{RESULT,WARN,ERROR} instead of echo
This gives us standard behavior when using flags such as --quiet, and
gives us standard warning output when showing warnings and errors.

Addresses-Sourceforge-Patches: #2058794

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-22 10:52:42 -04:00
Theodore Ts'o c13ab4fa7a badblocks: If nanosleep() does not exist, try using usleep() instead
For portability on systems that don't have nanosleep().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:38:56 -04:00
Theodore Ts'o 3d05802f92 blkid: Add new option -L which pretty-prints the device list
Also accessed via -o list, this new output format is much more
user-friendly and lists whether or not a particular device is mounted.

Addresses-Debian-Bug #490527

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:06:47 -04:00
Theodore Ts'o eafba6c310 Don't use thread local storage if using diet libc
...because the diet libc doesn't support TLS.

Addresses-Sourceforge-Bug: #2000654

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-10 10:21:42 -04:00
Theodore Ts'o ab06396f70 debian: Create debian release tarball to obey new WIP naming convention
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-07 16:12:28 -04:00
Theodore Ts'o dc9345a0bd Merge branch 'maint'
Conflicts:

	configure
2008-06-07 10:08:48 -04:00
Theodore Ts'o 488c75a6a6 Fix ext2fs_swap{16,32,64} for external applications on big-endian machines
The public header files depend on the the autoconf defines
WORDS_BIGENDIAN and HAVE_SYS_TYPES_H, so we add them to ext2_types.h
so that external programs which try to use ext2fs_swap*() will work
correctly on big-endian systems.  Fortunately, few if any programs
need to use this libext2's byte-swap functions directly.

Addresses-Debian-Bug: #484879

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 08:55:21 -04:00
Theodore Ts'o c0af709e52 Merge branch 'maint'
Conflicts:

	README
	version.h
2008-05-21 16:56:42 -04:00
Maciej W. Rozycki b8251a546d Remove default sizeof sizes in configure script when cross-compiling
Since version 2.50 autoconf fully supports checking sizes of types
(with AC_CHECK_SIZEOF) when cross-compiling.  Therefore there is no
need to preset the respective cache variables anymore.  The following
patch removes the special case.  There is no need to adjust AC_PREREQ
as it's set to 2.50 already.

Tested successfully cross-building for the mips64el-linux-gnu host on
an i386-linux-gnu build system, removing the following warning
(because of a mismatch for the "long" type):

Sizeof(__U64__TYPEDEF) is 4 should be 8
Problem detected with asm_types.h

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-21 13:24:37 -04:00
Theodore Ts'o 4476105bf3 Merge branch 'maint'
Conflicts:

	configure
2008-04-21 21:35:44 -04:00
Manish Katiyar 7321d94eb0 Fix "make docs" rule in Makefile for doc folder.
Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-21 20:30:48 -04:00
Theodore Ts'o ae389208e9 Merge branch 'maint' into next 2008-04-06 17:10:49 -04:00
Theodore Ts'o 27f991b04e Remove bashism from configure script
Thanks to Mike Frysinger for pointing this out.

Addresses-Sourceforge-Bug: 1921969

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-01 20:32:55 -04:00
Theodore Ts'o bbf54adb03 Merge branch 'maint' into next 2008-02-17 17:36:45 -05:00
Christophe GRENIER e7cc6f7d0b Add portability checks to support DJGPP
DJGPP lacks sys/select.h and sys/un.h; add header checks to be more
portable.

Signed-off-by: Christophe Grenier <grenier@cgsecurity.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-02-17 17:33:57 -05:00
Theodore Ts'o d69e7e28ca configure.in: Don't use the dc command unless it is required
Some systems don't have the 'dc' command installed, and this causes
configure to print a warning message unnecessarily for a standard
(non-WIP and non-pre) release of e2fsprogs.

It's easy enough to avoid this problem, so let's do it.

Addresses-Sourceforge-Bug: #1893024

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-17 17:33:57 -05:00
Theodore Ts'o 428f6b32a9 Merge branch 'maint' into next
Conflicts:

	configure
	lib/ext2fs/ext2_fs.h
	misc/e2image.c
2008-01-27 20:09:05 -05:00
Theodore Ts'o 7e8fe327b5 Don't build e2fsck statically by default anymore
Also removed the --enable-dynamic-static configure option.

Unfortunately the usefulness of building e2fsck statically is gone on
all modern distributions, since everything else on the system is built
dynamically these days.  In fact on some distributions it is almost
impossible to build programs statically any more.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-27 18:22:18 -05:00
Theodore Ts'o 261cd3964f Explicitly check for ftruncate64() in configure.in
Apparently Mac OS 10.5 defines fstat64(), but not ftruncate64(),
causing resize2fs to fail to build.  So check explicitly for
ftruncate64(), and fall back to ftruncate() if necessary.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-21 13:45:00 -05:00
Theodore Ts'o c4ef11c507 If --sbindir, et. al are specified to configure set $root_sbindir, et al.
If the user specifies as arguments to configure --bindir, --sbindir,
--libdir, or --sysconfdir, then set corresponding $root_FOO variable,
so that the request from the user to set a specific --sbindir is
honored.

Addresses-Sourceforge-Bug: 498381

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-04 16:55:37 -05:00
Theodore Ts'o a4ece35911 Use pkg-config to determine where to find the devmapper library
Fedora and Red Hat puts the devmapper library in different locations
compared to Debian, so we use pkg-config.  Unfortunately Debian's
devmapper.pc file is buggy (See Debian Bug #390243), so we have to
work around it.

Historically, e2fsprogs has tried not to depend on pkg-config, since
its answers are so often **wrong** (the Debian bug has been ignored
for over a year), so I'm hoping I'm not going to regret this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-03 12:36:59 -05: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 29dd9d1e90 Test for sys/syscall.h in configure to fix dietlibc build problem
When compiling with dietlibc, sys/syscall.h isn't supported; as of
dietlibc 0.30, it exists but it references a non-existent asm/unistd.h
header file.  So we have to test for its existence and avoid using it
in lib/uuid/gen_uuid.c if it is not supported.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-31 22:34:25 -05:00
Theodore Ts'o 5610f9924b Add --disable-uuidd configure option
Add a configure option which causes the uuidd helper daemon not to be
built or used by the uuid library.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-31 22:34:19 -05:00
Theodore Ts'o 3249394d43 Add --disable-tls configure option
Add option to forcibly disable the use of thread local storage

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-31 22:34: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 740837def7 Add uuidd daemon to prevent duplicate time-based UUID's
Also store the clock sequence information in a state file in
/var/lib/misc/uuid-clock so that if the time goes backwards the clock
sequence counter can get bumped.  This allows us to completely
correctly generate time-based (version 1) UUID's according to the
algorithm specified RFC 4122.

Addresses-Sourceforge-Bug: #1529672
Addresses-Red-Hat-Bugzilla: #233471

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-16 17:28:46 -05:00
Theodore Ts'o a5dda05422 Remove configure --enable-swapfs and associated support #defines
This removes the last vestiges of support for the legacy PowerPC
big-endian filesystem format.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-11 03:22:00 -04:00
Theodore Ts'o 29a5deed21 Improve the config/parse_types.sh helper script
Fix a potential security problem if e2fsprogs is built as root (as
Gentoo does!).  In addition fix the script and how it is called from
the configure script so that it does the right thing when
cross-compiling.

Fixes-Gentoo-bug: #146903

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-04 19:55:03 -04:00
Theodore Ts'o 106ad96dae Add tdb from Samba into libext2fs library.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-04-04 21:26:37 -04:00
Andreas Dilger 927566a3ab Fixes for building RPM's via "make rpm"
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>
2006-11-12 19:41:25 -05:00
Theodore Ts'o ae2868acf0 Add failsafe against duplicate UUID's generated by threaded programs
Add in randomness based on Linux's thread id (gettid) to avoid race
conditions when two threads try to generate uuid's at the same time.
This shouldn't be an issue if /dev/urandom has proper locking and is
present, so this is just a failsafe.

Addresses SourceForge Bug: #1529672

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-10-22 00:18:49 -04:00
Theodore Ts'o e10521444d Fix amd64 build due to -lpthread ordering problem
Addresses Debian Bug: #393680

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-10-21 21:46:47 -04:00
Theodore Ts'o cce2f497e0 Fix Debian FTBFS problem caused by devmapper library using pthreads
Addresses Debian bug: #388718

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-10-01 22:18:08 -04:00
Theodore Ts'o e54635de96 If diff -u is supported, use it to report test failures.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-08-06 14:33:13 -04:00
Theodore Ts'o 4ea7ea007b Fix asm_types.h type conflicts
This caused FTBFS bugs on AMD64 platforms, since it uses a different
64-bit type when compared with IA64, so we need to make our
autoconfiguration system more intelligent.

Addresses Debian Bugs: #360661, #360317

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-04-09 08:41:55 -04:00
Karel Zak 4db2f59a71 Add device-mapper support to the blkid library
On systems where is multi-path storage device is problem with duplicated
filesystems. The solution is select "the best" device. This is possible
by device-mapper library.

Short quotation from RH bugzilla:

With my patch, all dm devices remains in libblkid cache.

Only the top level dm devices are given high priority
and more appropriate node names (i.e. /dev/mapper/*) are used.

For example, if we have linear mapped dm device "ov1" over
dm device "disk1p3" which is multipath mapped to /dev/sdd3 and /dev/sdh3:
  # dmsetup.static ls --tree
  ov1 (253:5) <-- /dev/mapper/ov1 or /dev/dm-5
   `-disk1p3 (253:4) <-- /dev/mapper/disk1p3 or /dev/dm-4
      `-disk1 (253:0)
         |- (8:112) <-- /dev/sdh
         `- (8:48) <-- /dev/sdd

Original version of blkid will show:
  # ./orig/blkid -t LABEL=mpdisk1p3 -l
  /dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"

With my patch, blkid will show:
  # ./deptree/blkid -t LABEL=mpdisk1p3 -l
  /dev/mapper/ov1: LABEL="mpdisk1p3" ... TYPE="ext3"

In blkid cache, all devices are listed:

  # ./orig/blkid -t LABEL=mpdisk1p3
  /dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/sdh3: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/dm-4: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/dm-5: LABEL="mpdisk1p3" ... TYPE="ext3"

  # ./deptree/blkid -t LABEL=mpdisk1p3
  /dev/mapper/ov1: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/sdh3: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/dm-4: LABEL="mpdisk1p3" ... TYPE="ext3"

For more details see discussion on:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=156324

Addresses Red Hat Bug: #156324

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-08 14:17:28 -05:00
Theodore Ts'o dd947da232 Fix cross-compilation problems when CFLAGS contain target-specific options
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>
2005-11-09 18:37:07 -04:00
Andreas Dilger 9b7d811dda This patch adds a check to use fstat or fstat64 in getsize.c if the
target is a regular file, instead of doing binary searching.  It also
fixes a couple of cases where a file descriptor is leaked in the
ext2fs_getsize() routine on error.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2005-07-09 22:06:59 -05:00
Theodore Ts'o 762c7c6510 Add paranoia checks into the blkid, ext2fs, and ss libraries to ignore
environment variables if the libraries are called from setuid or setguid 
programs, or if kernel believes that the process is not eligible to create
a core dump.  In addition, if the libc has __secure_getenv(), use it so that
the libc can also do any additional limitations regarding when libraries can
trust environment variables (i.e., to integrate with systems like SELinux 
and Posix capabilities).
2005-04-06 14:44:16 -04:00
Theodore Ts'o ee683a13f6 Makefile util/gen-tarball executable after creating the file. 2005-02-05 15:53:56 -05:00
Theodore Ts'o 33db8f80f2 Remove support for --enable-clear-htree; this was
only needed during the early development of the htree patch.
2005-02-05 10:28:15 -05:00