summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* fdisk: use CDROM_GET_CAPABILITY ioctlDavidlohr Bueso2012-01-024-56/+38Star
| | | | | | And replace the current archaic logic of is_ide_cdrom_or_tape(). Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* mount: append inverting options for mount.<type>Karel Zak2012-01-021-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | fstab: server://foo /mnt/foo nfs user,exec The mount(8) does not append the option "exec" to /sbin/mount.<type> helper's command line. This is no problem when executed by non-root user as it reads the options from fstab only. .. but when executed by root (UID=0) then the mount.<type> helper follows the command where the "exec" option is missing. This is bug. original version (strace output): execve("/sbin/mount.nfs", ["/sbin/mount.nfs", "sr.net.home:/mnt/store", "/mnt/store", "-o", "rw,nosuid,nodev,noauto,user"], [/* 21 vars */]) = 0 fixed version: execve("/sbin/mount.nfs", ["/sbin/mount.nfs", "sr.net.home:/mnt/store", "/mnt/store", "-o", "rw,nosuid,nodev,noauto,user,exec"], [/* 21 vars */]) = 0 ^^^^^ Signed-off-by: Karel Zak <kzak@redhat.com>
* lib,tt: don't trim last line charKarel Zak2011-12-221-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: cleanup headers, cmdline checksKarel Zak2011-12-221-11/+4Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: cleanup man pageKarel Zak2011-12-221-57/+37Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: cleanup usage()Karel Zak2011-12-221-31/+46
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: check to control debug outputKarel Zak2011-12-221-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: print info about one deviceKarel Zak2011-12-221-0/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: rewrite loop setupKarel Zak2011-12-223-833/+104Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: rewrite -fKarel Zak2011-12-221-0/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: rewrite -d and -DKarel Zak2011-12-221-79/+50Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: rewrite -cKarel Zak2011-12-221-38/+29Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: rewrite -jKarel Zak2011-12-221-61/+36Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: rewrite -aKarel Zak2011-12-222-18/+121
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib,loopdev: add missing functionsKarel Zak2011-12-222-41/+178
| | | | | | | | | - improve loop_info usage (don't call ioctl more than once) - add functions to get devno and inode of the backing file - add function for compare any file with backing file by devno + inode or by filename Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid; fix memory leak in blkid_probe_get_wholedisk_probe()Karel Zak2011-12-211-0/+3
| | | | | Reported-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: use xalloc libsDavidlohr Bueso2011-12-201-1/+1
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* losetup: move to sys-utils directoryKarel Zak2011-12-207-14/+29
| | | | | | Now losetup(8) is independent on mount/ stuff at all. Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: remove mount-specific headersKarel Zak2011-12-202-28/+27Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: remove unnecessary header filesKarel Zak2011-12-203-77/+7Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: remove 32-bit ioctlsKarel Zak2011-12-202-96/+4Star
| | | | | | ... kernel 2.4 ?! Who cares? Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: remove #ifdef LOOP_SET_FD nonsenseKarel Zak2011-12-201-52/+0Star
| | | | | | | It's build-system task to enable/disable utils according to accessible system features. Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: remove obsolete #ifdef MAINKarel Zak2011-12-202-12/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: don't use "new" in header fileKarel Zak2011-12-191-2/+2
| | | | | Reported-by: ben <benscott@nwlink.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: update fdisk testsFrancesco Cosoleto2011-12-166-31/+30Star
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: improve some messagesFrancesco Cosoleto2011-12-162-3/+3
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: Fix bad invalid flag 0x00000 warning messageFrancesco Cosoleto2011-12-162-85/+78Star
| | | | | | | | | | | | | | | | | | | | This splits check_dos_label() and dos_init() off from get_boot() and gets rid of the invalid flag 0x00000 warning message due to a check for MBR signs in zeroized buffer: memset(MBRbuffer, 0, 512); if (what == create_empty_dos) goto got_dos_table; [...] got_dos_table: if (!valid_part_table_flag(MBRbuffer)) { [...] if (!valid_part_table_flag(pe->sectorbuffer)) fprintf(stderr, _("Warning: invalid flag 0x%04x of partition " [...] Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: avoid an intermediate variable in command_prompt()Francesco Cosoleto2011-12-161-4/+5
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: don't use get_existing_partition() if disk label isn't dosFrancesco Cosoleto2011-12-161-18/+9Star
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: remove unused guess_device_type() functionFrancesco Cosoleto2011-12-163-40/+0Star
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: get rid of get_boot(create_empty_sun) callFrancesco Cosoleto2011-12-163-13/+14
| | | | | | | create_sunlabel() should create a new empty SUN disklabel without checking data itself writes to memory and initialize internal related fdisk variables. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: get rid of type_open global variableFrancesco Cosoleto2011-12-161-8/+3Star
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: rename try() and tryprocpt() functionsFrancesco Cosoleto2011-12-161-9/+9
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: drop one parameter from try() functionFrancesco Cosoleto2011-12-161-6/+5Star
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: move code for renaming SGI bootfile to SGI moduleFrancesco Cosoleto2011-12-163-21/+15Star
| | | | | | | This moves the code for renaming SGI bootfile from command_prompt() to sgi_set_bootfilename() function. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: remove possibly_osf_label variable that is only assignedFrancesco Cosoleto2011-12-161-4/+0Star
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: remove unused 'require' member in enum actionFrancesco Cosoleto2011-12-162-3/+1Star
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* agetty: add static and const qualifiersFrancesco Cosoleto2011-12-161-4/+4
| | | | | | Remove also a static qualifier in main() function. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* libblkid: minor docs changesFrancesco Cosoleto2011-12-162-9/+9
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* wipefs: use xalloc libDavidlohr Bueso2011-12-161-4/+1Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* lists: add list sorting routineDavidlohr Bueso2011-12-162-0/+140
| | | | | | | | | | | | | | | | | We need a list sorting function, just to mention one example user that could benefit is the lib/tt code to sort columns. This patch adds list_sort() which uses the Merge Sort algorithm, behaving nicely in O(nlog(n)), heavily based on the kernel's implementation[1]. The private data (void *priv) passed to the comparison function as been removed to adopt a qsort(3)-like syntax, and IMHO we don't really need it anyways. [1]: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=lib/list_sort.c;h=d7325c6b103f0be078ff3672c35c468ed35738f1;hb=HEAD [kzak@redhat.com: - use size_t in list_sort()] Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* findmnt: support alternative location of fstabDave Reisner2011-12-162-6/+9
| | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* findmnt: use warnx for libmnt error callbackDave Reisner2011-12-161-1/+1
| | | | | | | | | libmount doesn't set errno appropriately here: $ findmnt -s findmnt: /etc/fstab: parse error at line 20: Success Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* setterm: order man page items alphabeticallyJari Aalto2011-12-161-85/+67Star
| | | | Signed-off-by: Jari Aalto <jari.aalto@cante.net>
* prlimit: return proper typeDavidlohr Bueso2011-12-161-1/+1
| | | | | | The add_prlim() function's definition currently returns a bogus structure. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* docs: add hwclock -c to TODO fileKarel Zak2011-12-091-0/+21
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: don't treat empty partition table as errorKarel Zak2011-12-081-7/+5Star
| | | | | | | | | | Phillip wrote: If a partition table was detected, but it had no partitions in it, a poorly worded error message was printed and further action halted. For partx -a, this gave an unnecessary error. Reported-by: Phillip Susi <psusi@cfl.rr.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: cleanup usage() and man page, add undocumented --verboseKarel Zak2011-12-082-12/+23
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: don't print error when partition already doesn't existPhillip Susi2011-12-081-1/+6
| | | | | | | | | | If you run partx -d to delete partitions, and there are gaps in the sequence ( partition 2 exists, but 1 doesn't ), then it would complain that it had errors trying to remove the partitions that already don't exist. Changed to ignore the error when errno == ENXIO. Signed-off-by: Phillip Susi <psusi@cfl.rr.com>
* agetty: don't use log_err() for non-fatal errorsKarel Zak2011-12-081-2/+2
| | | | | | | | | | | | | | The TIOCSCTTY ioctl requires that caller is session leader -- so it depends on initd (or we have to add setsid() to aggety). It seems that the traditional way is to setup tty in agetty and session in login(1). It means that all session related things (TIOCSCTTY, vhangup, ...) in the command agetty should be optional. (Note that vhangup() is called when --hangup is explicitly specified on command line, so log_err() makes sense there.) Reported-by: Andrew Walrond <andrew@walrond.org> Signed-off-by: Karel Zak <kzak@redhat.com>