Karel Zak [Mon, 22 Dec 2008 17:46:45 +0000 (18:46 +0100)]
mount: add rootcontext= SELinux mount option
Note, the description in the mount.8 man page is copy & paste from
rootcontext= kernel patch (by James Morris). I didn't found anything
more useful... (patches welcomed:-)
Matthias Koenig [Mon, 9 Jun 2008 14:38:25 +0000 (16:38 +0200)]
mount: retry on ENOMEDIUM
Due to a change in kernel behaviour when opening CDROM devices,
we need to retry the open/mount call when ENOMEDIUM is returned.
Explanation from Tejun Heo:
Okay, the difference is from the addition of cdrom_get_media_event()
call to both sr_drive_status() and ide_cdrom_drive_status().
Previously, the cdrom driver can't differentiate between tray closed
w/ no media and tray open and always returned tray open, which
triggers close and retry in the open logic which probably have delayed
things enough to get the media recognized.
Now the cdrom driver can discern between tray closed w/o media and
device not ready for other reasons and returns -ENOMEDIUM on the
former. This is all good and dandy but the problem seems that some
drives report no media right after the tray is closed but it hasn't
properly detected the media yet.
It seems the only way to work around the problem is via sensible
retries (e.g. try three times 5 secs apart) and I don't think we can
add that type of retry logic into cdrom open path. Please note that
the previous logic wasn't water proof. Some drives can take longer to
recognize the media is there and could have failed the in-kernel retry
too. Also, reading the media can take quite some time and during that
period the drive reports media present but device not ready. The
driver will retry the command (e.g. READ TOC for open) five times but
all of them can fail w/ EMEDIUMTYPE.
[kzak@redhat.com: - add CRDOM_NOMEDIUM_RETRIES to blkdev.h
- add verbose message to mount.c]
Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 23 Jun 2008 11:00:00 +0000 (13:00 +0200)]
mount: warn on "file_t" selinux context
Currently if I mount a file system without labels, it works fine, but
later or SELinux will start printing denials and stopping certain
applications from working. It would be nice if the mount command
checked it in selinux mode.
Addresses-Red-Hat-Bugzilla: #390691 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 3 Oct 2008 07:34:25 +0000 (09:34 +0200)]
mount: remove link to namesys.com
Ricardo Catalinas Jiménez wrote:
In the man page mount(8) there is the url
"http://www.namesys.com/mount-options.html". The web site has been
down for a long time and the Namesys company is trying to be sold.
Reported-By: Ricardo Catalinas Jiménez <jimenezrick@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
James Youngman [Wed, 14 May 2008 08:51:40 +0000 (09:51 +0100)]
more: minor fixes to magic()
Read the magic bytes into signed chars instead of vanilla chars in
order to ensure consistent results even on systems whose char type has
no sign. Eliminate spurious parentheses in return statements.
Correct grammatical errors in comments.
Mike Frysinger [Sat, 7 Jun 2008 17:22:45 +0000 (13:22 -0400)]
more: dont use a.out.h
The a.out.h header is not friendly to portable systems (iow, those that
lack a.out support), and since the defines are only used in a cheesy magic,
just use the magic constants. It's not like they're ever going to change.
Matthias Koenig [Thu, 6 Nov 2008 13:45:38 +0000 (14:45 +0100)]
losetup: try to set up loop readonly if EACCES
Currently mounting/losetup an image fails if it is accessable readonly.
There are no problems if it is a file on a local filesystem.
It seems only to happen if it is a NFS mounted image, which is
read-write in permission but with root_squash option.
set_loop checks only for EROFS to retry open with readonly mode,
but in this case we get EACCES.
Samuel Thibault [Fri, 12 Dec 2008 11:52:21 +0000 (12:52 +0100)]
ldattach: don't compile for non-linux systems
There is just ldattach which doesn't compile because line disciplines are not
implemented that way on the Hurd. Is TIOCSETD any kind of standard? Else I
guess the patch below would be fine.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
David Brownell [Tue, 12 Aug 2008 10:13:52 +0000 (03:13 -0700)]
hwclock: remove x86_64-specific bogon
I was puzzled why "hwclock" wrongly reported my x86_64 sytem didn't
support RTC update interrupts. Bogus #ifdef, that's why ... added
by the 2.11y patch (from 2.11t). Probably this whole #ifdef should
just vanish ... if the kernel rejects UIE_ON, the program ought to
just cope with it.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Karel Zak [Wed, 17 Sep 2008 11:49:45 +0000 (13:49 +0200)]
build-sys: add -luuid to BLKID_LIBS
The libblkid is always linked with libuuild, so this indirect
dependence in BLKID_LIBS is not a problem. This change helps to people
who compile util-linux-ng with non-standard prefix, ..etc.
Karel Zak [Tue, 30 Sep 2008 22:27:37 +0000 (00:27 +0200)]
mount: mtab created multiple times with -a option
When /etc/mtab does not exist and mount is called with -a, for every
mount point that is mounted a root-fs record is added to mtab. This is
because get_mtab_info() sets the flag mtab_does_not_exist to 1 when it
doesn't find /etc/mtab. However, if it actually finds /etc/mtab, the
variable is not reset to 0. So on every subsequent call to
get_mtab_info() (as it is the case when mounting several mount points
with the -a option), mount will think that /etc/mtab does not exist,
even if it was created in the meantime by mount itself.
Reported-By: Jonas Kramer <jkramer@nex.scrapping.cc> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 21 Aug 2008 09:17:55 +0000 (11:17 +0200)]
losetup: remove unnecessary minor number check
The latest kernel supports partitioned loop devices (kernel commit 476a4813cfddf7cf159956cc0e2d3c830c1507e3). Unfortunately, this change
makes minor numbers useless, because mirror number does not match with
loop device name (loop<N>).
Fortunately, losetup code does not depend on minor numbers.
ipcs: ungettextize the spacing of the table headers
It makes no sense to allow translators to adjust the spacing when
they cannot adjust the spacing of the actual data too. Adjusting
such spacing is not really a translator's task.