Commit Graph

736 Commits

Author SHA1 Message Date
Samuel Thibault ca04a95a3b fdisk: don't use get_linux_version() for non-linux
The get_linux_version() function is Linux-specific.
Work around it in a few places.

[kzak@redhat.com: split the original patch to small patches]

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-24 00:52:52 +02:00
Samuel Thibault ff035f67ed mkswap: non-linux support
GNU/Hurd uses linux-like swapspace, so mkswap makes sense on
non-linux platforms too.

[kzak@redhat.com: split the original patch to small patches]

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-24 00:52:13 +02:00
Karel Zak a485aec8ce build-sys: cleanup sys-utils/Makefile.am
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-22 15:08:42 +02:00
Cai Qian 5dd7507c18 lscpu: new command
Add a lscpu(1) utility program.

[kzak@redhat.com:
	- indent by linux-2.6/scripts/Lindent
	- add lscpu.{c,1} to sys-utils/Makefile.am
	- add NLS suport
	- complete code refactoring
]

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Cai Qian <qcai@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-18 03:01:49 +02:00
Karel Zak bf09b61a32 write: doesn't check for tty group
write(1) selects a wrong tty, because there is not a proper
check of tty group ownership:

	$ write kzak
	write: kzak is logged in more than once; writing to tty7
	write: /dev/tty7: Permission denied

	$ ls -la /dev/tty7
	crw--w---- 1 root root 4, 7 2008-07-04 00:32 /dev/tty7
	                  ^^^^

	$ ls -la /usr/bin/write
	-rwxr-sr-x 1 root tty 11864 2008-04-02 16:24 /usr/bin/write
	      ^           ^^^

We have to check for tty group owner, because we don't have
permissions to write to arbitrary tty.

Fixed version:

	$ write kzak
	write: kzak is logged in more than once; writing to pts/6
	                                                    ^^^^
	Message from test@nb on pts/7 at 15:22 ...

	^C

	$ ls -la /dev/pts/6
	crw--w---- 1 kzak tty 136, 6 2008-07-07 15:35 /dev/pts/6
	                  ^^^

Addresses-Red-Hat-Bugzilla: #454252
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-07 22:20:44 +02:00
Karel Zak b4cbb7b897 losetup: clean up code around LO_FLAGS_AUTOCLEAR
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-02 15:16:11 +02:00
Karel Zak e84feaecfd umount: improve "-d" option for autoclear loops
The new loop auto-destruct feature detaches automatically loop devices
when no longer used. This means they are detached with the umount()
call. But when we call umount with -d, del_loop() is called and fails
because the ioctl() returns ENXIO. We have to check for autoclear
loop devices rather than blindly call del_loop().

Reported-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-02 15:01:28 +02:00
Karel Zak 4ba66edf82 selinux: is_selinux_enabled() returns 0, 1 and -1
Unfortunately, the current libselinux implementation of
is_selinux_enabled() returns -1 on error. This behavior is
undocumented.

The proper solution is to use "if (is_selinux_enabled() > 0)".

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-01 14:32:53 +02:00
Karel Zak 4edebc1486 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>
2008-07-01 14:32:44 +02:00
Karel Zak cdedde039c hwclock: always reads hardware clock
It's a pity that hwclock first tries to read the clock when running

	hwclock --systohc --noadjfile --utc

and exits as this fails.  I cannot see a reason to read first in that
case.

Old version:

	# hwclock --systohc --noadjfile --utc --debug

	hwclock from util-linux-ng 2.14
	Using /dev interface to clock.
	Assuming hardware clock is kept in UTC time.
	Waiting for clock tick...
	/dev/rtc does not have interrupt functions. Waiting in loop for time
	from /dev/rtc to change
	...got clock tick
	Time read from Hardware Clock: 2008/06/17 11:18:24
	Hw clock time : 2008/06/17 11:18:24 = 1213701504 seconds since 1969
	Time elapsed since reference time has been 0.904855 seconds.
	Delaying further to reach the next full second.
	Setting Hardware Clock to 11:18:24 = 1213701504 seconds since 1969
	ioctl(RTC_SET_TIME) was successful.

New version:

	# hwclock --systohc --noadjfile --utc --debug

	hwclock from util-linux-ng 2.14
	Using /dev interface to clock.
	Assuming hardware clock is kept in UTC time.
	Time elapsed since reference time has been 0.572151 seconds.
	Delaying further to reach the next full second.
	Setting Hardware Clock to 11:18:52 = 1213701532 seconds since 1969
	ioctl(RTC_SET_TIME) was successful.

Addresses-Debian-Bug: #478663
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-06-17 13:19:18 +02:00
Karel Zak 76e8b3364f mount: add norealtime to mount.8
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-06-16 14:00:52 +02:00
Lubomir Kundrak 4d125dfc41 ionice: add -t option
This patch allows "tolerant" behavior, i.e. proceeding even if
priority could not be set. This might be of use in case something
(selinux, old kernel, etc.) does not allow the requested scheduling
priority to be set.

This could be to some extend done as follows:

	ionice -c3 command || command

but the downside is that one could not really tell if what failed was
setting priority or command itself, which could result in duplicate
command run.

This patch solves the situation, so that user can do

	ionice -t -c3 command

Addresses-Red-Hat-Bugzilla: #443842
Signed-off-by: Lubomir Kundrak <lkundrak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-06-16 13:08:51 +02:00
Matthias Koenig 0b0beca2bb hwclock: omit warning about drift if --noadjfile given
Currently, if hwclock is given the --noadjfile option it will
nevertheless display information about the drift rate when invoked with
the --debug option.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2008-06-16 12:39:09 +02:00
Mike Frysinger e9eb4dad0e 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.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-06-16 11:54:37 +02:00
James Youngman 115e6f00b8 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.

Signed-off-by: James Youngman <jay@gnu.org>
2008-06-16 11:54:28 +02:00
Karel Zak fba4e21fa0 build-sys: release++ (v2.14)
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-06-09 13:58:54 +02:00
Karel Zak 1d66f79c80 docs: update v2.14 ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-06-09 12:53:27 +02:00
Karel Zak d5b6454197 docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-06-09 12:49:40 +02:00
Karel Zak 754ba29e2b po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-06-09 12:49:40 +02:00
Gabor Kelemen 568ea3a7f1 po: update hu.po (from translationproject.org) 2008-06-09 12:49:40 +02:00
Volker Schatz 0eab17b95d ddate: 11th, 12th and 13th of month
the Discordian date utility ddate gives the 11th, 12th and 13th of the month as
the "11st", "12nd" and "13rd".  Unless this is a religious thing, please apply
the patch below.

Signed-off-by: Volker Schatz <oss@volkerschatz.com>
2008-06-09 12:49:40 +02:00
Paulius Zaleckas 47bf8ef7f1 rtcwake: fix the default mode to "standby"
Writing "suspend" to /sys/power/state does nothing.
Even "man rtcwake" says that default should be "standby" :)

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-06-09 12:49:00 +02:00
Christophe Blaess eaf58a8697 mount: fix a small typo in mount.8
While working on french translation of the Linux Man Pages, I've found a
small typo in mount.8.

Only one wrong letter : the option "osyncis_o_sync" for XFS filesystem
is erroneously replaced by "osyncis_d_sync" (the previous option).

Signed-off-by: Christophe Blaess <Christophe@Blaess.fr>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-06-09 12:29:08 +02:00
Karel Zak 2e764b0b42 build-sys: release++
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-05-19 11:42:43 +02:00
Karel Zak cf0e1816a3 docs: update 2.14 ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-05-19 11:28:10 +02:00
Karel Zak fc473deec9 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-05-19 11:02:47 +02:00
Clytie Siddall 54dff41750 po: update vi.po (from translationproject.org) 2008-05-19 10:53:11 +02:00
Benno Schulenberg 6e2bd73249 po: update nl.po (from translationproject.org) 2008-05-19 10:52:58 +02:00
Marco Colombo c9f27d263a po: update it.po (from translationproject.org) 2008-05-19 10:52:40 +02:00
Petr Pisar 7d5dc93919 po: update cs.po (from translationproject.org) 2008-05-19 10:50:13 +02:00
James Youngman f8e94da339 docs: we already rewrote the scriptreplay script; remove that TODO entry
Signed-off-by: James Youngman <jay@gnu.org>
2008-05-19 10:36:37 +02:00
Karel Zak 994c17b1b1 mount: remount doesn't care about loop=
The command

   # mount -oremount <spec> <dir>

doesn't read fstab or mtab. This is expected behaviour. Unfortunately,
we have to care about the internal loop= option which is generated and
maintained by mount(8)/umount(8). The loop= option has to be persistent.

How to reproduce this bug:

 # mount -o loop       /home/images/vfat.img /mnt/img; grep vfat /etc/mtab; \
   mount -o remount,ro /home/images/vfat.img /mnt/img; grep vfat /etc/mtab;

 /home/images/vfat.img /mnt/img vfat rw,loop=/dev/loop0 0 0
 /home/images/vfat.img /mnt/img vfat ro 0 0

Reported-By: David Chinner <dgc@sgi.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-05-19 10:31:40 +02:00
Karel Zak 447ae7b834 build-sys: add support ionice for Super-H architecture
Addresses-Red-Hat-Bugzilla: #446560
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-05-19 10:21:50 +02:00
Karel Zak 6cd11e0c0f fdisk: doesn't recognize the VMware ESX partitions
The fdisk programs do not recognize the partition types used by VMware
ESX.  They show up as "unknown".

Addresses-Red-Hat-Bugzilla: #447023
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-05-19 09:30:54 +02:00
Karel Zak 2d281745d9 setarch: add fallback for linux/personality
setarch.c:248: error: 'ADDR_NO_RANDOMIZE' undeclared (first use in this function)
setarch.c:248: error: (Each undeclared identifier is reported only once
setarch.c:248: error: for each function it appears in.)
setarch.c:251: error: 'FDPIC_FUNCPTRS' undeclared (first use in this function)
setarch.c:257: error: 'ADDR_COMPAT_LAYOUT' undeclared (first use in this function)
setarch.c:260: error: 'READ_IMPLIES_EXEC' undeclared (first use in this function)

Linux gzp1 2.4.36.1-gzp1 #1 SMP Tue Feb 19 10:23:48 CET 2008 i686 GNU/Linux

Reported-By: Gabor Z. Papp <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-05-13 14:00:39 +02:00
Karel Zak 8d48d75939 build-sys: release++
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-28 14:13:43 +02:00
Karel Zak 92232fff86 docs: update v2.14 ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-28 14:03:57 +02:00
Karel Zak eaf811facd po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-28 14:01:29 +02:00
Karel Zak 3e6e4bf6ae scriptreplay: gettextize a forgotten messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-28 13:58:24 +02:00
Karel Zak d101e77a55 docs: update v2.14 ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-28 13:51:22 +02:00
Karel Zak 776452cbfc ionice: update man page to reflect IDLE class change in 2.6.25
The idle class is safe for non-root users since 2.6.25.
http://lwn.net/Articles/266256/

Addresses-Red-Hat-Bugzilla: #443823
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-28 12:23:40 +02:00
Steve Grubb 8ccf0b253a login: audit log injection attack via login
A while back I found a couple audit log injection attacks which became
CVE-2007-3102. I forgot to look at login to see if its vulnerable and Mirek
found that it is. To verify the problem, type:

root addr=xyz.com

for the account name while logging in. It will look like root logged in with
an address of xyz.com.

Signed-off-by: Steve Grubb <sgrubb@redhat.com>
2008-04-21 13:34:31 +02:00
Karel Zak 3a4a13b12a docs: remove date from ReleasNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-17 00:16:01 +02:00
Karel Zak 4181600ed1 docs: update v2.14-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-16 23:41:19 +02:00
Karel Zak c7168f54cc docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-16 23:22:23 +02:00
Karel Zak 310170b83b cal: use HAVE_LIB{NCURSES,NCURSESW} instead HAVE_NCURSES
The HAVE_NCURSES is obsolete macro. The autotool generates HAVE_LIBxxx macros.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-16 23:12:40 +02:00
Karel Zak 8381a8c677 more: use HAVE_WIDECHAR instead ENABLE_WIDECHAR
This problem has been detected by tools/codecheck-config.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-16 22:47:37 +02:00
Karel Zak 47dc8cce40 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-16 22:37:48 +02:00
Benno Schulenberg 7fd7e8a9b4 po: update nl.po (from translationproject.org) 2008-04-16 22:21:38 +02:00
Karel Zak dee2383e8f build-sys: remove unnecessary check-local target from login-utils/
We have all tests in the tests/ directory.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-16 22:04:46 +02:00