Sami Kerola [Mon, 8 Apr 2013 19:32:53 +0000 (20:32 +0100)]
tools: add checks to manual page test script
This change includes
- better way to detect manual page inclusion
- man -k header test, which uses lexgrog
- repeated word detection
- static declaration to known repeated words
Most of the changes are based on man-page-day-1.sh, that is in use at
RedHat Quality Assurance, and wrote by Peter Schiffer.
CC: Peter Schiffer <pschiffe@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Mon, 8 Apr 2013 19:32:52 +0000 (20:32 +0100)]
libblkid: number of functions should not be declared extern [smatch scan]
These functions are already marked extern in header file.
libblkid/src/dev.c:70:19: warning: function 'blkid_dev_devname' with external linkage has definition
libblkid/src/dev.c:128:26: warning: function 'blkid_dev_iterate_begin' with external linkage has definition
libblkid/src/dev.c:148:12: warning: function 'blkid_dev_set_search' with external linkage has definition
libblkid/src/dev.c:175:12: warning: function 'blkid_dev_next' with external linkage has definition
libblkid/src/dev.c:196:13: warning: function 'blkid_dev_iterate_end' with external linkage has definition
libblkid/src/tag.c:84:12: warning: function 'blkid_dev_has_tag' with external linkage has definition
libblkid/src/tag.c:282:26: warning: function 'blkid_tag_iterate_begin' with external linkage has definition
libblkid/src/tag.c:303:12: warning: function 'blkid_tag_next' with external linkage has definition
libblkid/src/tag.c:322:13: warning: function 'blkid_tag_iterate_end' with external linkage has definition
libblkid/src/tag.c:336:18: warning: function 'blkid_find_dev_with_tag' with external linkage has definition
Sami Kerola [Mon, 8 Apr 2013 19:32:50 +0000 (20:32 +0100)]
various: fix shadow declarations [smatch scan]
libmount/src/tab.c:990:34: warning: symbol 'fs' shadows an earlier one
libmount/src/tab.c:970:26: originally declared here
misc-utils/findmnt.c:492:30: warning: symbol 'tmp' shadows an earlier one
misc-utils/findmnt.c:473:14: originally declared here
fdisks/fdiskdoslabel.c:211:36: warning: symbol 'pe' shadows an earlier one
fdisks/fdiskdoslabel.c:180:20: originally declared here
fdisks/fdiskdoslabel.c:639:34: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:578:16: originally declared here
fdisks/fdiskdoslabel.c:947:21: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:924:16: originally declared here
fdisks/fdiskdoslabel.c:976:29: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:924:16: originally declared here
fdisks/fdiskdoslabel.c:984:29: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:924:16: originally declared here
[kzak@redhat.com: - don't use local 'tmp' in findmnt.c]
Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Sami Kerola [Mon, 8 Apr 2013 19:32:49 +0000 (20:32 +0100)]
various: fix variable and function declarations [smatch scan]
disk-utils/fsck.minix.c:511:9: warning: mixing declarations and code
fdisks/sfdisk.c:982:5: warning: mixing declarations and code
fdisks/sfdisk.c:1254:5: warning: mixing declarations and code
fdisks/sfdisk.c:1564:5: warning: mixing declarations and code
lib/mbsalign.c:279:7: warning: mixing declarations and code
libblkid/src/devname.c:378:17: warning: mixing declarations and code
libfdisk/src/alignment.c:219:9: warning: mixing declarations and code
term-utils/wall.c:111:9: warning: mixing declarations and code
text-utils/col.c:418:19: warning: non-ANSI function declaration of function 'flush_blanks'
text-utils/col.c:553:12: warning: non-ANSI function declaration of function 'alloc_line'
text-utils/rev.c:105:9: warning: mixing declarations and code
text-utils/tailf.c:245:9: warning: mixing declarations and code
Sami Kerola [Mon, 8 Apr 2013 19:32:48 +0000 (20:32 +0100)]
bash-completion: swapon: add options and fix argument
The initial bash-completion missed swapon options -L and -U. Use of
block device was proposed to be more appropriate than a path to a file.
Requested-by: Karel Zak <kzak@redhat.com>
References: http://marc.info/?l=util-linux-ng&m=136517310727426&w=2 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Mon, 8 Apr 2013 19:32:46 +0000 (20:32 +0100)]
setarch: clean up usage()
Requested-by: Karel Zak <kzak@redhat.com>
References: http://marc.info/?l=util-linux-ng&m=136516351523680&w=2 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Ville Skyttä [Sun, 7 Apr 2013 08:56:12 +0000 (11:56 +0300)]
bash-completion: Symlink runuser symlink to su so it gets loaded on demand.
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
[kzak@redhat.com: - use '-runuser' in the install hook
- use the hook only if runuser is enabled]
Ville Skyttä [Sun, 7 Apr 2013 08:12:08 +0000 (11:12 +0300)]
bash-completion: Don't offer short options where corresponding long one exists.
Users who know the short options can just hit the short option instead
of tab, and it's not likely that it would be helpful to present a list
of single character options to users who don't know them, doing so
just unnecessarily trashes the list of suggestions.
Sami Kerola [Fri, 5 Apr 2013 20:17:24 +0000 (21:17 +0100)]
logger: allow to log using tcp transport protocol
This commit fixes error in usage() text, which claimed TCP is default
transport protocol. That was not true, and neither it should be. The
syslog messages has traditionally sent using UDP.
For the logger remains using UDP as first transport, but if it fails a
TCP connection is attempted. If an user wishes remote logging can be
forced to use either UDP or TCP. The service port for UDP is familiar
'syslog', for TCP the port 'syslog-conn' seems like reasonable default.
[kzak@redhat.com: - rename myopenlog to unix_socket(),
- always reset st to -1]
Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Sami Kerola [Tue, 2 Apr 2013 19:42:57 +0000 (20:42 +0100)]
logger: make local sockets to try both stream and datagram
When journald, from systemd, is in use logger gave following error.
$ logger --socket /dev/log test logger: connect /dev/log: Protocol wrong
type for socket
The journald supports only AF_DGRAM, and nothing else. Support for
AF_STREAM sockets was dropped because it messed up message ordering.
From an users point of view necessity to add --udp (UNIX(TM) Datagram
Protocol?) option when talking to syslog via unix socket felt confusing
and wrong. The command should know what is the socket type, and silently
use the correct one, unless the type is explicitely defined.
CC: Karel Zak <kzak@redhat.com> Adviced-by: Lennart Poettering <lennart@poettering.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Tue, 2 Apr 2013 19:42:56 +0000 (20:42 +0100)]
chrt: make command syntax easier to understand in usage()
And mention in manual that the default is referring to the internal
default of this command, not the Linux system default. Manual page
example also tries to be a little more complete how to use the command.
Sami Kerola [Tue, 2 Apr 2013 19:42:54 +0000 (20:42 +0100)]
setterm: fix various color option argument lists
The lists did not have correct colors in usage(). Because the usage()
had to be fixed, it is best to make the output easy for translators to
work with.
Karel Zak [Wed, 27 Mar 2013 13:50:52 +0000 (14:50 +0100)]
sulogin: don't run if not found passww entry [coverity scan]
sulogin(8) should not run if there is no /etc/{passwd,shadow} entry
and --force command line option is no specified otherwise NULL pointer
dereference is possible.
Karel Zak [Tue, 26 Mar 2013 15:05:07 +0000 (16:05 +0100)]
libmount: fix user-mount by root for mount.<type> helpers
Append options like "exec" "suid" and "dev" to mount.<type> helpers
command line if the options are in fstab. This is relevant for root
user who calls mount(8) for fstab entries with "user,exec" etc.
Daniel Stodden [Mon, 25 Mar 2013 09:33:59 +0000 (02:33 -0700)]
schedutils: don't apply -a without -p
The unsuspecting user might use taskset -a mask command. Behavior then
is to exec with no affinity applied at all. Better handled by ignoring
all_tasks if no pid was given.
Signed-off-by: Daniel Stodden <daniel.stodden@gmail.com>