]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
10 years agolsblk: fix compiler warning
Sami Kerola [Sun, 28 Sep 2014 19:51:44 +0000 (20:51 +0100)] 
lsblk: fix compiler warning

warning: ISO C forbids empty initializer braces [-Wpedantic]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agoinclude: fix compiler warnings
Sami Kerola [Sun, 28 Sep 2014 19:51:43 +0000 (20:51 +0100)] 
include: fix compiler warnings

This change has motivation to make -Wall -pedantic compiler options to
spit a little bit less noise, which with luck will increase change to
notice real issues.

Multiple of these:

warning: ISO C forbids braced-groups within expressions [-Wpedantic]

And nearly 300 times reported:

include/c.h:75:41: warning: struct has no named members [-Wpedantic]
 #define UL_BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agolibuuid: remove _SVID_SOURCE pre-processor definition
Sami Kerola [Sun, 28 Sep 2014 19:51:42 +0000 (20:51 +0100)] 
libuuid: remove _SVID_SOURCE pre-processor definition

The _SVID_SOURCE is deprecated.

In file included from /usr/include/stdio.h:27:0,
                 from libuuid/src/gen_uuid.c:46: /usr/include/features.h:148:3:
      warning: #warning "_BSD_SOURCE and _SVID_SOURCE are
      deprecated, use _DEFAULT_SOURCE" [-Wcpp]

Notice that the Makefile.am has

AM_CPPFLAGS = \
        -include config.h \

that enforces the config.h is included before any other hearer.  In the
configure.ac there is AC_USE_SYSTEM_EXTENSIONS that makes all possible
features that can be supported in a system are turned on.  With these two
there is absolutely no need for any legacy _SOURCE definitions.

Reference: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=c941736c92fa3a319221f65f6755659b2a5e0a20
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotextual: use usage() text element macros
Sami Kerola [Sun, 28 Sep 2014 19:51:41 +0000 (20:51 +0100)] 
textual: use usage() text element macros

Translating these text elements should happen only once, which is
more likely when the text macros are used properly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotextual: use manual tail usage() macro
Sami Kerola [Sun, 28 Sep 2014 19:51:40 +0000 (20:51 +0100)] 
textual: use manual tail usage() macro

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotextual: use version printing macro everywhere
Sami Kerola [Sun, 28 Sep 2014 19:51:39 +0000 (20:51 +0100)] 
textual: use version printing macro everywhere

Only mount, umount, and blkid remains not using the macro because they
are print also library references.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agoflock: add error message to translations
Sami Kerola [Sun, 28 Sep 2014 19:51:38 +0000 (20:51 +0100)] 
flock: add error message to translations

And remove type casting.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotextual: fix couple typos in comments
Sami Kerola [Sun, 28 Sep 2014 19:51:37 +0000 (20:51 +0100)] 
textual: fix couple typos in comments

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agohexdump: remove deprecation message
Sami Kerola [Sun, 28 Sep 2014 19:51:36 +0000 (20:51 +0100)] 
hexdump: remove deprecation message

Message 'calling hexdump as od has been deprecated in favor of GNU
coreutils od' has informed the hexdump not to be used like that for three
and half years, and five releases.  It is time to get rid of notice.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agodocs: update deprecation banners
Sami Kerola [Sun, 28 Sep 2014 19:51:35 +0000 (20:51 +0100)] 
docs: update deprecation banners

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agoswapon: align available columns section in usage()
Sami Kerola [Sun, 28 Sep 2014 19:51:34 +0000 (20:51 +0100)] 
swapon: align available columns section in usage()

Commit 5db57cfc469b45ada0162a64d627ce25a3d2431f missed doing this change.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agocfdisk: don't modify ncurses LINES and COLS
Karel Zak [Wed, 1 Oct 2014 09:38:49 +0000 (11:38 +0200)] 
cfdisk: don't modify ncurses LINES and COLS

On Sun, Sep 28, 2014 at 01:48:38AM -0700, pv4 wrote:
 If ncurses is build with --enable-reentrant, building
 util-linux-2.25.1 fails with the folllowing error:

     disk-utils/cfdisk.c: In function 'resize':
     disk-utils/cfdisk.c:202:9: error: lvalue required as left operand of assignment
        LINES = ws.ws_row;
              ^
     disk-utils/cfdisk.c:203:8: error: lvalue required as left operand of assignment
        COLS = ws.ws_col;
             ^

 man COLS gives the following:

     Depending on the configuration, these may be actual variables,
     or macros (see curs_threads(3X)) which provide read-only
     access to curses's state.  In either case, applications should
     treat them as read-only to avoid confusing the library.

Addresses: https://github.com/karelzak/util-linux/issues/125
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosu: print proper core dump message when killed
pcpa [Sat, 27 Sep 2014 19:04:16 +0000 (16:04 -0300)] 
su: print proper core dump message when killed

An example is, in one terminal "sudo su -; echo $$", and in
another terminal, "kill -9  $PID" (the pid of the su -). It
should not print "(core dumped)", unless the kill signal
specified so, e.g. kill -7 or kill -11.

Signed-off-by: pcpa <paulo.cesar.pereira.de.andrade@gmail.com>
10 years agotests: fix the ipcs test for shmall being too big to show
Karel Zak [Wed, 1 Oct 2014 08:13:09 +0000 (10:13 +0200)] 
tests: fix the ipcs test for shmall being too big to show

Based on hints from Adam Sampson, Ruediger Meier and Sami Kerola.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibmount: don't return root if path contains // or ending /
Søren Holm [Fri, 26 Sep 2014 16:35:11 +0000 (18:35 +0200)] 
libmount: don't return root if path contains // or ending /

If the path fx. is /foo/bar/ the initial stripoff will replace the last slash
with \0 and return a pointer to that exact \0 character. The same thing will
happen if the path contains // somewhere.

Signed-off-by: Søren Holm <sgh@sgh.dk>
10 years agotextual: there may be no space between option and optional =arg
Benno Schulenberg [Mon, 22 Sep 2014 20:15:40 +0000 (22:15 +0200)] 
textual: there may be no space between option and optional =arg

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: angular brackets around a non-literal argument, singular
Benno Schulenberg [Mon, 22 Sep 2014 20:15:39 +0000 (22:15 +0200)] 
textual: angular brackets around a non-literal argument, singular

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: grammarize another error message
Benno Schulenberg [Mon, 22 Sep 2014 20:15:38 +0000 (22:15 +0200)] 
textual: grammarize another error message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: using angular brackets around individual arguments
Benno Schulenberg [Mon, 22 Sep 2014 20:15:37 +0000 (22:15 +0200)] 
textual: using angular brackets around individual arguments

And separate short and long options with the standard comma.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: grammarize an error message
Benno Schulenberg [Mon, 22 Sep 2014 20:15:36 +0000 (22:15 +0200)] 
textual: grammarize an error message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: not using angular brackets around literal arguments
Benno Schulenberg [Mon, 22 Sep 2014 20:15:35 +0000 (22:15 +0200)] 
textual: not using angular brackets around literal arguments

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: add a comma for clarity, plus some other tweaks
Benno Schulenberg [Mon, 22 Sep 2014 20:15:34 +0000 (22:15 +0200)] 
textual: add a comma for clarity, plus some other tweaks

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: use a somewhat clearer and more standard failure message
Benno Schulenberg [Mon, 22 Sep 2014 20:15:33 +0000 (22:15 +0200)] 
textual: use a somewhat clearer and more standard failure message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: "ambivalent" applies to intentions, "ambiguous" to results
Benno Schulenberg [Mon, 22 Sep 2014 20:15:32 +0000 (22:15 +0200)] 
textual: "ambivalent" applies to intentions, "ambiguous" to results

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: use angular brackets around each individual argument
Benno Schulenberg [Mon, 22 Sep 2014 20:15:31 +0000 (22:15 +0200)] 
textual: use angular brackets around each individual argument

In usage texts each word that is an argument should be marked
separately with angular brackets.  Also add a translator comment.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agolslogins: free after error [coverity scan]
Karel Zak [Fri, 26 Sep 2014 09:25:24 +0000 (11:25 +0200)] 
lslogins: free after error [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolslogins: cleanup after error [coverity scan]
Karel Zak [Fri, 26 Sep 2014 09:23:32 +0000 (11:23 +0200)] 
lslogins: cleanup after error [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agomount: improve --move docs
Karel Zak [Thu, 25 Sep 2014 09:01:39 +0000 (11:01 +0200)] 
mount: improve --move docs

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agoMerge branch 'misc' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Mon, 22 Sep 2014 12:55:37 +0000 (14:55 +0200)] 
Merge branch 'misc' of git://github.com/kerolasa/lelux-utiliteetit

* 'misc' of git://github.com/kerolasa/lelux-utiliteetit:
  textual: share crypt() error message in sulogin and newgrp
  newgrp: avoid use of obsolete getpass() function
  newgrp: use libc function to read gshadow if it is available
  setarch: use personality() system call when it is available
  setarch: reindent code
  hwclock: remove referal to deprecated keyboard interface
  eject: make open_device() and select_speed() to use struct eject_control
  eject: add struct eject_control to remove global variables
  mountpoint: simplify if statement
  mkfs.minix: fix couple compiler warnings
  mountpoint: add struct mountpoint_control
  last: improve code readability by renaming variable names
  last: make is_phantom() when kernel config does not include audit support
  lib: remove xgetpass()
  include: simplify fputc_careful() in carefulputc.h
  libuuid: add extern qualifiers to uuid/uuid.h system header

10 years agoMerge branch 'renice' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Mon, 22 Sep 2014 12:43:30 +0000 (14:43 +0200)] 
Merge branch 'renice' of git://github.com/kerolasa/lelux-utiliteetit

* 'renice' of git://github.com/kerolasa/lelux-utiliteetit:
  renice: reorder usage() option descriptions
  rename: add getpriority() message lookup table
  renice: fix numeric uid argument parsing
  renice: avoid having same lines of code twice
  renice: disallow --priority <arg> without pid argument
  rename: use usage and version print out macros
  renice: reorder functions to avoid need of function prototype

10 years agolib/swapprober: add missing header file
Karel Zak [Mon, 22 Sep 2014 12:26:54 +0000 (14:26 +0200)] 
lib/swapprober: add missing header file

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agoswapon: split swapon-common.c
Karel Zak [Mon, 22 Sep 2014 11:16:25 +0000 (13:16 +0200)] 
swapon: split swapon-common.c

 swapon    - requires libmount and libblkid
 swapoff   - requires libmount
 swaplabel - requires libblkid

This patch add lib/swapprober.c with blkid stuff for swap. It allows
to use and link libblkid only when necessary.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agologger: gettimeofday needs <sys/time.h>
Andreas Henriksson [Thu, 18 Sep 2014 23:36:37 +0000 (01:36 +0200)] 
logger: gettimeofday needs <sys/time.h>

Either works on linux, but kfreebsd build fails
if we don't use the <sys/time.h> include.

According to man gettimeofday the correct include is <sys/time.h>

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
10 years agobuild-sys: build libmount everywhere
Andreas Henriksson [Thu, 18 Sep 2014 23:36:35 +0000 (01:36 +0200)] 
build-sys: build libmount everywhere

This enables libmount to build on non-linux, which also
means we can build fsck on non-linux again.
(Since the context part of libmount still needs porting,
building the mount utility has instead been restricted
to only build on Linux.)

This has been build-tested on Debian GNU/kFreeBSD.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
10 years agolibmount: only include context on linux
Andreas Henriksson [Thu, 18 Sep 2014 23:36:34 +0000 (01:36 +0200)] 
libmount: only include context on linux

This is part of an attempt to make libmount buildable on non-linux.

The parts that need architecture specific porting is under
the context*.c files and the rest of libmount is useful/used
by for example fsck.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
10 years agolibmount: only invoke loopcxt on linux
Andreas Henriksson [Thu, 18 Sep 2014 23:36:33 +0000 (01:36 +0200)] 
libmount: only invoke loopcxt on linux

This is part of an attempt to make libmount buildable on non-linux.

The support for /dev/loop* is Linux-specific so just disable
it on non-linux for now.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
10 years agoumount: read mountinfo if --detach-loop given
Robert Schiele [Thu, 18 Sep 2014 06:09:59 +0000 (08:09 +0200)] 
umount: read mountinfo if --detach-loop given

Don't use the optimization not to read mountinfo from commit
6a52473ecd877227f6f7da2b95da0b51593ffec1 if --detach-loop was given
since we need the name of the loop device in that case and with the
optimization this is not present and thus the detach operation
obviously fails.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
10 years agocal: `color` option documentation should match actual behaviour
Eugene Yunak [Sun, 21 Sep 2014 12:51:57 +0000 (15:51 +0300)] 
cal: `color` option documentation should match actual behaviour

10 years agorenice: reorder usage() option descriptions
Sami Kerola [Sun, 14 Sep 2014 10:12:58 +0000 (11:12 +0100)] 
renice: reorder usage() option descriptions

Make the Usage: and Options: sections to be in same order, which I found
to be quicker to use than alphabetical order.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agorename: add getpriority() message lookup table
Sami Kerola [Fri, 5 Sep 2014 23:16:05 +0000 (00:16 +0100)] 
rename: add getpriority() message lookup table

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agorenice: fix numeric uid argument parsing
Sami Kerola [Fri, 5 Sep 2014 22:54:17 +0000 (23:54 +0100)] 
renice: fix numeric uid argument parsing

The following was inconflict with what usage() tells are valid option
arguments.

$ renice 1 -u 1000
renice: unknown user 1000
$ id
uid=1000(kerolasa) ...

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agorenice: avoid having same lines of code twice
Sami Kerola [Fri, 5 Sep 2014 22:33:16 +0000 (23:33 +0100)] 
renice: avoid having same lines of code twice

Add getprio() function to avoid duplication of a simple task.

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agorenice: disallow --priority <arg> without pid argument
Sami Kerola [Fri, 5 Sep 2014 22:17:19 +0000 (23:17 +0100)] 
renice: disallow --priority <arg> without pid argument

Earlier a lonely priority with an argument but without pid resulted to no
action and success, when the invocation should have failed.

$ renice --priority 42 ; echo $?
0

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agorename: use usage and version print out macros
Sami Kerola [Fri, 5 Sep 2014 22:11:00 +0000 (23:11 +0100)] 
rename: use usage and version print out macros

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agorenice: reorder functions to avoid need of function prototype
Sami Kerola [Fri, 5 Sep 2014 22:06:28 +0000 (23:06 +0100)] 
renice: reorder functions to avoid need of function prototype

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotextual: share crypt() error message in sulogin and newgrp
Sami Kerola [Sun, 14 Sep 2014 18:07:44 +0000 (19:07 +0100)] 
textual: share crypt() error message in sulogin and newgrp

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agonewgrp: avoid use of obsolete getpass() function
Sami Kerola [Sun, 14 Sep 2014 17:57:37 +0000 (18:57 +0100)] 
newgrp: avoid use of obsolete getpass() function

Read a password from user with termios, and once the password data is no
longer needed ensure it gets overwrote before unallocating memory.

Reference: http://man7.org/linux/man-pages/man3/getpass.3.html
Reference: https://www.securecoding.cert.org/confluence/display/seccode/MSC06-C.+Beware+of+compiler+optimizations
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agonewgrp: use libc function to read gshadow if it is available
Sami Kerola [Sun, 14 Sep 2014 16:29:54 +0000 (17:29 +0100)] 
newgrp: use libc function to read gshadow if it is available

The glib versionf of getsgnam() is using /etc/nsswitch.conf, allowing the
group passwords to come from external database.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agosetarch: use personality() system call when it is available
Sami Kerola [Sat, 6 Sep 2014 23:16:18 +0000 (00:16 +0100)] 
setarch: use personality() system call when it is available

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agosetarch: reindent code
Sami Kerola [Sat, 6 Sep 2014 23:09:47 +0000 (00:09 +0100)] 
setarch: reindent code

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agohwclock: remove referal to deprecated keyboard interface
Sami Kerola [Sat, 6 Sep 2014 20:33:31 +0000 (21:33 +0100)] 
hwclock: remove referal to deprecated keyboard interface

The KDGHWCLK has been gone quite a while.

Reference: http://marc.info/?l=linux-kernel&m=104171103925897
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agoeject: make open_device() and select_speed() to use struct eject_control
Sami Kerola [Sat, 6 Sep 2014 17:39:24 +0000 (18:39 +0100)] 
eject: make open_device() and select_speed() to use struct eject_control

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agoeject: add struct eject_control to remove global variables
Sami Kerola [Sat, 6 Sep 2014 16:51:35 +0000 (17:51 +0100)] 
eject: add struct eject_control to remove global variables

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agomountpoint: simplify if statement
Sami Kerola [Wed, 3 Sep 2014 19:46:29 +0000 (20:46 +0100)] 
mountpoint: simplify if statement

Returning straight after print_devno() makes the code to be more obvious
and removes need for long else statement.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agomkfs.minix: fix couple compiler warnings
Sami Kerola [Wed, 3 Sep 2014 19:24:11 +0000 (20:24 +0100)] 
mkfs.minix: fix couple compiler warnings

disk-utils/mkfs.minix.c:366:3: warning: ISO C forbids 'return' with
expression, in function returning void [-Wpedantic]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agomountpoint: add struct mountpoint_control
Sami Kerola [Fri, 22 Aug 2014 10:25:48 +0000 (13:25 +0300)] 
mountpoint: add struct mountpoint_control

This unifies variable names in different functions, and removes redundant
stat() calls.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agolast: improve code readability by renaming variable names
Sami Kerola [Sat, 16 Aug 2014 09:38:04 +0000 (10:38 +0100)] 
last: improve code readability by renaming variable names

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agolast: make is_phantom() when kernel config does not include audit support
Sami Kerola [Mon, 11 Aug 2014 22:04:26 +0000 (23:04 +0100)] 
last: make is_phantom() when kernel config does not include audit support

When kernel CONFIG_AUDIT is not set the /proc/<pid>/loginuid information
is not present resulting live sessions to be marked 'gone - no logout' in
last(1) print out.  To go-around this change makes last(1) to look
/dev/<tty> device ownership as a substitute of loginuid.

The go-around seems to work fairly well, but it has it short comings.
For example after closing a X window session the /dev/ttyN file seems to
be owned by root, not the user who had it before entering to the X
session.  While that is suboptimal it is still better than an attmempt to
determine uid_t by looking owner of the /proc/<struct utmp ut_pid>, that
is a login(1) process running as root.

The issue was found using Archlinux installation.

$ pacman -Qi linux
Name           : linux
Version        : 3.16-2
[...]
Build Date     : Mon Aug 4 18:06:51 2014

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agolib: remove xgetpass()
Sami Kerola [Sun, 10 Aug 2014 21:51:53 +0000 (22:51 +0100)] 
lib: remove xgetpass()

This function is not in use, and it has reference to obsoleted getpass().

Reference: http://man7.org/linux/man-pages/man3/getpass.3.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agoinclude: simplify fputc_careful() in carefulputc.h
Sami Kerola [Sun, 10 Aug 2014 17:23:14 +0000 (18:23 +0100)] 
include: simplify fputc_careful() in carefulputc.h

New version of comparisions does the same thing as the old without being
quite as difficult to understand.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agolibuuid: add extern qualifiers to uuid/uuid.h system header
Sami Kerola [Sun, 10 Aug 2014 15:36:09 +0000 (16:36 +0100)] 
libuuid: add extern qualifiers to uuid/uuid.h system header

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agoMerge branch 'master' of https://github.com/stevenhoneyman/util-linux
Karel Zak [Wed, 17 Sep 2014 09:56:13 +0000 (11:56 +0200)] 
Merge branch 'master' of https://github.com/stevenhoneyman/util-linux

10 years agobuild-sys: use -lutil for BSD only
Karel Zak [Wed, 17 Sep 2014 08:56:46 +0000 (10:56 +0200)] 
build-sys: use -lutil for BSD only

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agoipcrm: add hacks to avoid FTBFS
Andreas Henriksson [Sun, 24 Aug 2014 16:04:44 +0000 (18:04 +0200)] 
ipcrm: add hacks to avoid FTBFS

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
10 years agoagetty: fixing FTBFS on !linux (Debian util-linux 2.20.1-1.2)
Christoph Egger [Sun, 24 Aug 2014 16:04:43 +0000 (18:04 +0200)] 
agetty: fixing FTBFS on !linux (Debian util-linux 2.20.1-1.2)

Handle vc flags missing on FreeBSD
Fix tty creation on kFreeBSD taking patch from 2.19

Addresses-Debian-Bug: #650185

10 years agoipcs: remaining kFreeBSD hackery for building.
Aurelien Jarno [Sun, 24 Aug 2014 16:04:42 +0000 (18:04 +0200)] 
ipcs: remaining kFreeBSD hackery for building.

Addresses-Debian-Bug: #527384
Signed-off-by: LaMont Jones <lamont@debian.org>
10 years agolib/blkdev: report correct disk size on GNU/kFreeBSD. Thanks Tuco.
Robert Millan [Sun, 24 Aug 2014 16:04:41 +0000 (18:04 +0200)] 
lib/blkdev: report correct disk size on GNU/kFreeBSD. Thanks Tuco.

Addresses-Debian-Bug: 592292

10 years agolibmount: hide details about failed search in fstab/mtab
Karel Zak [Tue, 16 Sep 2014 13:30:03 +0000 (15:30 +0200)] 
libmount: hide details about failed search in fstab/mtab

The current code returns -errno when not found "mount /foo" in fstab
and mtab does not exist (or /etc/mtab points to non-mounted /proc).

This is problem because the return value is too low-level and maybe
misinterpreted by top level code. It's better to always return
MNT_ERR_NOFSTAB when not found in fstab/mtab.

Reported-by: Dylan Cali <calid1984@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolscpu: fix cppcheck warnings
Boris Egorov [Mon, 15 Sep 2014 16:33:17 +0000 (23:33 +0700)] 
lscpu: fix cppcheck warnings

CppCheck founds a few wrong arguments in format strings and a NULL
pointer dereference.

Amended version with fixed strcmp() usage.

Signed-off-by: Boris Egorov <egorov@linux.com>
10 years agofdformat: fixing copy'n'paste issue in the manual
Jaromir Capik [Mon, 8 Sep 2014 17:42:10 +0000 (19:42 +0200)] 
fdformat: fixing copy'n'paste issue in the manual

The end track default is media specific, not zero.

10 years agozramctl: fixed two -Wformat-security warnings
Steven Honeyman [Mon, 15 Sep 2014 20:59:31 +0000 (21:59 +0100)] 
zramctl: fixed two -Wformat-security warnings

(they prevented compilation if -Werror=format-security is enabled)

Signed-off-by: Steven Honeyman <stevenhoneyman@users.noreply.github.com>
10 years agotravis: whitelist branches
Karel Zak [Tue, 9 Sep 2014 13:53:37 +0000 (15:53 +0200)] 
travis: whitelist branches

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolsblk: add notes about udev to the man page
Karel Zak [Fri, 5 Sep 2014 08:02:45 +0000 (10:02 +0200)] 
lsblk: add notes about udev to the man page

Reported-by: Francis Moreau <francis.moro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: create parent directory for $(PATHFILES)
Michael Marineau [Wed, 3 Sep 2014 03:39:28 +0000 (20:39 -0700)] 
build-sys: create parent directory for $(PATHFILES)

When building outside the source tree there is nothing to guarantee the
target directory exists before writing to it. Most of the time this just
happens to work because something else creates the directory but not
always. For example:

    $ mkdir build
    $ cd build
    $ ../configure --disable-dependency-tracking
    $ make libuuid/uuid.pc
      GEN      libuuid/uuid.pc
    /bin/sh: line 2: libuuid/uuid.pc.tmp: No such file or directory
    make: *** [libuuid/uuid.pc] Error 1

10 years agolibfdisk: add support for sfdisk-like script format
Karel Zak [Tue, 2 Sep 2014 11:51:32 +0000 (13:51 +0200)] 
libfdisk: add support for sfdisk-like script format

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (gpt) follow label-id from script
Karel Zak [Mon, 1 Sep 2014 13:01:34 +0000 (15:01 +0200)] 
libfdisk: (gpt) follow label-id from script

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: add functions to apply partitiong scripts
Karel Zak [Mon, 1 Sep 2014 12:44:39 +0000 (14:44 +0200)] 
libfdisk: add functions to apply partitiong scripts

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (gpt) don't align last possible LBA
Karel Zak [Mon, 1 Sep 2014 12:42:12 +0000 (14:42 +0200)] 
libfdisk: (gpt) don't align last possible LBA

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: rename fdisk_dump_ to fdisk_script_
Karel Zak [Mon, 1 Sep 2014 09:16:21 +0000 (11:16 +0200)] 
libfdisk: rename fdisk_dump_ to fdisk_script_

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: fix fdisk_delete_all_partitions()
Karel Zak [Mon, 1 Sep 2014 09:14:18 +0000 (11:14 +0200)] 
libfdisk: fix fdisk_delete_all_partitions()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: add fdisk_apply_table() and fdisk_delete_all_partitions()
Karel Zak [Fri, 29 Aug 2014 09:18:29 +0000 (11:18 +0200)] 
libfdisk: add fdisk_apply_table() and fdisk_delete_all_partitions()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: improve debug messages
Karel Zak [Fri, 29 Aug 2014 07:57:51 +0000 (09:57 +0200)] 
libfdisk: improve debug messages

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: accept dump with quotes
Karel Zak [Fri, 29 Aug 2014 07:55:31 +0000 (09:55 +0200)] 
libfdisk: accept dump with quotes

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (dos) follow bootable setting when add partition
Karel Zak [Fri, 29 Aug 2014 07:19:13 +0000 (09:19 +0200)] 
libfdisk: (dos) follow bootable setting when add partition

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (gpt) allow to specify uuid and name when create new partition
Karel Zak [Thu, 28 Aug 2014 12:42:55 +0000 (14:42 +0200)] 
libfdisk: (gpt) allow to specify uuid and name when create new partition

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (gpt) set_{name,uuid} functions refactoring
Karel Zak [Thu, 28 Aug 2014 12:16:56 +0000 (14:16 +0200)] 
libfdisk: (gpt) set_{name,uuid} functions refactoring

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: add reference to context to dump
Karel Zak [Thu, 28 Aug 2014 11:03:23 +0000 (13:03 +0200)] 
libfdisk: add reference to context to dump

 * add fdisk_ref_context() function

 * context is necessary to parse label specific partition types

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: use reference counting for context
Karel Zak [Thu, 28 Aug 2014 10:49:16 +0000 (12:49 +0200)] 
libfdisk: use reference counting for context

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: extend dump parsing function
Karel Zak [Thu, 28 Aug 2014 10:37:46 +0000 (12:37 +0200)] 
libfdisk: extend dump parsing function

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (dos) fix typo
Karel Zak [Thu, 28 Aug 2014 08:45:58 +0000 (10:45 +0200)] 
libfdisk: (dos) fix typo

Reported-by: https://github.com/Mikachu
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agoinclude/optutils: fix typo
Karel Zak [Thu, 28 Aug 2014 06:39:54 +0000 (08:39 +0200)] 
include/optutils: fix typo

Reported-by: Rafael Ferreira <rafael.f.f1@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agocfdisk: fix typo in the previous commit
Karel Zak [Tue, 26 Aug 2014 20:19:11 +0000 (22:19 +0200)] 
cfdisk: fix typo in the previous commit

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agocfdisk: wrong interpretation of yes in non-english language
Karel Zak [Tue, 26 Aug 2014 15:03:11 +0000 (17:03 +0200)] 
cfdisk: wrong interpretation of yes in non-english language

Reported-by: tnut@nutyx.org
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (dos) fix logical partitions add/delete code
Karel Zak [Tue, 26 Aug 2014 14:35:16 +0000 (16:35 +0200)] 
libfdisk: (dos) fix logical partitions add/delete code

If you delete logical partition and then create a new one than fdisk
(and cfdisk) might write EBR to the first sector on the device. That's
wrong of course; because you will lost MBR (primary partitions).

(Probably introduced by commit bcddbe96882b88d53b6bc0495e7322c0820a5122
 where code completely clears EBR stuff.)

Reported-by: Michał Górny <mgorny@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: vary basic dump parsing functions
Karel Zak [Mon, 25 Aug 2014 13:33:02 +0000 (15:33 +0200)] 
libfdisk: vary basic dump parsing functions

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibblkid: move string trim function to strutils.h
Karel Zak [Mon, 25 Aug 2014 13:31:53 +0000 (15:31 +0200)] 
libblkid: move string trim function to strutils.h

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: basic fdisk_dump_* functions
Karel Zak [Fri, 22 Aug 2014 12:43:52 +0000 (14:43 +0200)] 
libfdisk: basic fdisk_dump_* functions

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: remove debug dump function, cleanup API
Karel Zak [Fri, 22 Aug 2014 08:25:35 +0000 (10:25 +0200)] 
libfdisk: remove debug dump function, cleanup API

The fdisk_dump_* prefix will be used for sfdisk-like functionality.
The patch also add FDISK_ prefix to fdisk_get_unit() options.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agomountpoint: clarify that it works on files
Dave Reisner [Thu, 21 Aug 2014 16:16:57 +0000 (12:16 -0400)] 
mountpoint: clarify that it works on files

fef4dfa174 removed the restriction that the argument must explicitly be
a directory, so let's fix up the documentation to reflect that.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agomountpoint: drop S_ISDIR check
Dave Reisner [Thu, 21 Aug 2014 12:48:12 +0000 (08:48 -0400)] 
mountpoint: drop S_ISDIR check

Files can be mountpoints, too.