Commit Graph

2845 Commits

Author SHA1 Message Date
Karel Zak fb9d90d552 libmount: fix parsing of mountinfo from 2.6.39
The /proc/self/mountinfo file uses " - " field as a separator between
optional fields and next fields in the file. The '-' char could be
used in the fields (for example in UUIDs), so it's necessary to check
for whole " - " string rather than for '-' char only.

Reported-by: "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-05 14:17:51 +02:00
Karel Zak c738bc32a4 build-sys: fix distcheck for term-utils
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-04 10:53:07 +02:00
Karel Zak 2a1d943dab libmount: add mountpoint(1) implementation to samples/ 2011-04-01 14:17:51 +02:00
Karel Zak f19c952b2f umount: use helper= for all UIDs
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-01 09:03:39 +02:00
Karel Zak a362ae601a libmount: support /run/mount rather than /dev/.mount
The /run directory should be preferred on distributions where this
directory exists.

http://thread.gmane.org/gmane.linux.redhat.fedora.devel/146976

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 21:26:57 +02:00
Karel Zak cafeed6724 tests: add dump from PPC64 to lscpu tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 14:47:45 +02:00
Karel Zak c487c90ccd lscpu: detect sun4{u,v} in /proc/cpuinfo for sparc64
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 14:30:06 +02:00
Karel Zak 2b9ced6859 tests: add dump from UltraSparc T1 to lscpu tests
Thanks to Jan Engelhardt.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 14:12:35 +02:00
Karel Zak fa043039e9 tests: add dump from huge ia64 to lscpu tests
Thanks to Jan Engelhardt.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 14:11:26 +02:00
Karel Zak 4e740fd81a lscpu: fix op-mode for /{sys,proc} dumps
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 13:09:50 +02:00
Karel Zak e282eec2a2 lscpu: fix threads-per-core calculation
On Thu, Mar 24, 2011 at 01:45:34PM +0100, Jan Engelhardt wrote:
> On a 24-thread/6-core SPARC T1, lscpu would wrongly output "5
> threads per core".
>
> It seems that the 6c T1 is simply an 8c T1 where 2c are disabled
> (offering a lesser model for a lower price, and all that marketing
> fluff). So the machine description header of the 6c T1 reports 32
> threads, but only goes on to provide 24 elements thereafter, which
> is why Linux will report threads 24-31 as "offline". So far so good.
>
> But lscpu would take the number of all (online and offline) threads
> (32) and divides it by the number of online cores (6), which yields
> an odd 5.33 threads/core.
>
> Simply pick the number of online threads.

Based on Jan's patch.

Reported-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 12:55:13 +02:00
Karel Zak f0fc846a53 login: fix checktty test to compile with old glibc
Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 11:39:01 +02:00
Petr Uzel b192b7b9a6 libmount: plug memory leak in sample program
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 00:05:01 +02:00
Petr Uzel 6ad929bbac libmount: fix some typos and copy&paste mistakes in comments
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-03-31 00:01:33 +02:00
Karel Zak 2b6bd96f2b libmount: fix memory leak in cache
Reported-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 23:52:56 +02:00
Karel Zak 4b658e0997 libmount: add phelper= support
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 15:40:56 +02:00
Karel Zak afa2dd4215 mount: add phelper=
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 14:56:33 +02:00
Karel Zak 6f5788c592 libmount: small lock code cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 13:58:04 +02:00
Karel Zak 66bb826710 libmount: use chdir() and NOFOLLOW umount flag for umount operation
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 13:00:03 +02:00
Karel Zak a2c90d998e libmount: fix test
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 12:39:24 +02:00
Karel Zak 701b48cf01 libmount: cleanup umount code
This patch removes obsolete stuff. The minimal requirement for
libmount umount code is Linux >= 2.4.11.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 11:30:23 +02:00
Karel Zak 5976114f62 libmount: block signals when writing to mtab
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 09:30:05 +02:00
Karel Zak 1bc386e513 docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 00:27:29 +02:00
Karel Zak 94b7e03d4f docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 00:10:00 +02:00
Sergey Gusarov 305a612251 blkid: small fix for safe_print()
This small fix makes it possible to print the first unprintable character
with code 128 from ASCII table.

Signed-off-by: Sergey Gusarov <laborer2008@gmail.com>
2011-03-29 17:07:24 +02:00
Karel Zak b7cdab2a47 umount: use UMOUNT_NOFOLLOW for non-root users
The UMOUNT_NOFOLLOW umount2() flag is supported since kernel 2.6.34.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-29 17:01:59 +02:00
Karel Zak 36a74e1b45 blkid: add -d option to print non-printable chars
Reported-by: laborer2008 laborer <laborer2008@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-29 11:44:29 +02:00
Karel Zak 741a5b1085 partx: add fallback for openat() to be usable on old systems
Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-29 10:45:57 +02:00
Davidlohr Bueso 7cf78990fc include: [c.h] add definition wrappers for old libc versions
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-29 10:35:40 +02:00
Karel Zak 7cf389f735 libmount: fix leak in sample program
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-28 23:28:45 +02:00
Karel Zak c570f567eb libmount: create a default lock for mtab update
Now it's necessary to explicitly create a lock for mnt_update_table().
It seems better to create the lock in mnt_update_table() by default to
skip this extra step.

Reported-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-28 12:40:24 +02:00
Sami Kerola cc3c3fdd29 build-sys: do not ignore datarootdir
Fix to the ./configure warning which has been printed since
autotools version 2.59c (released at April 2006).

WARNING:  'po/Makefile.in.in' seems to ignore the --datarootdir setting

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-22 10:17:50 +01:00
Karel Zak c48b9ce9ea docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-22 10:11:26 +01:00
Karel Zak f9eec41838 lib: [fsprobe.c] fix blkid_evaluate_spec() call
lib/fsprobe.c:56:2: warning: passing argument 2 of ‘blkid_evaluate_spec’ from incompatible pointer type
shlibs/blkid/src/blkid.h:189:14: note: expected ‘struct blkid_struct_cache **’ but argument is of type ‘blkid_cache’

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-22 09:54:57 +01:00
Karel Zak 95cc3573e1 ddate: use ARRAY_SIZE
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-18 10:27:09 +01:00
Karel Zak 2534eb3003 ddate: remove non-ascii chars from ddate
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-18 10:25:42 +01:00
Karel Zak 127b12dcf6 tailf: support --lines 0
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-18 09:52:07 +01:00
Karel Zak 5af1532e05 libmount: rename mount option "quiet" to "silent"
See commit 2ac1890aa0.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-18 09:21:32 +01:00
Karel Zak 112b3813d2 fdisk: check index before access to array [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-17 22:58:05 +01:00
Karel Zak 5298f72839 libblkid: add blkid_evaluate_spec()
The function blkid_evaluate_tag() is useful for tags only (e.g.
LABEL=foo). But we also need to address devices by tags OR paths in
many utils.

The function blkid_evaluate_spec() support this functionality without
extra care about the way how device is addressed. The tags as well as
paths are converted to the standardized device path.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-17 12:51:06 +01:00
Karel Zak 70cc35de73 lib: [fsprobe.c] remove obsolete <blkid/blkid.h>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-16 17:48:47 +01:00
Karel Zak 64d15476c0 build-sys: don't use HAVE_LIBBLKID_INTERNAL macro
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-16 17:45:53 +01:00
Karel Zak b98ae9c2e8 build-sys: clean up partx Makefile
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-16 17:39:54 +01:00
Karel Zak b1ef3ad66b build-sys: don't support external (e2fsprogs) libblkid
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-16 17:31:50 +01:00
Karel Zak 7ee96990c0 build-sys: include <uuid.h> rather than <uuid/uuid.h>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-16 17:04:21 +01:00
Karel Zak 403e2d0c02 build-sys: don't support external (e2fsprogs) libuuid
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-16 17:03:48 +01:00
Karel Zak b9eb3c1131 lib: [fsprobe.c] use internal libblkid only
fsck, mount and swapon will be compilable with libblkid from
util-linux package. The old libblkid from e2fsprogs will not be
supported.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-16 16:22:36 +01:00
Karel Zak 7e256156f4 libblkid: use blkid_probe_get_buffer() more carefully
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-16 14:06:23 +01:00
Karel Zak b872926713 Revert "umount: call /sbin/umount.<uhelper> for root user too"
This reverts commit c562266973.
2011-03-15 13:59:55 +01:00
Karel Zak c562266973 umount: call /sbin/umount.<uhelper> for root user too
Originally the "uhelper=" was ignored for root, now the umount command
calls /sbin/umount.<uhelper> always.

This change is necessary for things like pam_mount where a device has
to be uninitialized by uhelper rather than directly umounted by
umount(2).

Note that all uhelpers has to be linked with libmount or execute

	umount -fake -i /mountpoint

to remove mountpoint entry from /etc/mtab or /dev/.mount/utab.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-15 10:31:06 +01:00