Commit Graph

281 Commits (205593f65b2f78c2cc8116a7827c241ebc8387fc)

Author SHA1 Message Date
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 30dd262235 Fix divide by zero error in blkid's NTFS probing logic
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-24 17:17:24 -04:00
Karsten Hopp e382a7eade Add support for LUKS encrypted partitions
This patch adds support for cryptsetup-luks (http://luks.endorphin.org)
UUIDs to libblkid.  This is required p.e. to avoid hardcoding device
names for encrypted partitions.  Could you please take a look at it and
consider inclusion in the next e2fsprogs release ?

Signed-off-by: Karsten Hopp <karsten@redhat.com>
2007-06-21 13:43:33 -04:00
Theodore Ts'o cb0c5d701a Add more paranoid NTFS probing and fetch UUID and LABEL information
Hopefully this addresses false positives by the blkid library when
detecting NTFS partitions.

Addresses Launchpad Bug: #110138

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-19 03:29:47 -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 6fb57a92d1 libblkid: Fix bug which could cuase bid_type to be corrupted
Fortunately bid_type isn't used much, and bid_label and bid_uuid is
only used by debugging code, so the impact of this bug was very
minor.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-18 21:44:29 -04:00
Theodore Ts'o 7292355283 Add new function blkid_gc_cache()
New function which performs a garbage collection pass on the
/etc/blkid.tab file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-18 00:02:35 -04:00
Sergey Vlasov c9105ffbe5 blkid: Report correct UUID from MD superblocks
The second part of UUID was copied to a wrong place in the buffer.
Now the UUID shown by blkid is the same as shown by /lib/udev/vol_id
(at least with udev-108), but is not in the same form as used by mdadm
(which prints UUID as 4 32-bit words and uses different endiannes).

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2007-04-10 12:00:38 -04:00
Sergey Vlasov 6b8be16e3a blkid: Fix MD 0.90 superblock detection on little endian systems
MD 0.90 superblock format is host endian - need to check for bith big
endian and little endian magic.  Without this change MD components
created on little endian systems were not detected as such, which
could then lead to false positives when detecting filesystems.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2007-04-10 11:59:46 -04:00
Brian Behlendorf e0a700d45d [COVERITY] Fix (error case) memory leak in blkid library (parse_dev)
Coverity ID: 29: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-03-23 22:55:59 -04:00
Theodore Ts'o 5f7fe7fe0e [VALGRIND] Fix memory leak in libblkid (blkid_get_devname)
Nyah, nyah, Coverity didn't find this one.  :-)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-03-21 17:15:36 -04:00
Theodore Ts'o d90be5b143 [COVERITY] Allow blkid_dev_has_tag to check if a tag exists when value==NULL
blkid_dev_has_tag() will immediately return -1 (an error if value is
NULL.  Thus at the test later on value cannot be NULL. There are two
possible ways to go about fixing this. The first would be to remove the
first NULL check for value.  The second one would be to remove the
second check (and the deadcode).

I chose the second path because the functionality added is something
which a programmer could reasonably expect given the function name, and
it is highly unlikely any existing code is depending on the fact that
blkid_dev_has_tag() will return an error if value is NULL.

Coverity ID: 3: Deadcode

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-03-18 11:21:44 -04:00
Theodore Ts'o 257ace82b7 Fix memory leak in blkid library
Addresses Debian Bug: #413661

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-03-06 19:56:18 -05:00
Theodore Ts'o 5b984ab51f blkid_devno_to_devname(): Avoid recursive loops due to symlinks in /dev
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-09-24 22:33:38 -04:00
Karel Zak 633f453db1 Fix blkid bug with correctly reporting FAT filesystem labels that are empty
Signed-off-by: Karel Zak <kzak@redhat.com>
2006-09-17 21:23:46 -04:00
Karel Zak b5517ca667 Add GFS/GFS2 support to the blkid library.
Signed-off-by: Karel Zak <kzak@redhat.com>
2006-09-17 21:10:58 -04:00
Theodore Ts'o a02fa9beb8 Fix bug in device mapper scanning; probe_one() doesn't want a leading /dev
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-09-12 01:30:53 -04:00
Andreas Dilger f776a2354d blkid.8.in: Fix description of the -l option to be more accurate
This patch fixes the blkid.8.in description of the "-l" option.  The man
page gives the impression that the first match is the one that is returned.
However, the blkid_find_dev_with_tag() function returns the device with
the highest priority (which is good, because that is what people really want).

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2006-08-19 21:12:15 -04:00
Andreas Dilger cc6d1a9ef7 This patch fixes up an error in the lib/blkid/Makefile.in which was causing
all lib/blkid/tst* files to be removed with "make clean", in particular
tst_types.c.  That was causing a failure of "make check" in an RPM source
tree.  Fix is to explicitly list the test binaries, as lib/ext2fs/Makefile.in
does.

As "make check" was only calling test_probe and tst_types (and none
of the other tst_* tests) it was not clear what was going on, and an
"hg update" would always return the old tst_types.c file back so the
problem was only being seen intermittently...  It isn't clear whether
you want the other tst_* programs to be run as part of "make check".

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2006-08-19 20:05:28 -04:00
Andreas Dilger 9a519c0284 fix comment for blkid_get_dev_size()
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2006-06-21 00:04:08 -04:00
Matthias Andree aadac9b7bb Add parentheses and casts to make GCC happy.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 16:29:49 +02:00
Matthias Andree 94fa1108ee Fix SIGBUS through unaligned access to FAT superblocks.
SPARCs do not like unaligned halfword access and throw SIGBUS.
Read data "manually" instead.

Tested on Solaris 8/SPARC with gcc 2.95.3.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 15:47:12 +02:00
Matthias Andree 0ac93a00c9 Change more "echo -n" to "printf" to avoid screen clutter.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 15:47:05 +02:00
Matthias Andree bdc3514af4 Switch endian detection from Linuxism to AC_C_BIGENDIAN.
This fixes all blkid test failures on FreeBSD 4.11 i386.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 14:42:47 +02:00
Matthias Andree a0dfc6ea8c Revise DIOCGDINFO (sys/disklabel.h) related FreeBSD comment.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 05:08:02 +02:00
Matthias Andree 5beaabb0f8 Enable sys/disklabel.h and DIOCGDINFO based getsize code.
Tested on FreeBSD 4.11-RELEASE i386.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 04:26:13 +02:00
Matthias Andree 12a829dcdc Add a bunch of type fixes for debug/"make check" code paths.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 01:48:51 +02:00
Matthias Andree 21261a0ea2 Cast time_t variable to long for fprintf to match %ld.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 01:20:46 +02:00
Matthias Andree 66352fe200 Drop unused vector uuid[].
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 01:20:17 +02:00
Matthias Andree f72b8ff098 Implement DIOCGMEDIASIZE for FreeBSD's GEOM.
Try DIOCGMEDIASIZE ioctl() if defined, to obtain
the media size on FreeBSD 5.0 and newer.
The binary search fallback doesn't work, as FreeBSD
block devices are unbuffered and refuse reads below
the block size.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 00:54:49 +02:00
Theodore Ts'o 49487b79da Fixed signed vs. unsigned comparison warning in strncmp().
It's better to use memcmp() anyway given the code in question.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-05-14 17:29:00 -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
Theodore Ts'o 292811f2aa Fix typo bug in previous commit (6ae1ed49c8c6)
"fd" should have been "probe.fd" so blkid/probe.c can compile without
errors.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-25 01:42:02 -05:00
Theodore Ts'o 2858c94e35 Fix file descriptor leak in blkid library in error paths
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-23 22:14:54 -05:00
Theodore Ts'o f4f425b20b Prevent error messages to stderr caused by libblkid calling libdevmapper
Make the libdevmapper fail quietly if blkid is called without root
privileges or the kernel does not include device mapper support.
(What is the device mapper _library_ doing writing to stderr, anyway?)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-19 15:26:26 -05:00
Theodore Ts'o e324b25059 Fix blkid's last verification logic to work when the system clock is insane
Users have reported problems on newly installed systems when the
Macintosh's system clock battery is dead and the hardware clock is
returning a date of 1904.  Turns out there were some bugs in handling
dates before the Unix epoch.

Addresses Red Hat Bug: #182188

probe.c (blkid_verify): Fix the bid_time sanity checking logic,
	so that if last verification time is more recent than the
	current time, or the comparison between the last
	verification time and the current time causes an overflow,
	a device verification will take place.

devname.c (blkid_get_dev): Set the initial bid_time to be
	INT_MIN, to guarantee that blkid_verify will always be run
	even when the system clock is insane.

dev.c (blkid_debug_dump_dev), read.c (debug_dump_dev), 
	save.c (save_dev): Fix the printf format for dev->bid_time
	to match the fact that it is an signed type.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-12 23:25:15 -05:00
Theodore Ts'o ba5e38494e Add EXT_JOURNAL to the blkid tag of ext3 filesystems.
If the filesystem has an external journal, store the UUID of the
external journal in the tag EXT_JOURNAL.

If the filesystem type has changed, clear all the tags on the device,
not just a preset list of LABEL, UUID, TYPE, and SEC_TYPE.

Fix a bug so that blkid_set_tag will work correctly when freeing a tag
when the input name parameter comes from the tag that we are freeing.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-10 18:11:35 -05: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 438961210d Add missing parameter to error printf in blkid test program.
The blkid tag.c's test driver program had  a missing parameter to an 
error message printf.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-12-29 14:07:45 -05: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 2f79e5193f Search the root directory of FAT filesystems for the label information
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-10 21:51:20 -04:00
Theodore Ts'o ca7498596f Generic blkid library cleanup
Change superblock and generic i/o functions to be more generic.  Clean
up interface to the probe function.  Fix memory leak.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-10 21:07:23 -04:00
Theodore Ts'o 1e5630abab Add a regression test suite for the blkid library
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-10 15:55:14 -04:00
Theodore Ts'o 45a3fa8738 Add support to extract basic iso9660 label information to the blkid library
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-10 15:46:57 -04:00
Theodore Ts'o bb626bcd54 Add support for detecting the reiser4 filesystem in the blkid library.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-10 11:48:38 -04:00
Theodore Ts'o 038d2bedaa Improve blkid's VFAT/FAT filesystem probe code
Collapse vfat and fat code and make it more paranoid when probing for
vat/fat filesystems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-07 12:14:53 -04:00
Theodore Ts'o 45d1d889b9 Remove unneeded probe.h header file in lib/blkid/resolve.c
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-07 12:12:21 -04:00
Karel Zak c4c740ff48 Improve VFAT detection to support filesystems w/o a magic string in the superblock
The current libblkid code expects that there's magic string in FAT super
block (like "FAT12", "FAT16", ...). It's very often right, but valid FAT
super block may be without magic string too :-(

The patch from attachment fix this problem. It's inspired by HAL and
Linux kernel.

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-06 08:13:35 -04:00
Karel Zak abaa11240a Add support for detecting software suspend partitions to blkid
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-06 06:42:49 -04:00
Karel Zak 05a6edf4fd Fix blkid library so that the cache validation notices ext2 to ext3 conversion
There's mistake in blkid ext2 detection code. The libblkid doesn't
check for journal when revalidate the cache information about an ext2
device.

        # rm -f /etc/blkid.tab

        # mkfs.ext2 /dev/loop0 &> /dev/null
        # blkid -s TYPE /dev/loop0
        /dev/loop0: TYPE="ext2"

        # mkfs.ext3 /dev/loop0 &> /dev/null
        # blkid -s TYPE /dev/loop0
        /dev/loop0: TYPE="ext2"

That bug doesn't appear when libblkid creates new cache and checks for
all possible filesystems, because it tries ext3 before ext2. BUT when
the library only revalidate the cache it first probes for old cached
filesystem (e.g. ext2).

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-06 06:26:45 -04:00
Theodore Ts'o 583d1f8328 Fix false positives from valgrind: prctl(PR_GET_DUMPABLE)
Pass in zero to the unusued arguments of prctl(PR_GET_DUMPABLE) to
avoid false positives from valgrind.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-07-25 11:36:43 -05: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 1f965c8d96 Update for e2fsprogs 1.38 release. 2005-06-30 20:06:45 -04:00
Theodore Ts'o 55080a7637 Fix blkid's debugging/TEST_PROGRAM code so that it is sufficiently
standalone that "make check" will compile without errors even  
when configure "--enable-blkid-debug" is not specified.
2005-06-27 13:54:08 -04:00
Theodore Ts'o ed6acfa337 Add a new option to the blkid program, -l, which will more efficiently search
for a single device.

Add a new function to the blkid library, blkid_probe_all_new().

Optimize blkid_find_dev_with_tag() so that extraneous device validation are
skipped.  (Makes a difference for system with a large number of disks).
2005-05-07 17:06:27 -04:00
Theodore Ts'o 12b3c8ec1d Fix gcc -Wall nits in the blkid library. 2005-05-07 14:38:10 -04:00
Theodore Ts'o 78c7d0efae Clean up the debugging code in the blkid library so that we don't use
the inline functions DEB_DUMP_* and instead use the private functions 
blkid_debug_dump_*().
2005-05-07 14:22:38 -04:00
Theodore Ts'o c37543df2f Add new two new functions to the blkid library: blkid_dev_set_search(), and
blkid_dev_has_tag(), and change the blkid program to take advantage of these
functions.
2005-05-07 13:32:47 -04:00
Theodore Ts'o 4c4e3f7843 Fix libblkid's magic number recognition for the cramfs filesystem,
and add support to pull out the label for cramfs filesystems.  
Thanks to Karel Zak (kzak at redhat.com) for the patch.
2005-05-05 18:06:04 -04:00
Theodore Ts'o 09f3eba28a Fix typo so that we actually ignore environment variables when gid != egid. 2005-04-16 13:56:03 -04: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 fd4b28efd3 Update for the e2fsprogs 1.37 release. 2005-03-21 22:37:03 -05:00
Theodore Ts'o 65ffef3689 Ignore the BLKID_FILE environment variable if blkid_get_cache() is
called from a setuid program.
2005-03-21 22:13:32 -05:00
Theodore Ts'o b22ea17742 getsize.c (blkid_get_dev_size): Fix compilation problem on
Darwin systems.
2005-03-16 23:38:14 -05:00
Theodore Ts'o 3eee5e9eed Update for release of e2fsprogs 1.36. 2005-02-05 18:26:03 -05:00
Theodore Ts'o b7aa0d653e Remove *.pc files on a "make distclean"
Remove emacs backup files in tests/Makefile on a "make clean"
2005-02-05 15:48:49 -05:00
Theodore Ts'o dbe9c71a17 Use inline instead of __inline__ in the blkid debugging code for
Solaris compatibility.
2005-02-03 22:09:49 -05:00
Theodore Ts'o 18d1296333 blkid.c (main, compare_search_type): Make blkid -t work more
consistently when the blkid cache file is explicitly set
	to /dev/null.  (Addresses Debian Bug #292425)

Also expose blkid_verify() as a public function to the blkid library.
2005-01-27 19:51:47 -05:00
Theodore Ts'o 32923fa402 Add functions which allow an application program to do a run-time query
of the version of the blkid library.
2005-01-26 13:16:06 -05:00
Theodore Ts'o e644186542 Add pkg-config files to e2fsprogs's libraries. 2005-01-26 12:59:25 -05:00
Theodore Ts'o 9d0f46169f probe.c: Windows can perform a "quick format" that doesn't clear
enough of the partition that the blkid probes can get
	confused.  Do the NTFS test first to deal with this
	Windows misfeature.  (Addresses Debian Bug #291990)
2005-01-25 03:26:10 -05:00
Theodore Ts'o 2c92375ea4 Add support to the blkid library to recognize Oracle ASM volumes. 2005-01-21 17:57:56 -05:00
Theodore Ts'o 8800c73835 Makefile.in: Fix the kernel compile-time echo commands to be
consistent and portable
2005-01-19 00:25:25 -05:00
Matthias Andree f892826b8d lib/blkid/getsize.c: Move #include "blkidP.h" before <sys/queues.h>
to avoid a clash with the LIST_HEAD in the latter file that results
in compilation failure.
2005-01-13 04:15:45 +01:00
Matthias Andree d34588265c we're reading unsigned long long, use %llu rather than %lld. 2005-01-12 22:58:33 +01:00
Theodore Ts'o 7369f0ce5f Apply Janos Farkas's patch to support extracting the uuid and label
information from swap partitions.

Also make sure that if a partition has a label removed, that the label is
removed form the blkid cache as well.

Add support for detecting 32k and 64k pagesize swap files.
2005-01-10 23:58:11 -05:00
Theodore Ts'o 2e6a9febb4 Adjust blkid library so that it returns vfat in preference to msdos so
that mount will try to use the vfat filesystem.  (Addresses Debian bug #287455)

Similarly, the blkid library will now return an ext3 type for ext 2/3 
filesystems that have the journal capability set.

We allow files to be probed by the blkid library, to make it easier to
test the library.  However, we also added safety checks to avoid saving
relative pathnames to blkid.tab, and probe_one() will only check block device
files.
2005-01-05 17:45:32 -05:00
Theodore Ts'o 522798d342 Add install-strip and install-shlibs-strip targets
Use Linux-kernel-style makefile output for "make install"

Update intl/Makefile.in to version from gettext 0.14.1
2004-12-15 11:28:55 -05:00
Theodore Ts'o 6d4022786d Use MKINSTALLDIRS macro so that the Makefiles can find the script
correctly.

Update Makefile dependencies.

Update "make depend" production so that it filters out comments
inserted by newer gcc compilers.

Remove sync from e2fsck's "make all" target.
2004-12-14 21:46:26 -05:00
Theodore Ts'o 3838f7df13 Avoid using uint and uchar types when probing for ocfs2 filesystems
in the blkid library, to allow compilation using dietlibc.
2004-11-30 19:05:38 -05:00
Theodore Ts'o 47204ff983 Use Linux-kernel-style makefile output to make it easier to
see errors/warnings.
2004-11-30 10:52:27 -05:00
Theodore Ts'o 2b5901d9c7 Remove the a.out DLL support, since it's been obsolete and unmaintained
for a long time now.
2004-11-19 17:06:47 -05:00
Theodore Ts'o 4b8f81aace probe.c (probe_ocfs): Fix bug where the wrong size for "ocfs1"
was being passed to blkid_set_tag().  Thanks to Andrea
	Dilger for pointing this out.
2004-11-19 14:28:01 -05:00
Theodore Ts'o 414846b126 Add support for ocfs2 detection to the blkid library,
courtesy of manish.singh@oracle.com
2004-09-17 21:37:49 -04:00
Theodore Ts'o 9845cf5dbd Clean up the header file #include's for lib/blkid/getsize.c
and lib/ext2fs/getsize.c

In lib/blkid/getsize.c, include <sys/disk.h> if present since
this is where the DIOCGMEDIASIZE ioctl is defined on FreeBSD.
(Addresses Debian Bug #264630)
2004-09-17 19:07:03 -04:00
Theodore Ts'o 488f3c2dad On non-linux systems, use lseek64() if it is present in
ext2fs_llseek() and blkid_llseek().  (Addresses Debian bug #269044)
2004-09-17 17:47:12 -04:00
Theodore Ts'o 1b510f57f4 read.c (blkid_read_cache): Add missing fclose() which was
causing a memory and file descriptor leak.  Thanks to
	magnus.fromreide at teligent.se.
2004-05-15 17:27:43 -04:00
Theodore Ts'o 7ce0806406 probe.c (blkid_verify_devname): If the time is earlier than the
last modified time of the device, then force a reverify;
	it means the system time may not be trustworthy.
2004-04-19 21:42:18 -04:00
Theodore Ts'o 7a3a386b9e In the blkid library, if the BLKID_FILE environment
variable is set, use it to find the blkid.tab file if the
calling application did not supply a filename.
2004-04-12 07:26:23 -04:00
Theodore Ts'o dd60705665 Refine the build process to avoid re-running subst all the time on
some generated files, by having subst update the modtime on these 
files even when the generated file hasn't changed.  We do this with 
generated files that do not have any downstream dependencies.
2004-04-03 13:53:46 -05:00
Theodore Ts'o 2625803ecf Use C99 stdint.h types instead of custom types in the uuid library. 2004-04-03 10:20:26 -05:00
Theodore Ts'o 1cdb6f7602 Don't close the file descriptor when determining the size.
This bug was introduced in the previous getsize changes, 
and was screwing up the blkid library probe functions.
(Addresses Debian Bug #239191)
2004-03-21 20:16:19 -05:00
Theodore Ts'o 2c5cfbcb99 Only use the BLKGETSIZE64 ioctl on Linux 2.6 since it is
unreliable in Linux 2.4.  (Addresses Debian Bug #236528).  

Fix typo in the ioctl used for Mac OS X.
2004-03-08 14:12:09 -05:00
Theodore Ts'o 9387c281ef probe.c (probe_ocfs), probe.h: Add support for the Oracle
Cluster Filesystem (ocfs).  Patches courtesy of Rusty
	Lynch (rusty@linux.co.intel.com).
2004-03-04 19:59:58 -05:00
Theodore Ts'o 85b8700344 Update getsize functions to use the Apple Darwin and Linux 64-bit
ioctl's.
2004-03-02 10:11:11 -05:00
Theodore Ts'o 434661f8d5 Patch from Brian Bergstrand to use the correct -fPIC flag for
Darwin in order to get rid of the compiler warning.
2004-02-29 22:46:49 -05:00
Theodore Ts'o b70b1167fe Update version number for e2fsprogs 1.35 release. 2004-02-28 10:52:35 -05:00
Theodore Ts'o 544349270e Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
Theodore Ts'o 9c7ec17809 Update for 1.34 release. 2003-07-26 01:03:34 -04:00
Theodore Ts'o 3de5bf6106 probe.c (probe_udf): Add specific UDF probing code, and probe
UDF before checking for ISO9660 filesystems.
2003-07-22 01:06:36 -04:00
Theodore Ts'o 78e2edf796 probe.c (blkid_known_fstype): New function which returns true if
the filesystem type is one which this blkid library supports.
2003-07-21 19:42:19 -04:00
Theodore Ts'o a30b9446d1 probe.c: When revalidating a filesystem in the blkid library,
delete the LABEL tag if the filesystem no longer has a label.
2003-07-20 11:22:34 -04:00
Theodore Ts'o 849c610250 tag.c (blkid_find_dev_with_tag): If blkid_probe_all() returns an
error, then reflect that error upwards; don't try again
	(forever).  This prevents an infinite loop when /proc and
	the /etc/blkid.tab file are not present.
2003-07-18 19:10:28 -04:00
Theodore Ts'o 48e6e81362 Fixx gcc -Wall nitpicks. 2003-07-06 00:36:48 -04:00
Theodore Ts'o d339f2684d Makefile.in (ELF_OTHER_LIBS): The blkid library depends on the
uuid library.  (Addresses Debian bug: #194094)
2003-05-21 17:56:36 -04:00
Theodore Ts'o 71df0dc393 Update for 1.33 release.
Fix typo's in README.subset

Change debian control file so it doesn't bomb out if the EVMS FSIM
is not there, since it is not built on the Hurd.  Resolves Debian
bug #189687.
2003-04-21 16:17:09 -04:00
Theodore Ts'o 520ead378e Fix gcc -Wall warnings. 2003-04-19 13:48:27 -04:00
Theodore Ts'o 09a2ef8dda Fix XFS superblock definition. Add support to
extract UUID and labels for JFS and romfs.  (Thanks to
Janos Farkas <chexum@acomp.hu>.)
2003-04-03 00:04:28 -05:00
Theodore Ts'o 0faabe5dea getsize.c: #include stat.h for the Apple Darwin port 2003-03-30 23:08:32 -05:00
Theodore Ts'o 88fe61c7c3 cache.c: Initialize blkid_debug_mask to zero since some
operating systems can't deal with variables in the common
	section in shared libraries.
2003-03-17 18:13:57 -05:00
Theodore Ts'o aa75ecccab Fix the Apple Darwin port. 2003-03-17 10:01:22 -05:00
Theodore Ts'o 6cca7ba96d Update dependency information in Makefiles 2003-03-16 20:21:16 -05:00
Theodore Ts'o cd0d521b82 Fix bug; if a partition has no known type, don't derference a null
pointer and crash.
2003-03-06 12:58:03 -05:00
Theodore Ts'o ed78c021c3 Fix up lots of portability problems that caused e2fsprogs not to build successfully
under Solaris.
2003-03-06 11:09:18 -05:00
Theodore Ts'o 94ba8c7506 Changes to create a subset distribution which consists only of the
et, ss, uuid, and blkid libraries.  The configure script and top-level 
makefile were changed to support working with a subset distribution.
2003-03-02 02:07:14 -05:00
Theodore Ts'o 7e89304878 tag.c (blkid_set_tag): Fix bug; don't return an error when
deleting a tag by setting the value to NULL.  This
	caused a failed device verification to loop forever in
	blkid_verify_devname().
2003-03-01 22:57:31 -05:00
Theodore Ts'o 2859522002 Update libblkid documentation.
Fix tst_resolve to use latest blkid API's.
2003-03-01 20:01:27 -05:00
Theodore Ts'o ed1b33e8fb Minor bug fixes in the blkid library.
Convert mke2fs, fsck, and tune2fs to use the blkid library.
2003-03-01 19:29:01 -05:00
Theodore Ts'o 1549a44762 resolve.c (blkid_get_tag_value): Rename function (used to be
blkid_get_tagname_devname)
2003-02-27 19:33:36 -05:00
Theodore Ts'o 79dd234a79 Internal changes to the blkid library:
1) Only one tag with a particular name can be attached to a device
at a time.  This significantly simplifies the library, and was needed
to allow the cache file to be re-read and changes integrated into the 
in-core version of the data structure in a simpler fashion than earlier
versions of the library. 

2)  To accomodate this, the ext2/ext3 filesystems are now always tagged
as "ext2" type filesystems.  Ext3 filesystems are tagged with a 
SEC_TYPE tag with the value ext3.

3)  The new blkid_read_cache() function checks the mod time of the
cache file, and if the file has been changed since the last time the
cache file was read into memory, it is re-read.  This function is now
called before probing all of the devices in the system or searching
all devices in the cache for a specific tag value.

4)  After probing all devices, blkid_flush_cache() is called to write
out the cache file.  This assures that all of the hard work involved
in doing a blkid_probe_all() is saved to disk.
2003-02-22 17:15:20 -05:00
Theodore Ts'o f0a22d0fd3 Add dynamic debugging capabilities to the blkid library,
controlled by the environment variable BLKID_DEBUG. The debugging
code is enabled by a new configuration option, --enable-blkid-debug.
2003-02-22 13:19:53 -05:00
Theodore Ts'o 98999c399d Rename blkid_get_devname() to blkid_get_dev(), and blkid_get_token()
to blkid_get_devname().
2003-02-16 00:47:07 -05:00
Theodore Ts'o bc40efd3d0 Remove bid_id from the blkid device structure, as it is not used
for anything.
2003-02-14 01:40:23 -05:00
Theodore Ts'o ce72b862c5 Add a priority label to the device structure, so we can give
preference to EVMS and LVM devices when searching for a device
matching a particular LABEL or UUID in the blkid library.
2003-02-14 01:31:45 -05:00
Theodore Ts'o 50b380b4d4 Wholesale changes to blkid library to simplify the implementation
and shrink its size.  Change library version to be 1.0.
2003-02-12 23:51:21 -05:00
Theodore Ts'o 76b07bb1bc Roto-till and clean up libblkid API.
read.c (parse_tag): Do not return that blkid_tag when parsing
	the blkid.tag file.

resolve.c (blkid_get_token, blkid_get_tagname_devname): Fold in
	code from removed functions

tag.c (blkid_create_tag): Don't return the newly tag strcture
	any more, as it's not needed.
	(blkid_find_tag_cache, blkid_get_tag_cache,
	 blkid_token_to_tag, blkid_find_tv_tags): Remove these 
	functions, as they are either only used once or have
	interfaces that should be deprecated.
	(blkid_find_tag_dev, blkid_find_head_cache): Replace use
	of blkid_tag with one or two const char * type/value
	arguments.
	(blkid_find_dev_with_tag): Fold in code from removed functions

probe.h, probe.c: Use a more sophisticated set of byte-swapping
	routines which are more compact and efficient.  Drop
	calculation of bid_free, since it's unnecessary.  Avoid 

save.c (blkid_save_cache): Set the permissions on the blkid
	cache file to 644.
2003-01-27 01:09:24 -05:00
Theodore Ts'o 7a603aa89f Separate public and private interfaces into separate header files.
Start separating internal implementation details from the
publically exported interface of the blkid library.
2003-01-26 01:54:39 -05:00
Theodore Ts'o 0f3ac480c7 devname.c: Add support for EVMS to the blkid library. 2003-01-25 18:44:33 -05:00
Theodore Ts'o d3f917989b Fix gcc -Wall nits. 2003-01-25 00:26:48 -05:00
Theodore Ts'o 3a1d6f3cc0 save.c (blkid_save_cache): Use mkstemp() instead mktemp(). 2003-01-24 23:11:29 -05:00
Theodore Ts'o e12f2ae74c Integrate new blkid library. 2003-01-23 16:45:16 -05:00