David Woodhouse [Tue, 4 Dec 2007 13:44:05 +0000 (14:44 +0100)]
hwclock: check for ENODEV
/sbin/hwclock is supposed to fall back to using /dev/rtc0 if /dev/rtc isn't
working (which it isn't, because mkinitrd creates it with the old device
numbers, and we're switching to the new RTC_CLASS driver).
Unfortunately, it'll only cope if the error it gets is ENOENT (i.e. the device
node doesn't exist). It doesn't fall back to the next device in the list if the
error is ENODEV, which is what happens when the device node exists, but there's
no driver.
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Karel Zak <kzak@redhat.com>
KaiGai Kohei [Mon, 22 Oct 2007 08:30:19 +0000 (10:30 +0200)]
mkswap: possible to crash with SELinux relabeling support
When fgetfilecon() is failed with -ENODATA, this process does not
exit. However, "oldcontext" is not initialized in this case, so
context_new() will be called with uninitialized "oldcontext" at the
next.
Finally, it makes a segmentation fault, because context_new() have to
refer an incorrect memory region.
The attached patch fixes this matter using matchpathcon(). If we
cannot obtain actual file context due to -ENODATA, a context which is
returned by matchpathcon() is applied as oldcontext. Then, the type
of the context is relabeled to "swapfile_t" explicitly.
Signed-off-by: KaiGai Kohei <kaigai@kaigai.gr.jp> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 5 Oct 2007 10:22:13 +0000 (12:22 +0200)]
script: dies on SIGWINCH
The "doinput" process doesn't make a difference between SIGWINCH and
SIGCHILD. This process also sends unnecessary SIGWINCH to child (the
signal is ignored by child). Fixed.
chsh: should use pam_end function to terminate the PAM transaction
chsh will use PAM transaction if macros 'REQUIRE_PASSWORD' and
'HAVE_SECURITY_PAM_MISC_H' are defined, but there is no pam_end function be
used when the PAM transaction be terminated.
This patch also cleanup PAM code in chsh(1).
Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Run pg(1) and type '/<CR>' which is supposed to forward search for the
previously remembered search string. pg(1) will segfault after printing
"No remembered search string:".
Signed-off-by: Rajeev V. Pillai <rajeevvp@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
The --rtc option does not set the name of the device correctly.
It still uses /dev/rtc even if the --rtc option is given.
Testcase:
$ mv /dev/rtc /dev/foo
$ hwclock --show --debug --rtc=/dev/foo
hwclock from util-linux-2.13-rc2
Using /dev interface to clock.
Last drift adjustment done at 1190198135 seconds after 1969
Last calibration done at 1190198135 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
hwclock: open() of /dev/rtc failed, errno=2: No such file or directory.
...got clock tick
Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
Mike Frysinger [Fri, 7 Sep 2007 00:30:16 +0000 (20:30 -0400)]
build-sys: nls/locale handling in util-linux-ng general
On Monday 03 September 2007, Karel Zak wrote:
> http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/590/focus=592
>
> I agree that we need a better support for compilation without
> locales, but from my point of view NLS != all locales stuff. The NLS
> support is subset only.
thinking about the input from everyone, i'd propose the attached ...
Only pull in locale.h as needed and move it to the common nls.h.
mount: chain of symlinks to fstab causes use of pointer after free
Looking at the source in 'mount/realpath.c' we find that when dealing with
the second or later symlink in the chain, a memory block was free()d before
copying its contents to a newly allocated block.
Karel Zak [Mon, 27 Aug 2007 21:31:25 +0000 (23:31 +0200)]
setarch: add --3gb option fot compatibility with Debian linux{32,64} command
Debian had a pre-existing linux{32,64} command which supported only
--3gb and --4gb. Adding support for those options allows setarch to
replace that package.
(Note that long options are expected for all setarch flags in the next
release.)
Signed-off-by: LaMont Jones <lamont@mmjgroup.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 27 Aug 2007 11:16:08 +0000 (13:16 +0200)]
Revert "mount: improve error message when helper program not present"
This reverts commit f8988ebf89c65b624ee19c685d15cab6c77fd9df that
breaks new PO translation. The code is currently in "string freeze"
state. The patch will be applied to 2.14 and 2.13.1.
Sascha Sommer [Tue, 21 Aug 2007 13:13:43 +0000 (15:13 +0200)]
mount: free loop device on failure
Testcase:
$ mount -oloop /etc/group /mnt
ioctl: LOOP_CLR_FD: Device or resource busy
mount: you must specify the filesystem type
$ losetup /dev/loop0
/dev/loop0: [0803]:1931929 (/etc/group)
Matthias Koenig [Fri, 24 Aug 2007 11:05:27 +0000 (13:05 +0200)]
mount: avoid duplicates for root fs in mtab
If the root fs is defined with LABEL or UUID in fstab, avoid
a duplicate entry in mtab when calling mount without existing
mtab.
A mount -f / creates two entries, one for LABEL and another
for the devicename, because canonicalize does not expand the
LABEL or UUID tags.