summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2010-03-15mount: report ambivalent FS detection, improve brute force detectionKarel Zak1-9/+24
The ambivalent probing result should be properly reported and user should be informed that the problem is possible to bypass by "-t <type>" or resolved by wipefs(8). The mount(8) command uses a brute force stage (calls mount(2) for all /{proc,etc}/fylesystems) if there is not any other way how to detect the filesystem type. The brute force stage should not be restricted by libblkid. It's possible that libblkid is not able to detect slightly corrupted filesystem, but kernel is able to mount such filesystem. Note that the brute force stage should not be used if libblkid returns ambivalent probing result. In this case user's intervention is required (e.g. mount -t <type>). Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-11lib: use fstat() as fallback in blkdev_get_size()Karel Zak1-0/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-10lib: add mangle.c for mtab (fstab or swaps) encodingKarel Zak2-1/+118
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-10liblkid: move getsize.c code to lib/Karel Zak1-8/+79
.. and cleanup blkdev_get_size() usage in libblkid. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-02-12build-sys: remove duplicate #includesKarel Zak1-1/+0
$ make checkincludes fsck/fsck.c: errno.h is included more than once. lib/canonicalize.c: string.h is included more than once. shlibs/blkid/src/blkidP.h: stdio.h is included more than once. shlibs/blkid/src/devname.c: string.h is included more than once. shlibs/blkid/src/devno.c: string.h is included more than once. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-01-18Merge branch 'stable/v2.16'LaMont Jones1-1/+1
Conflicts: AUTHORS NEWS configure.ac debian/changelog disk-utils/fsck.minix.c po/ca.po po/cs.po po/da.po po/de.po po/es.po po/et.po po/eu.po po/fi.po po/fr.po po/hu.po po/id.po po/it.po po/ja.po po/nl.po po/pl.po po/pt_BR.po po/ru.po po/sl.po po/sv.po po/tr.po po/uk.po po/util-linux-ng.pot po/vi.po po/zh_CN.po shlibs/blkid/src/probe.c shlibs/blkid/src/superblocks/iso9660.c shlibs/blkid/src/superblocks/vfat.c
2009-12-21Merge remote branch 'origin/master'LaMont Jones1-1/+1
2009-12-10lib: bug (typo) in function MD5Final()Karel Zak1-1/+1
On Wed, Dec 09, 2009 at 10:08:38PM +0000, Jochen Voss wrote: > while experimenting with coccinelle, I accidentally found what I > believe is a bug in util-linux-ng release 2.17-rc2 (downloaded > today). The problem is the following code in lib/md5.c (around line > 153): > > void MD5Final(unsigned char digest[16], struct MD5Context *ctx) > { > [...] > memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ > } > > The third argument of memset should probably be the size of 'struct > MD5Context' instead of the size of the pointer. So my guess is > that the memset line should be > > memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ > > instead. I don't know whether this actually causes a problem, > but the comment makes it seem possible that it does. Note, this typo does not have any impact on the utils in the util-linux-ng project, because we don't use MD5 for any security sensitive data or cryptographic stuff. The typo also does not have any impact to the final MD5 hashes. Reported-by: Jochen Voss <voss@seehuhn.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2009-12-06Merge remote branch 'origin/stable/v2.16' into stable/v2.16LaMont Jones1-3/+0
2009-11-30lib: fix file descriptor leak in is_mounted()Theodore Ts'o1-3/+0
Remove an extraneous fopen() that leaks memory and a file descriptor. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-04Merge remote branch 'origin/master'LaMont Jones3-9/+53
2009-10-27build-sys: add HAVE_LIBBLKID_INTERNALKarel Zak1-4/+4
It's better to use one macro for all situations where we depends on in-tree (internal) libblkid. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-26mount: and libblkid: covert /dev/dm-N to /dev/mapper/<name>Karel Zak1-4/+44
* mount(8) uses private device-mapper names in mtab * libblkid returns private device-mapper names when evaluate udev /dev/disk-by symlinks. * on systems where DM is fully integrated with udev the /dev/mapper/<name> files are symlinks to /dev/dm-N. It means we need a special care to hide private device-mapper names. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-22libblkid: use BLKSSZGET for GPT sectorsKarel Zak1-1/+5
The current implementation uses fixed sector size (512 bytes), that's wrong. UEFI standard requires real logical sector size -- it means BLKSSZGET for Linux. The size of GPT header is not static, but whole sector is allocated for the header. In theory the HeaderSize field could be greater than sizeof(struct gpt_header). It means we have to read whole sector with the header, because the header crc32 checksum is counted according to HeaderSize. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-19Merge remote branch 'origin/master'LaMont Jones1-70/+232
Conflicts: mount/lomount.c
2009-10-14lib: import whole ismounted.c code from e2fsprogsKarel Zak1-70/+232
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-10Merge remote branch 'origin/master'LaMont Jones3-297/+1
2009-10-05Merge branch 'for_upstream' of ↵Karel Zak1-3/+0
git://git.kernel.org/pub/scm/utils/util-linux-ng/tytso/util-linux-ng
2009-10-03lib: fix file descriptor leak in is_mounted()Theodore Ts'o1-3/+0
Remove an extraneous fopen() that leaks memory and a file descriptor. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-30lib: fix lib/Makefile.am (remove pttype.c)Karel Zak1-1/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-09-29lib: remove pttype.cKarel Zak2-293/+1
The libblkid library supports partition tables detection now. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-09-22Merge commit 'origin/master'LaMont Jones2-3/+122
Conflicts: mount/mount.8
2009-09-17versionsort() prototype changedScott James Remnant1-1/+1
2009-09-16lib: add a generic crc32()Karel Zak1-0/+116
This is public domain implementation, based on static crc32_table[]. This implementation is used on may places (libparted, FreeBSD kernel, PostgreSQL, ...). The Linux kernel uses on-the-fly generated and allocated tables. That's useless in shared libraries. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-09-16libblkid: use the new API in whole u-l-ngKarel Zak1-3/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-08-13NMUAurelien Jarno1-1/+1
2009-07-24Only check for ENOMEDIUM when ENOMEDIUM is defined.Cyril Brulebois1-0/+5
ENOMEDIUM is Linux-only. On other systems, the open call on a CD-ROM device without any medium may be successful and a subsequent read may return EINVAL instead. Let's just break out of the loop if ENOMEDIUM isn't defined. Signed-off-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: LaMont Jones <lamont@debian.org>
2009-07-21Merge commit 'origin/master'LaMont Jones1-152/+7
Conflicts: AUTHORS NEWS config/include-Makefile.am configure.ac mount/lomount.c po/POTFILES.in po/ca.po po/cs.po po/da.po po/de.po po/es.po po/et.po po/eu.po po/fi.po po/fr.po po/hu.po po/id.po po/it.po po/ja.po po/nl.po po/pl.po po/pt_BR.po po/ru.po po/sl.po po/sv.po po/tr.po po/uk.po po/util-linux-ng.pot po/vi.po po/zh_CN.po
2009-05-29mount: use TAG parsing function from libblkidKarel Zak1-22/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-29Merge commit 'origin/stable/v2.15' into stable/v2.15LaMont Jones1-0/+4
2009-05-27build-sys: fix blkid.h include for old e2fsprogsKarel Zak1-0/+4
When building util-linux-ng-2.15, I get this: ../lib/fsprobe.c:10:19: error: blkid.h: No such file or directory Unfortunately, the blkid.pc uses -I${includedir}/blkidi since e2fsprogs v1.41.2. The old versions use -I${includedir} only. Reported-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22mount: (and fsck) remove libvolume_id supportKarel Zak1-130/+3
The libvolume_id is deprecated in favor of libblkid. The libblkid from u-l-ng provides the same functionality as libvolume_id. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-11build-sys: fix blkid.h include for old e2fsprogsKarel Zak1-0/+4
When building util-linux-ng-2.15, I get this: ../lib/fsprobe.c:10:19: error: blkid.h: No such file or directory Unfortunately, the blkid.pc uses -I${includedir}/blkidi since e2fsprogs v1.41.2. The old versions use -I${includedir} only. Reported-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-07Merge commit 'origin/master'LaMont Jones1-7/+7
2009-04-29blkid: rename blkid_evaluate_spec to blkid_evaluate_tagKarel Zak1-7/+7
"SPEC" is usually used in mount(8) as a generic term for device name or tag (LABEL, UUID). The function blkid_evaluate_* works with TAGs only. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-22Merge commit 'origin/master'LaMont Jones1-1/+0
2009-04-20lib: do not include <linux/fd.h> in ismounted.cAurelien Jarno1-1/+0
<linux/fd.h> is included for no reason in lib/ismounted.c. This obviously breaks on non-Linux systems. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-03-20Merge commit 'origin/master'LaMont Jones8-8/+1105
Conflicts: NEWS config/include-Makefile.am configure.ac mount/Makefile.am mount/mount.c po/ca.po po/cs.po po/da.po po/de.po po/es.po po/et.po po/eu.po po/fi.po po/fr.po po/hu.po po/id.po po/it.po po/ja.po po/nl.po po/pl.po po/pt_BR.po po/ru.po po/sl.po po/sv.po po/tr.po po/uk.po po/util-linux-ng.pot po/vi.po po/zh_CN.po
2009-03-16lib: fsprobe - fix gcc warningKarel Zak1-1/+1
lib/fsprobe.c: In function ‘fsprobe_get_fstype_by_devname’: lib/fsprobe.c:243: warning: return discards qualifiers from pointer target type Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-12lib: wholedisk - extend API, add test programKarel Zak3-16/+40
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-12lib: pttype - extend the API to work with file descriptorsKarel Zak1-7/+15
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-12lib: pttype: fix DOS detectionKarel Zak1-7/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-12lib: pttype: add BSD subpartitions supportKarel Zak1-2/+26
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-12lib: add pttype.c for PT types detectionKarel Zak3-2/+264
This is a small fragment from libdisk (from xfsprogs). The final solution will be to move the library to util-linux-ng. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-11lib: add is_whole_disk() from fdisk codeKarel Zak1-0/+31
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-03lib: fix fsprobe wrapper (const char * is nonsense)Karel Zak1-21/+21
The fsprobe_ functions return newly allocated strings. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-03lib: gcc warning in fix fsprobeKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-18build-sys: add fsck binary to .gitignoreKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-18tests: add fsck:ismounted reg.testKarel Zak1-4/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-18lib: add test_ismounted for regression testKarel Zak3-6/+8
Signed-off-by: Karel Zak <kzak@redhat.com>