* read also backup superblock
* check which superblock is newer
* set minimal device size to 1MiB
Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
[kzak@redhat.com: - remove USE_SOCKET_ACTIVATION and use
HAVE_* as we use for another libs]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
This makes it very convenient to use make use of privileged actions
on CONFIG_USER_NS enabled kernels, without having to manually tinker
with uid_map and gid_map to obtain required credentials (as those
given upon unshare() vanish with call to execve() and lot of userspace
checks for euid==0 anyway).
Usage example:
$ unshare --uts
unshare: unshare failed: Operation not permitted
$ unshare --user --uts
[nfsnobody@odvarok ~]$ hostname swag
hostname: you must be root to change the host name
$ unshare -r --uts
[root@odvarok util-linux]# hostname swag
[root@odvarok util-linux]#
[kzak@redhat.com: - move code to map_id()
- use all-io.h
- add paths to pathnames.h]
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Karel Zak <kzak@redhat.com>
lscpu fails to print proper NUMA node values in a system with
discontinuous nodes. This patch adds support by creating a nodeidx
array to map node numbers.
Based on patch from Madhavan Srinivasan <maddy@linux.vnet.ibm.com>.
Reported-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
hexdump works uncorrectly on Rassberry Pi (raspbian wheezy):
0000000 3200000000 3400000000 3600000000 3800000000 a00000000
000000a
The problem is that the %qx format is used for printing
the (short int) variable.
Here is the output from hexdump with this patch:
0000000 3231 3433 3635 3837 0a39
000000a
Currently raspbian uses hexdump from bsdmainutils.
bsdmainutils: /usr/bin/hexdump
Signed-off-by: Andrew Vagin <avagin@openvz.org>
The default configure disables python support, so this test fails by
default. Add a simple check for module availability.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
In September 1752 the Gregorian reformation happen in Great Britain and
Dominions (including what is now the USA). One could argue the cal(1)
should consider locale when determining the reformation, but such is
nearly impossible implement correctly.
The dates when reformation happen are split by areas that cannot be
expressed with current locales, for example the Netherlands is split to
two and Germany three categories depending on where in the modern country
one is. Secondly the track when reformation happen is lost for some
countries, Lithuania or Japan are good examples of such.
One of the worst for a programmer is Sweden. They got gradual calendar
change which made Swedish calendar to be completely out of sync. Later
the Swedish calendar jumped in 1753 to be in sync with everyone else.
Notice that some countries, including Saudi Arabia, Ethiopia, Nepal, Iran
and Afghanistan, still have not adopted the Gregorian calendar. Hence
the output of the cal(1) cannot be considered to be correct for everyone.
References: http://calendopedia.com/gregory.htm
References: http://en.wikipedia.org/wiki/Gregorian_calendar#Gregorian_reform
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The option is unsupported since v2.23, let's cleanup man pages and
code to remove it at all.
Reported-by: "Dale R. Worley" <worley@alum.mit.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
This avoids unneeded churn during POT-file renewal and PO-file updates,
as the PO files at the TP are made with '--no-wrap'.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Acked-by: Sami Kerola <kerolasa@iki.fi>
Currently when trying to identify extN file system we're playing games
with searching for kernel modules and parsing /proc/filesystem. All of
this just because ext4 module can be used to mount ext3 and ext2 file
systems on recent kernel and also because of ext4dev.
However all of this is not necessary. Ext4 module which does support
mounting ext2 and ext3 file system is able to recognize and mount ext2
and ext3 type so there is no need to disguise it and ext4dev should only
be ever used for testing and not as fallback when other modules are
missing (use -t instead).
This also introduces a bug when in situation that we only have ext4
modules with ext2/ext3 support which is not loaded and we try to mount
ext2 file system we will mount it incorrectly as ext4. This will not
happen if the ext4 module is already loaded.
With this patch we remove all the unnecessary checks and return the real
type of the file system which is on the device. This fixes the issue.
However on the kernel which was not compiled with EXT4_USE_FOR_EXT23
support one would have to provide file system type (-t) to be able to
mount the file system with ext4 driver.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
* read /proc/self/mountinfo to get filesystems
* ignore net and pseudo filesystems
* ignore unaccessible filesystems (over mounted by another FS)
* read disk sysfs queue/discard_granularity to detect is discard support
* call FITRIM ioctl
* silently ignore EOPNOTSUPP (for example LUKS without discard) and ENOTTY
(for example vfat) errors
Signed-off-by: Karel Zak <kzak@redhat.com>
A user is always allowed to change the CPU affinity of his or her
own processes. CAP_SYS_NICE is only required to change the affinity
of another user's process.
Signed-off-by: Rik van Riel <riel@redhat.com>
Reported-by: Joe Mario <jmario@redhat.com>
The previous commit made --week=<number> to have smaller weight value
than a month supplied by user. The commit started to print the month
that has more days at the week when a week is split to two months, and
only one month output is requested.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
While prototypes such as 'function(int, int, char, int);' are legal they
do not help when trying to understand how the function is expected to be
used. Adding variable names gives at least a hint when looking the
prototypes.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Runtime configuration is set at the time of command line option parsing,
and other initialization. Later the configuration is read-only. This
should make code a little bit more understandable.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
echo "ps uf" | script
does not work because script assume that stdin is terminal and
it does not forward EOF to the pty.
This patch:
* make non-tty use-case more robust (don't call tty ioclts to
non-tty file descriptors.
* send EOF (CTL('D') control char) to the master channel when
detected eof by read() on stdin
* wait for empty master and slave file descriptors to be sure that
we don't miss date for typescript. This is also necessary to be
sure that slave channel (shell) is completely initialized otherwise
EOF is ignored.
Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>