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>
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>
- 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>
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>
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>
The commit 7ae8b469ad added option --bytes,
not the initial proposal which was changed after maillist discussion.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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>
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>
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>
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>
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>