]> err.no Git - util-linux/log
util-linux
15 years agolibblkid: topology - ignore non-blockdevs
Karel Zak [Mon, 19 Oct 2009 13:39:31 +0000 (15:39 +0200)]
libblkid: topology - ignore non-blockdevs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add support for topology ioctls
Karel Zak [Mon, 19 Oct 2009 13:33:00 +0000 (15:33 +0200)]
libblkid: add support for topology ioctls

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agodocs: add 'unshare' and 'wipefs' to AUTHORS
Karel Zak [Mon, 19 Oct 2009 09:26:12 +0000 (11:26 +0200)]
docs: add 'unshare' and 'wipefs' to AUTHORS

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agodocs: update AUTHORS file
Karel Zak [Mon, 19 Oct 2009 08:59:15 +0000 (10:59 +0200)]
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopo: merge changes
Karel Zak [Mon, 19 Oct 2009 08:55:17 +0000 (10:55 +0200)]
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopo: update po/POTFILES.in
Karel Zak [Mon, 19 Oct 2009 08:53:52 +0000 (10:53 +0200)]
po: update po/POTFILES.in

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopo: update vi.po (from translationproject.org)
Clytie Siddall [Mon, 19 Oct 2009 08:45:58 +0000 (10:45 +0200)]
po: update vi.po (from translationproject.org)

15 years agopo: update ja.po (from translationproject.org)
Makoto Kato [Mon, 19 Oct 2009 08:45:58 +0000 (10:45 +0200)]
po: update ja.po (from translationproject.org)

15 years agopo: update id.po (from translationproject.org)
Arif E. Nugroho [Mon, 19 Oct 2009 08:45:58 +0000 (10:45 +0200)]
po: update id.po (from translationproject.org)

15 years agopo: update fr.po (from translationproject.org)
Nicolas Provost [Mon, 19 Oct 2009 08:45:58 +0000 (10:45 +0200)]
po: update fr.po (from translationproject.org)

15 years agopo: update fi.po (from translationproject.org)
Lauri Nurmi [Mon, 19 Oct 2009 08:45:58 +0000 (10:45 +0200)]
po: update fi.po (from translationproject.org)

15 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Mon, 19 Oct 2009 08:45:58 +0000 (10:45 +0200)]
po: update cs.po (from translationproject.org)

15 years agoinitctl: fix strict-aliasing bugs
Karel Zak [Fri, 16 Oct 2009 21:37:22 +0000 (23:37 +0200)]
initctl: fix strict-aliasing bugs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agomkfs.minix: fix strict-aliasing bugs
Karel Zak [Fri, 16 Oct 2009 20:13:14 +0000 (22:13 +0200)]
mkfs.minix: fix strict-aliasing bugs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofsck.minix: fix strict-aliasing bugs
Karel Zak [Fri, 16 Oct 2009 20:08:35 +0000 (22:08 +0200)]
fsck.minix: fix strict-aliasing bugs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofdisk: fix strict-aliasing bugs
Karel Zak [Fri, 16 Oct 2009 19:49:33 +0000 (21:49 +0200)]
fdisk: fix strict-aliasing bugs

gcc 4.4 produces tons of

  "dereferencing type-punned pointer will break strict-aliasing rules"

warnings for fdisk code where is

  char buffer[BUFSIZ];

  ((struct disklabel *) MBRBuffer)->foo

There are two ways how fix the problem:

  1/ union {
          char buffer[BUFSIZ], struct disklabel label
     } MBRBuffer;

  2/ use allocated buffer, this way seems less invasive.

This patch implements 2/.

Old version:
  $ make -C fdisk | grep -c warning
  236

New version:
  $ make -C fdisk | grep -c warning
  0

About aliasing:
 - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40665
 - http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html
 - C99

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoRevert "build-sys: move fsck/mkfs for bfs/cramfs/minix to /usr"
Karel Zak [Fri, 16 Oct 2009 20:53:12 +0000 (22:53 +0200)]
Revert "build-sys: move fsck/mkfs for bfs/cramfs/minix to /usr"

See http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/2689/focus=2690

This reverts commit d4fa971c42467fb69e5d89d28e1b98c491a1505a.

15 years agofdisk: sgi label - remove duplicate swab16swab[16,32]() definitions
Karel Zak [Fri, 16 Oct 2009 09:43:02 +0000 (11:43 +0200)]
fdisk: sgi label - remove duplicate swab16swab[16,32]() definitions

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add support for VMFS (VMware File System)
Mike Hommey [Fri, 16 Oct 2009 07:26:07 +0000 (09:26 +0200)]
libblkid: add support for VMFS (VMware File System)

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: update docs/.gitignore
Karel Zak [Fri, 16 Oct 2009 08:21:44 +0000 (10:21 +0200)]
libblkid: update docs/.gitignore

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add missing packed attributes
Karel Zak [Fri, 16 Oct 2009 00:34:28 +0000 (02:34 +0200)]
libblkid: add missing packed attributes

This patch add __attribute__((packed)) to almost all superblock and
disk label definitions. Well, in many cases this is not necessary, but
it's a cheap way how to keep the code robust...

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoinclude: use c.h in canonicalize.h
Karel Zak [Thu, 15 Oct 2009 23:45:42 +0000 (01:45 +0200)]
include: use c.h in canonicalize.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agonamei: use c.h
Karel Zak [Thu, 15 Oct 2009 23:44:33 +0000 (01:44 +0200)]
namei: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: use c.h in samples
Karel Zak [Thu, 15 Oct 2009 23:43:07 +0000 (01:43 +0200)]
libblkid: use c.h in samples

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agosetterm: use c.h, remove tailing whitespace
Karel Zak [Thu, 15 Oct 2009 23:40:58 +0000 (01:40 +0200)]
setterm: use c.h, remove tailing whitespace

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agonewgrp: use c.h, remove tailing whitespace
Karel Zak [Thu, 15 Oct 2009 23:38:29 +0000 (01:38 +0200)]
newgrp: use c.h, remove tailing whitespace

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agohwclock: use c.h
Karel Zak [Thu, 15 Oct 2009 23:37:09 +0000 (01:37 +0200)]
hwclock: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopartx: use c.h
Karel Zak [Thu, 15 Oct 2009 23:35:55 +0000 (01:35 +0200)]
partx: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolosetup: remove unused macro
Karel Zak [Thu, 15 Oct 2009 23:34:20 +0000 (01:34 +0200)]
losetup: remove unused macro

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agocal: use c.h
Karel Zak [Thu, 15 Oct 2009 23:32:28 +0000 (01:32 +0200)]
cal: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agokill: use c.h
Karel Zak [Thu, 15 Oct 2009 23:28:41 +0000 (01:28 +0200)]
kill: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofdisk: use c.h
Karel Zak [Thu, 15 Oct 2009 23:26:46 +0000 (01:26 +0200)]
fdisk: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agosfdisk: use c.h, remove obsolete #ifdefs
Karel Zak [Thu, 15 Oct 2009 23:15:19 +0000 (01:15 +0200)]
sfdisk: use c.h, remove obsolete #ifdefs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblockdev: use c.h
Karel Zak [Thu, 15 Oct 2009 23:05:45 +0000 (01:05 +0200)]
blockdev: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agochrt: use c.h
Karel Zak [Thu, 15 Oct 2009 23:01:48 +0000 (01:01 +0200)]
chrt: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoldattach: use c.h
Karel Zak [Thu, 15 Oct 2009 23:00:27 +0000 (01:00 +0200)]
ldattach: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: use c.h
Karel Zak [Thu, 15 Oct 2009 22:58:53 +0000 (00:58 +0200)]
libblkid: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoinclude: add c.h with fundamental C definitions
Karel Zak [Thu, 15 Oct 2009 22:42:22 +0000 (00:42 +0200)]
include: add c.h with fundamental C definitions

Add:
  * ARRAY_SIZE with array type check
  * PATH_MAX, TRUE and FALSE macros
  * dummy __attribute__ for non-gcc compilers

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agotests: update fsck.ismounted test
Karel Zak [Thu, 15 Oct 2009 21:37:34 +0000 (23:37 +0200)]
tests: update fsck.ismounted test

The latest version of the lib/test_ismounted binary returns absolute
mountpoint path too. This patch removes the path from test output (the
path is variable).

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: fix typo s/Hihg/High/
Jim Meyering [Thu, 15 Oct 2009 13:28:58 +0000 (15:28 +0200)]
libblkid: fix typo s/Hihg/High/

* shlibs/blkid/docs/libblkid-docs.xml

Signed-off-by: Jim Meyering <meyering@redhat.com>
15 years agolibblkid: add note about UUID_SUB, increment number of superblock values
Karel Zak [Thu, 15 Oct 2009 13:20:38 +0000 (15:20 +0200)]
libblkid: add note about UUID_SUB, increment number of superblock values

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofsck.minix: fix broken zone checking
Karel Zak [Thu, 15 Oct 2009 12:14:32 +0000 (14:14 +0200)]
fsck.minix: fix broken zone checking

This bug has been introduced by commit
95356e8b744439336925eeb36f01399f1ee8a5e9.

The fsck.minix code assumes that isset() macro returns boolean,
unfortunately the generic implementation from libc returns integer.

This patch also add a fallback for the bitmap macros to include/bitops.h.

Reported-by: "Andries E. Brouwer" <Andries.Brouwer@cwi.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblockdev: fix topology ioctls
Karel Zak [Thu, 15 Oct 2009 00:32:03 +0000 (02:32 +0200)]
blockdev: fix topology ioctls

 kernel 2.6.32-rc4 (kvm):

 # blockdev -v --getss --getpbsz --getiomin --getioopt --getmaxsect --getalignoff   /dev/sda
 get logical block (sector) size: 512
 get physical block (sector) size: 512
 get minimum I/O size: 512
 get optimal I/O size: 0
 get max sectors per request: 1024
 get alignment offset: 0

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblockdev: add topology ioctls support
Karel Zak [Wed, 14 Oct 2009 23:22:42 +0000 (01:22 +0200)]
blockdev: add topology ioctls support

new options:

   --getpbsz                      get physical block (sector) size
   --getiomin                     get minimum I/O size
   --getioopt                     get optimal I/O size
   --getalignoff                  get alignment offset
   --getmaxsect                   get max sectors per request

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblockdev: add support for uint and ushort ioctls
Karel Zak [Wed, 14 Oct 2009 22:06:07 +0000 (00:06 +0200)]
blockdev: add support for uint and ushort ioctls

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblockdev: refactoring (better commands definition)
Karel Zak [Wed, 14 Oct 2009 21:57:52 +0000 (23:57 +0200)]
blockdev: refactoring (better commands definition)

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: add pretty output, document -L incompatibility with e2fsprogs
Karel Zak [Wed, 14 Oct 2009 00:17:27 +0000 (02:17 +0200)]
blkid: add pretty output, document -L incompatibility with e2fsprogs

... sad story, I have temporary disabled pretty-output code
in very early version of blkid.c in u-l-ng. (It was also in
time when pretty-output was very new feature in e2fsprogs.)

Unfortunately, the -L option (shortcut to "-o list") in u-l-ng version
was reused for for any other functionality few months later.... this
stupid thing was released in u-l-ng 2.15 and 2.16 without any negative
feedback from users.

It means the blkid from u-l-ng is not backwardly compatible with
the original version from e2fsprogs. The -L option has a different
meaning there.

I'm sorry about this bug...

This patch:

  * enable pretty-output (-o line)
  * add a note about incompatibility between u-l-ng and e2fsprogs
    to blkid.8 man page

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: import whole ismounted.c code from e2fsprogs
Karel Zak [Tue, 13 Oct 2009 23:13:18 +0000 (01:13 +0200)]
lib: import whole ismounted.c code from e2fsprogs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agohwclock: set kernel timezone with --systz --utc
Scott James Remnant [Thu, 24 Sep 2009 19:17:23 +0000 (12:17 -0700)]
hwclock: set kernel timezone with --systz --utc

Even though --systz doesn't need to change the system clock when the
hardware clock is in UTC time (--systz --utc), it does need to set
the kernel timezone so that FAT timestamps, etc. will be correct.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
15 years agotests: swapon workaround for libtool wrapper
Karel Zak [Tue, 13 Oct 2009 13:37:49 +0000 (15:37 +0200)]
tests: swapon workaround for libtool wrapper

The swapon command behaviour depends on program name (argv[0] = swapon
| swapoff). It means we cannot use the libtool wrapper script in our
regression tests. It seems better to call the binaries directly with
proper LD_LIBRARY_PATH. This is probably less portable, but good
enough for our tests.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: more robust progname probing
Karel Zak [Tue, 13 Oct 2009 12:22:33 +0000 (14:22 +0200)]
swapon: more robust progname probing

Currently, the 'swapoff' is the default behavior. It means that if you
have a libtool wrapper script in your build directory the executed binary
name is 'lt-swapon' and then "swapon -a" is interpreted as "swapoff -a".

Any random argv[0] should not be interpreted as "swapoff".

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: handle <=linux-2.6.19 bug in /proc/swaps
Mike Frysinger [Tue, 13 Oct 2009 10:05:19 +0000 (06:05 -0400)]
swapon: handle <=linux-2.6.19 bug in /proc/swaps

Linux <=2.6.19 contained a bug in the /proc/swaps code where the header
would not be displayed (the first line).  Most people report the issue as
a sequence of swapon/swapoff calls to trigger, but for some lucky people,
it triggers all the time at initial boot.  Since this throws up an error,
init systems don't actually activate any swap files.

First, swapon shouldn't whine about unexpected format if the file is empty
(the default at boot).  This is easy to do by putting the warning behind a
check to ferror().

Second, we can detect that the first line isn't actually the header but
instead is a valid swap line and so need to be processed.  This assumes
that the first line will always be the same format.  Looking quickly at
older versions shows that this header has retained its exact format since
at least Linux 2.2.0 and considering the concern that goes along with proc
files and the ABI, it's highly unlikely it will ever change.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years agohwclock: do not access hardware clock when using --systz
Scott James Remnant [Thu, 24 Sep 2009 18:59:33 +0000 (11:59 -0700)]
hwclock: do not access hardware clock when using --systz

When using --systz we do not read from the hardware clock, so there
is no need to search for a hardware clock.  Indeed, we may be running
hwclock --systz before /dev is mounted.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
15 years agobuild-sys: clean up gtk-doc usage
Karel Zak [Mon, 12 Oct 2009 12:14:56 +0000 (14:14 +0200)]
build-sys: clean up gtk-doc usage

Currently gtk-doc is optional. Unfortunately, the ./configure script
still depends on GTK_DOC_CHECK macro and shlibs/blkid/docs/Makefile.am
depends on gtk-doc.make.

It seems that the best solution is to add gtk-doc.[make,m4] files to
the repository.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: fix typo on swapon.8 manpage
Florentin Duneau [Sun, 11 Oct 2009 00:45:42 +0000 (18:45 -0600)]
swapon: fix typo on swapon.8 manpage

Addresses-Debian-Bug: 487497
Signed-off-by: LaMont Jones <lamont@debian.org>
15 years agobuild-sys: move fsck/mkfs for bfs/cramfs/minix to /usr
Mike Frysinger [Sun, 11 Oct 2009 00:07:16 +0000 (20:07 -0400)]
build-sys: move fsck/mkfs for bfs/cramfs/minix to /usr

The bfs/cramfs/minix rarely (if ever?) are used for root filesystems, so
it doesn't make much sense to keep them in the root partition.  Move them
to /usr by default.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years agonamei: better mount points detection
Karel Zak [Fri, 9 Oct 2009 14:26:45 +0000 (16:26 +0200)]
namei: better mount points detection

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswitch_root: remove TIOCSCTTY and setsid()
Karel Zak [Fri, 9 Oct 2009 13:00:38 +0000 (15:00 +0200)]
switch_root: remove TIOCSCTTY and setsid()

requested by dracut developers because:

   bash: cannot set terminal process group (-1): Inappropriate ioctl for device

Addresses-Red-Hat-Bug: #519237
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoRemove now unused <sys/ioctl.h> includes
Guillem Jover [Thu, 8 Oct 2009 11:40:14 +0000 (13:40 +0200)]
Remove now unused <sys/ioctl.h> includes

Those became unused with the switch to the blkdev functions.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
15 years agocal: remove obsolete <localeinfo.h> include
Guillem Jover [Thu, 8 Oct 2009 11:40:13 +0000 (13:40 +0200)]
cal: remove obsolete <localeinfo.h> include

The fact that the system does not have <langinfo.h> does not imply that
it has <localeinfo.h> (which is an ancient header from Linux libc4).

Signed-off-by: Guillem Jover <guillem@hadrons.org>
15 years agoipcs: use __GLIBC__ instead of obsolete __GNU_LIBRARY__
Guillem Jover [Thu, 8 Oct 2009 11:40:12 +0000 (13:40 +0200)]
ipcs: use __GLIBC__ instead of obsolete __GNU_LIBRARY__

The latter is obsolete and it's currently defined to 6 for historical
reasons (as per comment in <features.h>) instead of 2 as what would be
expected.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
15 years agobuild-sys: check for union semun instead of using _SEM_SEMUN_UNDEFINED
Guillem Jover [Thu, 8 Oct 2009 11:40:11 +0000 (13:40 +0200)]
build-sys: check for union semun instead of using _SEM_SEMUN_UNDEFINED

Older versions of glibc used to declare ‘union semun’ in <sys/sem.h>,
but POSIX.1-2001 requires the caller to declare it instead. Later
versions of glibc started defining _SEM_SEMUN_UNDEFINED to note that
the union was not being declared, but conforming systems are not
required to define that macro (e.g. FreeBSD). As a side effect we get
rid of some obsolete __GNU_LIBRARY__ macro usage.

[kzak@redhat.com: - use #ifndef]

Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: enable silent rules if automake >= 1.11
Guillem Jover [Thu, 8 Oct 2009 11:40:09 +0000 (13:40 +0200)]
build-sys: enable silent rules if automake >= 1.11

Make the build silent if the system has a new enough automake,
otherwise keep the current behaviour.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
15 years agobuild-sys: detect if volatile is available
Guillem Jover [Thu, 8 Oct 2009 11:40:07 +0000 (13:40 +0200)]
build-sys: detect if volatile is available

Do not defined volatile away on non-Linux systems, detect its presence
using AC_C_VOLATILE instead.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
15 years agobuild-sys: detect if const is available
Guillem Jover [Thu, 8 Oct 2009 11:40:06 +0000 (13:40 +0200)]
build-sys: detect if const is available

Some systems define __STDC__ and do not have a working const, some do
not define the macro but do have a working const. Use AC_C_CONST to
check for its presence.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
15 years agolibblkid: fix warning message in mkfs sample
Karel Zak [Wed, 7 Oct 2009 22:40:34 +0000 (00:40 +0200)]
libblkid: fix warning message in mkfs sample

15 years agonamei: gater information about / (root)
Karel Zak [Tue, 6 Oct 2009 23:37:57 +0000 (01:37 +0200)]
namei: gater information about / (root)

$ ll -d /foo
drwxr-xr-x 2 kzak kzak 4096 2009-10-07 01:23 /foo

old version:

$ namei -l /foo
f: /foo
Segmentation fault

new version:

$ namei -l /foo
f: /foo
drwxr-xr-x root root /
drwxr-xr-x kzak kzak foo

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agonamei: fix alone symlink evaluation
Karel Zak [Tue, 6 Oct 2009 23:34:36 +0000 (01:34 +0200)]
namei: fix alone symlink evaluation

$ mkdir aaa
$ ln -s aaa mylink

old version:

$ namei mylink
namei: could not stat 'mylink/aaa': No such file or directory

new version:

        $ namei mylink
f: mylink
 l mylink -> aaa
   d aaa

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agowipefs: fix coding style
Karel Zak [Tue, 6 Oct 2009 22:04:08 +0000 (00:04 +0200)]
wipefs: fix coding style

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofallocate: check for ERANGE errors
Karel Zak [Tue, 6 Oct 2009 21:49:56 +0000 (23:49 +0200)]
fallocate: check for ERANGE errors

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agowipefs: new command
Karel Zak [Mon, 5 Oct 2009 11:14:07 +0000 (13:14 +0200)]
wipefs: new command

 # ./wipefs /dev/sda4
 offset               type
 ----------------------------------------------------------------
 0xff6                swap   [other]
                      UUID:  da6c54ea-77d9-470a-82f1-e793fd5d9131

 0x36                 vfat   [filesystem]
                      UUID:  497F-3013

 # ./wipefs --offset 0x36 /dev/sda4
 8 bytes [46 41 54 31 32 20 20 20] erased at offset 0x36 (vfat)

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agotests: add BFS libblkid regression test
Karel Zak [Tue, 6 Oct 2009 20:22:39 +0000 (22:22 +0200)]
tests: add BFS libblkid regression test

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add a probe for bfs
Christoph Hellwig [Tue, 6 Oct 2009 18:10:31 +0000 (14:10 -0400)]
libblkid: add a probe for bfs

blkid is currently missing a probe for the bfs filesystem, leading
to a blkid-enable xfsprogs failing xfsqa testcase 032. This patch adds
a trivial probe for the magic.

Signed-off-by: Christoph Hellwig <hch@lst.de>
15 years agobuild-sys: fix BUILD_PIVOT_ROOT condition
Karel Zak [Tue, 6 Oct 2009 19:57:48 +0000 (21:57 +0200)]
build-sys: fix BUILD_PIVOT_ROOT condition

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: cleanup --disable-{fallocate,pivot_root,unshare}
Karel Zak [Tue, 6 Oct 2009 10:43:22 +0000 (12:43 +0200)]
build-sys: cleanup --disable-{fallocate,pivot_root,unshare}

 * add --disable-fallocate
 * add --disable-pivot_root
 * cleanup --disable-unshare

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agounshare: new command
Mikhail Gusarov [Sat, 3 Oct 2009 19:42:08 +0000 (02:42 +0700)]
unshare: new command

New utility allows to run process with separate mount, UTC, IPC or
network namespaces.

[kzak@redhat.com: - some cosmetic changes in usage() and err() usage
                  - move "if BUILD_UNSHARE" to separate place in Makefile.am
                  - add unshare to .gitignore]

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofdformat: fix memory leak in verify_disk()
Cristian Rodríguez [Sun, 4 Oct 2009 20:08:49 +0000 (16:08 -0400)]
fdformat: fix memory leak in verify_disk()

Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
15 years agolibblkid: fix buffer usage in FAT prober
Karel Zak [Tue, 6 Oct 2009 07:17:06 +0000 (09:17 +0200)]
libblkid: fix buffer usage in FAT prober

The blkid_probe_get_buffer() function returns buffer that could be
overwritten in the next blkid_probe_get_buffer() call. It means that
we have to save FAT super block to the temporary buffer if we want to
call blkid_probe_get_buffer() for directory entries or fsinfo.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: fix FAT super block definition
Lawrence Rust [Mon, 5 Oct 2009 13:42:13 +0000 (15:42 +0200)]
libblkid: fix FAT super block definition

Signed-off-by: Lawrence Rust <lawrence@softsystem.co.uk>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofindfs: fix typo in findfs.8
Karel Zak [Mon, 5 Oct 2009 10:31:03 +0000 (12:31 +0200)]
findfs: fix typo in findfs.8

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoMerge branch 'for_upstream' of git://git.kernel.org/pub/scm/utils/util-linux-ng/tytso...
Karel Zak [Mon, 5 Oct 2009 13:23:12 +0000 (15:23 +0200)]
Merge branch 'for_upstream' of git://git.kernel.org/pub/scm/utils/util-linux-ng/tytso/util-linux-ng

15 years agolib: fix file descriptor leak in is_mounted()
Theodore Ts'o [Sat, 3 Oct 2009 16:50:06 +0000 (12:50 -0400)]
lib: fix file descriptor leak in is_mounted()

Remove an extraneous fopen() that leaks memory and a file descriptor.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibblkid: fix blkid_do_probe() to work properly with chains
Karel Zak [Thu, 1 Oct 2009 22:49:07 +0000 (00:49 +0200)]
libblkid: fix blkid_do_probe() to work properly with chains

The blkid_do_probe() always switched to the new chain -- that's bad, we
have to try all probing methods in the chain.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add blkit_[un]ref() to TODO
Karel Zak [Thu, 1 Oct 2009 21:47:49 +0000 (23:47 +0200)]
libblkid: add blkit_[un]ref() to TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: fix segfault in blkid_do_probe()
Karel Zak [Thu, 1 Oct 2009 20:49:44 +0000 (22:49 +0200)]
libblkid: fix segfault in blkid_do_probe()

This:
pr->cur_chain += sizeof(struct blkid_chain);

is nonsense of course, there should be a cast to (char *) or so.

It seems that the most robust solution is to avoid this game with
pointers and use chain->driver-id which is useful as array index.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: fix non-magic FAT detection
Karel Zak [Thu, 1 Oct 2009 13:14:48 +0000 (15:14 +0200)]
libblkid: fix non-magic FAT detection

On Wed, Sep 30, 2009 at 03:15:41PM +0200, Lawrence Rust wrote:
> The problem is with shlibs/blkid/src/probers/vfat.c.  At the end of
> this file  the struct blkid_idinfo is declared with some magic
> search strings.   In particular, 2 patterns are defined to match the
> single byte jmp/jxx opcodes at the start of a DOS boot sector.
> Because the partition was once formatted as a bootable DOS
> partition it matches these patterns and consequently the function
> probe_vfat is called.  For these simple pattern matches the function
> probe_fat_nomagic is called to filter out false positives.
>
> In normal circumstances only MSDOS 2 and earlier floppies should be
> detected by this function.  A very important feature of these disks
> is the boot signature - bytes 0x55, 0xaa at the end of the 1st
> sector which indicate to the BIOS that  the disk is bootable.  All
> MSDOS floppies have these bytes but the function probe_fat_nomagic
> doesn't check for them.

Note that the msdos/vfat superblock comments has been suggested by
Lawrence.

Reported-by: Lawrence Rust <lawrence@softsystem.co.uk>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agomount: more verbose "mount: only root can do that" message
Karel Zak [Wed, 30 Sep 2009 14:54:17 +0000 (16:54 +0200)]
mount: more verbose "mount: only root can do that" message

> [chroot-i486] root:/$ whoami
> root
> [chroot-i486] root:/$ mkdir -p /dev1
> [chroot-i486] root:/$ mount --move /dev /dev1
> mount: only root can do that

Reported-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: add --disable-makeinstall-setuid
Karel Zak [Wed, 30 Sep 2009 14:51:20 +0000 (16:51 +0200)]
build-sys: add --disable-makeinstall-setuid

.. to disable "chmod 4755" for mount and umount.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: fix lib/Makefile.am (remove pttype.c)
Karel Zak [Tue, 29 Sep 2009 23:14:26 +0000 (01:14 +0200)]
lib: fix lib/Makefile.am (remove pttype.c)

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: use blkid_new_probe_from_filename() in docs
Karel Zak [Tue, 29 Sep 2009 19:58:52 +0000 (21:58 +0200)]
libblkid: use blkid_new_probe_from_filename() in docs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add blkid_new_probe_from_filename()
Karel Zak [Tue, 29 Sep 2009 19:46:30 +0000 (21:46 +0200)]
libblkid: add blkid_new_probe_from_filename()

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add support for SBMAGIC and SBMAGIC_OFFSET
Karel Zak [Tue, 29 Sep 2009 13:59:34 +0000 (15:59 +0200)]
libblkid: add support for SBMAGIC and SBMAGIC_OFFSET

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agomkfs.cramfs: fix gcc warning (incompatible pointer type)
Karel Zak [Tue, 29 Sep 2009 11:54:58 +0000 (13:54 +0200)]
mkfs.cramfs: fix gcc warning (incompatible pointer type)

mkfs.cramfs.c: In function ‘parse_directory’:
mkfs.cramfs.c:310: warning: passing argument 4 of ‘scandir’ from incompatible pointer type

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: fix gcc warning (warn_unused_result)
Karel Zak [Tue, 29 Sep 2009 11:48:16 +0000 (13:48 +0200)]
libblkid: fix gcc warning (warn_unused_result)

save.c: In function ‘blkid_flush_cache’:
save.c:146: warning: ignoring return value of ‘link’, declared with
attribute warn_unused_result

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: remove pttype.c
Karel Zak [Tue, 29 Sep 2009 11:28:12 +0000 (13:28 +0200)]
lib: remove pttype.c

The libblkid library supports partition tables detection now.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: fix the default cache file path
Karel Zak [Tue, 29 Sep 2009 09:08:32 +0000 (11:08 +0200)]
libblkid: fix the default cache file path

The blkid_get_cache_filename() can returns BLKID_CONFIG_FILE instead
BLKID_CACHE_FILE. Yeah, pretty stupid typo.

Fortunately, this brown-paper-bag bug is invisible in almost all cases,
because the default path is returned by blkid_read_config().  The bug
can be visible only when blkid_read_config() returns NULL -- it means
on parses or malloc error.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agomkswap: use libblkid to detect PT
Karel Zak [Fri, 25 Sep 2009 14:27:27 +0000 (16:27 +0200)]
mkswap: use libblkid to detect PT

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agodocs: update TODO
Karel Zak [Fri, 25 Sep 2009 13:41:53 +0000 (15:41 +0200)]
docs: update TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: don't scan private /dev/.udev directory
Karel Zak [Fri, 25 Sep 2009 13:33:07 +0000 (15:33 +0200)]
libblkid: don't scan private /dev/.udev directory

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: use fstatat(), improve readdir() usage
Karel Zak [Fri, 25 Sep 2009 12:40:23 +0000 (14:40 +0200)]
libblkid: use fstatat(), improve readdir() usage

 * fix possible memory leak in ubi_probe_all()

 * use dirent->d_type if available (this is tricky, because d_type
   is not supported on all systems and some filesystems returns
   DT_UNKNOWN). The dirent->d_type allows to avoid unnecessary stat()
   calls.

 * use fstatat() if available -- allows to avoid malloc() and
   sprintf("%s/%s", dirname, dirent->d_name)

Signed-off-by: Karel Zak <kzak@redhat.com>