]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
12 years agoinclude/ttyutils: add default chardata
Werner Fink [Tue, 8 Jan 2013 14:38:40 +0000 (15:38 +0100)] 
include/ttyutils: add default chardata

this one moves the init_chardata to include/ttyutils.h as well as to
lib/include/ttyutils.c.  Also the macros CTL/CTRL are fixed in
agetty.c and sulogin.c to use the XOR variant CTL.

[kzak@redhat.com: use macro rather than global variable for default
                  chardata]

Signed-off-by: Werner Fink <werner@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude: cleanup copyright headers
Karel Zak [Tue, 8 Jan 2013 14:00:23 +0000 (15:00 +0100)] 
include: cleanup copyright headers

We use the code from include/ and lib/ on many places, so use public
domain if possible or LGPL for code copied from libs.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude/bitopts: Use the operating system byteswapping functions
Karel Zak [Tue, 8 Jan 2013 13:07:48 +0000 (14:07 +0100)] 
include/bitopts: Use the operating system byteswapping functions

The swap macros are already in libc.

Co-Author: Cristian Rodríguez <crrodriguez@opensuse.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoswapon: print warning about insecure owner/permissions
Karel Zak [Tue, 8 Jan 2013 12:13:40 +0000 (13:13 +0100)] 
swapon: print warning about insecure owner/permissions

Let's make it more obvious if swap area is accessible for non-root
users. The old version prints the warning only if --verbose is
specified.

Reported-by: mp.lists@free.fr
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: Add write-same attribute to topology info
Milan Broz [Thu, 20 Dec 2012 11:42:23 +0000 (12:42 +0100)] 
lsblk: Add write-same attribute to topology info

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agounshare: support the switching of namespaces
Neil Horman [Fri, 28 Dec 2012 16:22:18 +0000 (11:22 -0500)] 
unshare: support the switching of namespaces

In addition to the unshare syscall, there exists the setns syscall, which
allows processes to migrate to the namepsaces of other processes.  Add this
functionality into the unshare command, as they operate in a fairly simmilar
fashion.

Note: There was discussion of adding a path based namespace argument to unshare
in the origional discussion thread, but I opted to leave that out as it didn't
seem to fit in nicely with the current argument pattern.  I figure we can always
add that in later if we need to

[kzak@redhat.com: - fix optional arguments
                  - do not call unshare if no flag specified
                  - use O_CLOEXEC
                  - codding style cleanup]

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoagetty: replace perms 660 to 620
Karel Zak [Wed, 2 Jan 2013 07:23:00 +0000 (08:23 +0100)] 
agetty: replace perms 660 to 620

 ... the default is root:tty 620

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: remove consoles.h
Karel Zak [Thu, 27 Dec 2012 16:37:27 +0000 (17:37 +0100)] 
build-sys: remove consoles.h

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: don't use {de,con}structor attributes
Karel Zak [Sun, 23 Dec 2012 21:44:05 +0000 (22:44 +0100)] 
sulogin: don't use {de,con}structor attributes

We're not Russian roulette players, so don't use such ugly things at all..

Reported-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: remove consoles.c from libcommon
Karel Zak [Sun, 23 Dec 2012 21:14:21 +0000 (22:14 +0100)] 
sulogin: remove consoles.c from libcommon

- move struct chardata to include/ttyutils.h
- move console.{h,c} to login-utils/sulogin-* (it's sulogin specific)
- fix sulogin and agetty includes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomkfs.minix: fsck:minix: fix compiler warnings
Karel Zak [Thu, 20 Dec 2012 19:01:35 +0000 (20:01 +0100)] 
mkfs.minix: fsck:minix: fix compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomkswap: fix compiler warnings
Karel Zak [Thu, 20 Dec 2012 19:00:11 +0000 (20:00 +0100)] 
mkswap: fix compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolslocks: fix compiler warnings
Karel Zak [Thu, 20 Dec 2012 18:57:48 +0000 (19:57 +0100)] 
lslocks: fix compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) fix compiler warnings
Karel Zak [Thu, 20 Dec 2012 18:55:55 +0000 (19:55 +0100)] 
fdisk: (gpt) fix compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosetterm: fix compiler warning
Karel Zak [Thu, 20 Dec 2012 18:55:20 +0000 (19:55 +0100)] 
setterm: fix compiler warning

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoipcs: fix compiler warnings, use 64bit time
Karel Zak [Thu, 20 Dec 2012 18:52:16 +0000 (19:52 +0100)] 
ipcs: fix compiler warnings, use 64bit time

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agohwclock: fix compiler warning
Karel Zak [Thu, 20 Dec 2012 18:51:38 +0000 (19:51 +0100)] 
hwclock: fix compiler warning

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoipcs: make --human really sexy
Karel Zak [Wed, 19 Dec 2012 14:27:12 +0000 (15:27 +0100)] 
ipcs: make --human really sexy

Align the "size" columns to the right.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/ismounted: improve loopdev support
Karel Zak [Wed, 19 Dec 2012 13:34:01 +0000 (14:34 +0100)] 
lib/ismounted: improve loopdev support

... to make it usable for situations when the same backing
file is mapped to more loop devices.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: improve test_blkid_devno, fix compiler warning [-Wunused-result]
Karel Zak [Wed, 19 Dec 2012 11:56:39 +0000 (12:56 +0100)] 
libblkid: improve test_blkid_devno, fix compiler warning [-Wunused-result]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/ismounted: basic support for loop devices
Karel Zak [Wed, 19 Dec 2012 11:40:32 +0000 (12:40 +0100)] 
lib/ismounted: basic support for loop devices

 # losetup -a /dev/loop0
 /dev/loop0: [2053]:1048578 (/home/fs-images/filesystems/ext2.img)

 # findmnt /dev/loop0
 TARGET    SOURCE     FSTYPE OPTIONS
 /mnt/test /dev/loop0 ext3   rw,relatime,data=ordered

old version:

 ./test_ismounted /home/fs-images/filesystems/ext2.img
 not mounted

new version:

 ./test_ismounted /home/fs-images/filesystems/ext2.img
 mounted on /mnt/test

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/loopdev: fix loopdev_find_by_backing_file()
Karel Zak [Wed, 19 Dec 2012 11:40:19 +0000 (12:40 +0100)] 
lib/loopdev: fix loopdev_find_by_backing_file()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: add missing exit value to fsck.minix(8)
Sami Kerola [Sun, 16 Dec 2012 10:44:00 +0000 (10:44 +0000)] 
docs: add missing exit value to fsck.minix(8)

And remove references to manual pages which has not been part of commonly
used distributions for a while.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agominix: replace magic constants with macro names
Sami Kerola [Sun, 16 Dec 2012 10:43:59 +0000 (10:43 +0000)] 
minix: replace magic constants with macro names

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agominix: use off_t, size_t, etc appropriate types
Sami Kerola [Sun, 16 Dec 2012 10:43:58 +0000 (10:43 +0000)] 
minix: use off_t, size_t, etc appropriate types

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agominix: change types in header file
Sami Kerola [Sun, 16 Dec 2012 10:43:57 +0000 (10:43 +0000)] 
minix: change types in header file

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotunelp: deprecation: remove command from default build
Sami Kerola [Sun, 16 Dec 2012 10:43:56 +0000 (10:43 +0000)] 
tunelp: deprecation: remove command from default build

It is difficult to think think tunelp command being in use a lot.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agomore: remove unnecessary variable
Sami Kerola [Sun, 16 Dec 2012 10:43:55 +0000 (10:43 +0000)] 
more: remove unnecessary variable

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoisosize: inform if file does not look like iso file system
Sami Kerola [Sun, 16 Dec 2012 10:43:54 +0000 (10:43 +0000)] 
isosize: inform if file does not look like iso file system

$ isosize /dev/urandom
isosize: /dev/urandom: might not be iso file system
-67690643227260

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoisosize: fix usage() -h option print out
Sami Kerola [Sun, 16 Dec 2012 10:43:53 +0000 (10:43 +0000)] 
isosize: fix usage() -h option print out

Fixes usage() bug from commit 4eba43a7 which claimed sort option for
--help being -H.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoipcs: add --bytes size output option
Sami Kerola [Sun, 16 Dec 2012 10:43:52 +0000 (10:43 +0000)] 
ipcs: add --bytes size output option

This makes the command being a little closer standard compliant.  See
IEEE Std 1003.1 referral link below for more information.

References: http://pubs.opengroup.org/onlinepubs/009696799/utilities/ipcs.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoipcs: add --human readable size conversion option
Sami Kerola [Sun, 16 Dec 2012 10:43:51 +0000 (10:43 +0000)] 
ipcs: add --human readable size conversion option

Introduces new function ipc_print_size() which will call
size_to_human_string(), and handles the occasional '([k]bytes)' printing
if default size format is requested.

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoipcs: assist debugging
Sami Kerola [Sun, 16 Dec 2012 10:43:50 +0000 (10:43 +0000)] 
ipcs: assist debugging

One will be able to see enum symbols when debugging, which is not the
case when values are specified as define list.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: swapon.8 option name fix
Sami Kerola [Sun, 16 Dec 2012 10:43:49 +0000 (10:43 +0000)] 
docs: swapon.8 option name fix

The commit 7ae8b469adda598fda28e4ea647d47905b43e172 added option --bytes,
not the initial proposal which was changed after maillist discussion.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopartx: add update command
Phillip Susi [Fri, 14 Dec 2012 19:57:25 +0000 (14:57 -0500)] 
partx: add update command

Update the kernel partition table to match what is on disk.  Remove any
extra partitions and add any missing ones.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
12 years agosulogin: map NL to CR-NL on output in initial termios settings
Karel Zak [Wed, 19 Dec 2012 09:24:23 +0000 (10:24 +0100)] 
sulogin: map NL to CR-NL on output in initial termios settings

(See also 9c62a2326e6e39a5e759830b0b9d91696166fb45 agetty patch).

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: minor coding style changes
Karel Zak [Tue, 18 Dec 2012 15:03:02 +0000 (16:03 +0100)] 
sulogin: minor coding style changes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: add multi console feature from SysVinit sulogin
Werner Fink [Mon, 10 Dec 2012 12:27:11 +0000 (13:27 +0100)] 
sulogin: add multi console feature from SysVinit sulogin

Now after adding Conflicts=rescue.service to getty@.service and
serial-getty@.service and Conflicts=getty.target to rescue.target
all works with `systemctl rescue'.  Even adding init=/sbin/sulogin
to the kernels command line by using the `e' key in grub2 boot
menu works flawless.

This version is without the emergency code as I've this moved to
lib/console.c where it belongs to.

Signed-off-by: Werner Fink <werner@suse.de>
12 years agosulogin: mount temporary /dev and /proc if not found
Werner Fink [Mon, 10 Dec 2012 12:27:10 +0000 (13:27 +0100)] 
sulogin: mount temporary /dev and /proc if not found

This is very usefull if initrd can not loaded that is no /dev and no
/proc is found.  Also if the /etc/shadow and /etc/passwd is copied into
the initrd the sulogin can be used in initrd even before /dev and/or /proc
are mounted.

Signed-off-by: Werner Fink <werner@suse.de>
12 years agosulogin: use alarm function to indicate if a timeout occurs
Werner Fink [Fri, 7 Dec 2012 08:00:56 +0000 (09:00 +0100)] 
sulogin: use alarm function to indicate if a timeout occurs

A small change to use the alarm handler to indicate if a timeout occurs.

Signed-off-by: Werner Fink <werner@suse.de>
12 years agosulogin: make usleep() workaround work
Werner Fink [Fri, 7 Dec 2012 08:00:55 +0000 (09:00 +0100)] 
sulogin: make usleep() workaround work

Simply fix a compile problem found during debugging console.c

Signed-off-by: Werner Fink <werner@suse.de>
12 years agosulogin: use the linked lists from list.h for consoles list
Werner Fink [Tue, 18 Dec 2012 14:02:35 +0000 (15:02 +0100)] 
sulogin: use the linked lists from list.h for consoles list

with this the double linked list feature from util-linux is used
instead of the single linked list.

[kzak@redhat.com: use list_last_entry() and list INIT macros]

Signed-off-by: Werner Fink <werner@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude/list: add list_last_entry()
Karel Zak [Tue, 18 Dec 2012 13:49:21 +0000 (14:49 +0100)] 
include/list: add list_last_entry()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: remove crappy bugs section from man page
Karel Zak [Mon, 17 Dec 2012 16:11:05 +0000 (17:11 +0100)] 
fdisk: remove crappy bugs section from man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude/list: fix undefined behavior in list_entry() macro
Sami Liedes [Mon, 17 Dec 2012 15:22:35 +0000 (16:22 +0100)] 
include/list: fix undefined behavior in list_entry() macro

Update list_entry() macro, which is basically the same as the
container_of() macro in the kernel, to use offsetof() to fix undefined
behavior.

Caught using clang -fsanitize=undefined.

[kzak@redhat.com: port from e2fsprogs]

Signed-off-by: Sami Liedes <sami.liedes@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: fix typo
Karel Zak [Fri, 14 Dec 2012 15:12:47 +0000 (16:12 +0100)] 
docs: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: update AUTHORS file
Karel Zak [Thu, 13 Dec 2012 12:51:57 +0000 (13:51 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: fix typos
Karel Zak [Wed, 12 Dec 2012 20:01:32 +0000 (21:01 +0100)] 
libmount: fix typos

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoblkid: fix double free [coverity scan]
Karel Zak [Wed, 12 Dec 2012 19:48:15 +0000 (20:48 +0100)] 
blkid: fix double free [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: make mkstemp() more robust [coverity scan]
Karel Zak [Wed, 12 Dec 2012 12:32:52 +0000 (13:32 +0100)] 
libmount: make mkstemp() more robust [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoswapon: fix memmory leak [coverity scan]
Karel Zak [Wed, 12 Dec 2012 11:40:48 +0000 (12:40 +0100)] 
swapon: fix memmory leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: check mkdir(/run/blkid) return code [coverity scan]
Karel Zak [Wed, 12 Dec 2012 11:27:05 +0000 (12:27 +0100)] 
libblkid: check mkdir(/run/blkid) return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoswapon: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:18:20 +0000 (12:18 +0100)] 
swapon: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoprlimit: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:16:16 +0000 (12:16 +0100)] 
prlimit: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolscpu: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:13:38 +0000 (12:13 +0100)] 
lscpu: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agonamei: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:12:25 +0000 (12:12 +0100)] 
namei: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolslocks: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:11:17 +0000 (12:11 +0100)] 
lslocks: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:09:44 +0000 (12:09 +0100)] 
lsblk: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:08:06 +0000 (12:08 +0100)] 
findmnt: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agopartx: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 10:57:40 +0000 (11:57 +0100)] 
partx: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agologin: check lastlog lseek return code [coverity scan]
Karel Zak [Wed, 12 Dec 2012 10:48:08 +0000 (11:48 +0100)] 
login: check lastlog lseek return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agochsh: use return rather than exit in main, clean up man page
Karel Zak [Wed, 12 Dec 2012 09:48:01 +0000 (10:48 +0100)] 
chsh: use return rather than exit in main, clean up man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agochfn: always use return rather than exit() in main
Karel Zak [Wed, 12 Dec 2012 09:41:44 +0000 (10:41 +0100)] 
chfn: always use return rather than exit() in main

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agochfn: clean up exit status
Karel Zak [Wed, 12 Dec 2012 09:36:32 +0000 (10:36 +0100)] 
chfn: clean up exit status

The old version in some cases (but not always) returns -1 (255) on
error. It seems better to cleanup the code and don't return internal
return codes by exit().

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: unset *_DEBUG variables
Karel Zak [Mon, 10 Dec 2012 12:43:11 +0000 (13:43 +0100)] 
tests: unset *_DEBUG variables

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: don't use safe_getenv() for test
Karel Zak [Mon, 10 Dec 2012 12:31:08 +0000 (13:31 +0100)] 
libmount: don't use safe_getenv() for test

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: avoid endless loop in mnt_get_kernel_cmdline_option
Bernhard Voelker [Fri, 30 Nov 2012 16:12:12 +0000 (17:12 +0100)] 
libmount: avoid endless loop in mnt_get_kernel_cmdline_option

The above function infloops when the name to search for can only
be found at the beginning of /proc/cmdline but doesn't match,
e.g. when searching for "ro" in "root=/dev/sda1 quiet vga=0x31a".

* libmount/src/utils.c (mnt_get_kernel_cmdline_option): Replace
while by for loop to ensure the pointer p is incremented.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
12 years agorename: use macro to print version
Karel Zak [Mon, 10 Dec 2012 12:14:38 +0000 (13:14 +0100)] 
rename: use macro to print version

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agorename: add --symlink option for renaming symlink target
Jan (yac) Matějka [Mon, 26 Nov 2012 15:50:08 +0000 (16:50 +0100)] 
rename: add --symlink option for renaming symlink target

[kzak@redhat.com: - coding style clean up]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoblkid: fix man page mess
Karel Zak [Mon, 10 Dec 2012 11:25:25 +0000 (12:25 +0100)] 
blkid: fix man page mess

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) check if the "First sector" is unused
Karel Zak [Tue, 4 Dec 2012 17:03:35 +0000 (18:03 +0100)] 
fdisk: (gpt) check if the "First sector" is unused

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) align newly created partitions
Karel Zak [Tue, 4 Dec 2012 16:54:15 +0000 (17:54 +0100)] 
fdisk: (gpt) align newly created partitions

 - default "First sector" has to be aligned
 - "Last sector" has to be aligned if specified by +<size><suffix> convention

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) fix {last,first}_usable_lba usage
Karel Zak [Tue, 4 Dec 2012 16:02:50 +0000 (17:02 +0100)] 
fdisk: (gpt) fix {last,first}_usable_lba usage

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: cleanup partition start/end usage
Karel Zak [Tue, 4 Dec 2012 15:34:18 +0000 (16:34 +0100)] 
fdisk: cleanup partition start/end usage

 - always use pointers to make the code more generic
 - always use "const" is possible
 - always use le64_to_cpu() to access numbers

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) check partitions alignment
Karel Zak [Tue, 4 Dec 2012 14:45:25 +0000 (15:45 +0100)] 
fdisk: (gpt) check partitions alignment

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: report PT type, inform about new GPT
Karel Zak [Tue, 4 Dec 2012 13:58:55 +0000 (14:58 +0100)] 
fdisk: report PT type, inform about new GPT

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) use topology to define FirstUsableLBA
Karel Zak [Tue, 4 Dec 2012 13:49:17 +0000 (14:49 +0100)] 
fdisk: (gpt) use topology to define FirstUsableLBA

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agovipw: remove unused set{uid,gid} calls
Karel Zak [Tue, 4 Dec 2012 13:32:15 +0000 (14:32 +0100)] 
vipw: remove unused set{uid,gid} calls

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: clean nonnull attribute usage
Karel Zak [Tue, 4 Dec 2012 13:22:39 +0000 (14:22 +0100)] 
libmount: clean nonnull attribute usage

 - use __attribute__((nonnull) for functions where we not able to
   return an return code ("is", "has" and some "get" functions).

 - use __attribute__((nonnull) for small functions where we
   always modify any of the function argument (some mnt_optstr_* functions)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: re-read PART{UUID,LABEL} for successfully verified cached devices
Karel Zak [Tue, 4 Dec 2012 12:02:57 +0000 (13:02 +0100)] 
libblkid: re-read PART{UUID,LABEL} for successfully verified cached devices

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: cleanup arguments checks
Karel Zak [Tue, 4 Dec 2012 11:12:54 +0000 (12:12 +0100)] 
libblkid: cleanup arguments checks

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: cleanup nonnull attribute usage
Karel Zak [Tue, 4 Dec 2012 10:58:13 +0000 (11:58 +0100)] 
libblkid: cleanup nonnull attribute usage

 - don't mix __attribute__((nonnull)) and "if (!argument) return" for
   the same function. The "if ()" check will be *silently* optimized
   out by gcc.

 - use __attribute__((nonnull)) for functions where is impossible to
   return error code. For example "is" and "has" functions or functions
   where we return unsigned types and zero is a valid value.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: move DOS units stuff to fdiskdoslabel.c
Karel Zak [Mon, 3 Dec 2012 15:22:17 +0000 (16:22 +0100)] 
fdisk: move DOS units stuff to fdiskdoslabel.c

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: use BLKSSZGET as default for io-limits rather than hardcoded limit
Karel Zak [Mon, 3 Dec 2012 14:50:21 +0000 (15:50 +0100)] 
fdisk: use BLKSSZGET as default for io-limits rather than hardcoded limit

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: remove global variable sector_offset
Karel Zak [Mon, 3 Dec 2012 14:32:16 +0000 (15:32 +0100)] 
fdisk: remove global variable sector_offset

 - add cxt->first_lba as replacement to sector_offset
 - add label->reset_alignment() to overwrite the default alignment setting
 - add fdisk_reset_alignment() to setup grain, first LBA offset, etc.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: zerosize EBR buffer
Karel Zak [Fri, 30 Nov 2012 20:33:06 +0000 (21:33 +0100)] 
fdisk: zerosize EBR buffer

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: api: propagate add partitions to users
Davidlohr Bueso [Mon, 26 Nov 2012 04:29:18 +0000 (20:29 -0800)] 
fdisk: api: propagate add partitions to users

Similarly to commit 1f5eb51b79275e32d045fd6718753bf04cde8374 we
do not propagate problems when adding partitions to user visible
api.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: remove dead code
Davidlohr Bueso [Mon, 26 Nov 2012 04:29:12 +0000 (20:29 -0800)] 
fdisk: remove dead code

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: api: move disklabel type to cxt
Davidlohr Bueso [Mon, 26 Nov 2012 04:25:49 +0000 (20:25 -0800)] 
fdisk: api: move disklabel type to cxt

Get rid of it as a global variable as it belongs in the context.
To compare a disklabel on the device, the fdisk_dev_is_disklabel()
function is introduced. Also, to avoid naming issues, the fdisk_labeltype
members where renamed to FDISK_DISKLABEL_<type>.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agoMerge branch '2012wk47' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Fri, 30 Nov 2012 12:43:42 +0000 (13:43 +0100)] 
Merge branch '2012wk47' of git://github.com/kerolasa/lelux-utiliteetit

12 years agobuild-sys: fix typo
Karel Zak [Fri, 30 Nov 2012 11:58:33 +0000 (12:58 +0100)] 
build-sys: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: use pkg-config for selinux
Karel Zak [Fri, 30 Nov 2012 11:48:44 +0000 (12:48 +0100)] 
build-sys: use pkg-config for selinux

- we need libselinux 2.x (where is security_get_initial_context())
- the latest selinux versions are linked with -lpcre

Reported-by: Gregory Nietsky <gregory@distrotech.co.za>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: add devel-non-docs compile profile
Karel Zak [Fri, 30 Nov 2012 11:47:08 +0000 (12:47 +0100)] 
build-sys: add devel-non-docs compile profile

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: don't fails silently if EBR is outside of disk
Karel Zak [Fri, 30 Nov 2012 10:54:10 +0000 (11:54 +0100)] 
fdisk: don't fails silently if EBR is outside of disk

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: cleanup blkid_strconcat
Karel Zak [Fri, 30 Nov 2012 10:10:22 +0000 (11:10 +0100)] 
libblkid: cleanup blkid_strconcat

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: remove blkid_{strndup,strdup}
Karel Zak [Fri, 30 Nov 2012 09:56:54 +0000 (10:56 +0100)] 
libblkid: remove blkid_{strndup,strdup}

Don't try to be smart. Let's use standard libc functions. (Note that
we have fallback for strndup() in include/strutils.h)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: add function attributes to private API
Karel Zak [Fri, 30 Nov 2012 09:33:22 +0000 (10:33 +0100)] 
libblkid: add function attributes to private API

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: add function attributes to public API
Ondrej Oprala [Fri, 30 Nov 2012 09:32:12 +0000 (10:32 +0100)] 
libblkid: add function attributes to public API

[kzak@redhat.com: - use __ul prefix in public API,
                  - define minimal requirement gcc 3.4]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: add function attributes to private API
Ondrej Oprala [Fri, 30 Nov 2012 08:01:10 +0000 (09:01 +0100)] 
libmount: add function attributes to private API

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: add function attributes to public API
Ondrej Oprala [Fri, 30 Nov 2012 07:56:11 +0000 (08:56 +0100)] 
libmount: add function attributes to public API

[kzak@redhat.com: - use __ul prefix in public API,
                  - define minimal requirement gcc 3.4]

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