Commit Graph

5827 Commits

Author SHA1 Message Date
Werner Fink f5664477cb 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>
2013-01-08 15:42:12 +01:00
Karel Zak 0f23ee0c85 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>
2013-01-08 15:10:17 +01:00
Karel Zak 1a1eb4e188 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>
2013-01-08 14:07:48 +01:00
Karel Zak cd04b26bf8 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>
2013-01-08 13:15:52 +01:00
Milan Broz 2adb1a44c2 lsblk: Add write-same attribute to topology info
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-07 18:12:02 +01:00
Neil Horman 4bbe809939 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>
2013-01-07 14:56:32 +01:00
Karel Zak 91984e938e agetty: replace perms 660 to 620
... the default is root:tty 620

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-02 08:27:32 +01:00
Karel Zak f35336526f build-sys: remove consoles.h
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-27 17:37:27 +01:00
Karel Zak 4226f910d4 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>
2012-12-23 22:44:05 +01:00
Karel Zak a73f59fa03 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>
2012-12-23 22:14:21 +01:00
Karel Zak 248b8101a0 mkfs.minix: fsck:minix: fix compiler warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-20 20:01:35 +01:00
Karel Zak f3b1628642 mkswap: fix compiler warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-20 20:00:11 +01:00
Karel Zak 46d4ce56a7 lslocks: fix compiler warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-20 19:57:48 +01:00
Karel Zak 130820a8c8 fdisk: (gpt) fix compiler warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-20 19:55:55 +01:00
Karel Zak 747c1d9d57 setterm: fix compiler warning
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-20 19:55:20 +01:00
Karel Zak 278e7203fa ipcs: fix compiler warnings, use 64bit time
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-20 19:52:16 +01:00
Karel Zak 7f89534e6e hwclock: fix compiler warning
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-20 19:51:38 +01:00
Karel Zak 7e88f61717 ipcs: make --human really sexy
Align the "size" columns to the right.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-19 15:27:12 +01:00
Karel Zak 45ddc110ac 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>
2012-12-19 14:34:01 +01:00
Karel Zak 1c3f44f7b8 libblkid: improve test_blkid_devno, fix compiler warning [-Wunused-result]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-19 12:56:39 +01:00
Karel Zak ca4f6229b0 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>
2012-12-19 12:40:32 +01:00
Karel Zak 06f588f7d1 lib/loopdev: fix loopdev_find_by_backing_file()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-19 12:40:19 +01:00
Sami Kerola d80081566e 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>
2012-12-19 11:39:00 +01:00
Sami Kerola 65ca6f8382 minix: replace magic constants with macro names
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-12-19 11:38:56 +01:00
Sami Kerola a180dc6c54 minix: use off_t, size_t, etc appropriate types
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-12-19 11:38:53 +01:00
Sami Kerola 1908a3c214 minix: change types in header file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-12-19 11:38:51 +01:00
Sami Kerola 1342ffcbeb 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>
2012-12-19 11:38:48 +01:00
Sami Kerola cdd2cf46c8 more: remove unnecessary variable
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-12-19 11:38:46 +01:00
Sami Kerola bb2d1ea559 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>
2012-12-19 11:05:04 +01:00
Sami Kerola bb7ea8d81a 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>
2012-12-19 11:05:02 +01:00
Sami Kerola 19b7b517b9 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>
2012-12-19 11:05:00 +01:00
Sami Kerola 56692a6701 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>
2012-12-19 11:04:53 +01:00
Sami Kerola 7e3c5f1cc1 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>
2012-12-19 11:04:50 +01:00
Sami Kerola a68ca3a1d2 docs: swapon.8 option name fix
The commit 7ae8b469ad added option --bytes,
not the initial proposal which was changed after maillist discussion.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-12-19 11:04:47 +01:00
Phillip Susi 3b905b794e 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>
2012-12-19 10:48:12 +01:00
Karel Zak 84ece6980e sulogin: map NL to CR-NL on output in initial termios settings
(See also 9c62a2326e agetty patch).

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-19 10:24:23 +01:00
Karel Zak cba09b5fa8 sulogin: minor coding style changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-18 16:03:02 +01:00
Werner Fink dfbc7c89b2 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>
2012-12-18 15:53:55 +01:00
Werner Fink ab6478ef2d 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>
2012-12-18 15:45:33 +01:00
Werner Fink 729bfb80ff 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>
2012-12-18 15:08:04 +01:00
Werner Fink b33f24b250 sulogin: make usleep() workaround work
Simply fix a compile problem found during debugging console.c

Signed-off-by: Werner Fink <werner@suse.de>
2012-12-18 15:07:58 +01:00
Werner Fink cae29b3717 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>
2012-12-18 15:02:35 +01:00
Karel Zak 59da1544ce include/list: add list_last_entry()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-18 15:00:03 +01:00
Karel Zak 35e52fa531 fdisk: remove crappy bugs section from man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-17 17:11:05 +01:00
Sami Liedes becd09500f 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>
2012-12-17 16:23:35 +01:00
Karel Zak 7cdfc45f99 docs: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-14 16:12:47 +01:00
Karel Zak d7d58e3f8d docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-13 13:51:57 +01:00
Karel Zak 51479069e1 libmount: fix typos
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-12 21:02:11 +01:00
Karel Zak dd5c22a679 blkid: fix double free [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-12 20:48:15 +01:00
Karel Zak 6fc8122490 libmount: make mkstemp() more robust [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-12 13:32:52 +01:00