summaryrefslogtreecommitdiffstats
path: root/disk-utils
Commit message (Collapse)AuthorAgeFilesLines
...
* mkswap: possible to crash with SELinux relabeling supportKaiGai Kohei2007-10-251-6/+9
| | | | | | | | | | | | | | | | | | 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>
* mkfs.cramfs: clean up gcc warningsRandy Dunlap2007-10-111-24/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * clean up code, gcc warnings (try compilation with "-Wall -Wp,-D_FORTIFY_SOURCE=2") Builds cleanly on x86_32 and x86_64. mkfs.cramfs.c:211: warning: pointer targets in passing argument 2 of 'MD5Update' differ in signedness mkfs.cramfs.c:336: warning: format '%u' expects type 'unsigned int', but argument 4 has type 'size_t' mkfs.cramfs.c:355: warning: pointer targets in assignment differ in signedness mkfs.cramfs.c:448: warning: pointer targets in passing argument 1 of '__builtin___strncpy_chk' differ in signedness mkfs.cramfs.c:448: warning: pointer targets in passing argument 1 of '__strncpy_ichk' differ in signedness mkfs.cramfs.c:450: warning: pointer targets in passing argument 1 of '__builtin___strncpy_chk' differ in signedness mkfs.cramfs.c:450: warning: pointer targets in passing argument 1 of '__strncpy_ichk' differ in signedness mkfs.cramfs.c:490: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness mkfs.cramfs.c:620: warning: pointer targets in passing argument 1 of 'compress' differ in signedness mkfs.cramfs.c:620: warning: pointer targets in passing argument 3 of 'compress' differ in signedness mkfs.cramfs.c:671: warning: pointer targets in passing argument 3 of 'do_compress' differ in signedness mkfs.cramfs.c:824: warning: format '%Ld' expects type 'long long int', but argument 4 has type 'loff_t' mkfs.cramfs.c:872: warning: format '%d' expects type 'int', but argument 3 has type 'ssize_t' mkfs.cramfs.c:880: warning: format '%d' expects type 'int', but argument 3 has type 'ssize_t' mkfs.cramfs.c:885: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int' mkfs.cramfs.c:889: warning: pointer targets in passing argument 2 of 'crc32' differ in signedness mkfs.cramfs.c:896: warning: format '%Ld' expects type 'long long int', but argument 4 has type 'loff_t' mkfs.cramfs.c:896: warning: format '%d' expects type 'int', but argument 5 has type 'ssize_t' mkfs.cramfs.c:909: warning: format '%d' expects type 'int', but argument 4 has type 'ssize_t' mkfs.cramfs.c:909: warning: format '%d' expects type 'int', but argument 5 has type 'ssize_t' Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.minix: clean up gcc warningsRandy Dunlap2007-10-111-1/+4
| | | | | | | | | | | | * clean up code, gcc warnings (try compilation with "-Wall -Wp,-D_FORTIFY_SOURCE=2") Builds cleanly on x86_32 and x86_64. mkfs.minix.c:595: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: clean up gcc warningsRandy Dunlap2007-10-031-1/+2
| | | | | | | | | | | * clean up code, gcc warnings (try compilation with "-Wall -Wp,-D_FORTIFY_SOURCE=2") Builds cleanly on x86_32 and x86_64. fsck.cramfs.c:235: warning: ignoring return value of 'read', declared with attribute warn_unused_result Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
* pg: fix segfault on searchRajeev V. Pillai2007-10-031-1/+1
| | | | | | | | | 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>
* build-sys: remove hardcoded _GNU_SOURCEKarel Zak2007-09-201-1/+0Star
| | | | | | We have AC_GNU_SOURCE, so we needn't any extra hardcoded _GNU_SOURCE. Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: add missing description about option --report in manpageLi Zefan2007-09-191-0/+8
| | | | | | The manpage does not mention the option --report. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
* po: gettextizing some overlooked messages.Benno Schulenberg2007-08-142-8/+8
| | | | | | | | Gettextize three new strings, make two strings indentical to two others, and gettextize three strings that are already gettextized elsewhere. Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs: remove nonsense from man pageKarel Zak2007-08-021-6/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: use LU and LLU for BLKGETSIZE and BLKGETSIZE64Karel Zak2007-08-011-2/+28
| | | | | | | | | | | The "blkockdev --getsize" returns negative numbers on i386 for 1Tb devices. The BLKGETSIZE and BLKGETSIZE64 have to use unsigned long and unsigned long long. $ blockdev --getsize /dev/mapper/huge -2147483648 Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: fix "blockdev --getsz" for large devicesKarel Zak2007-08-011-2/+5
| | | | | | | The "blockdev --getsz" command doesn't try to use BLKGETSIZE64 when previous BLKGETSIZE failed with EFBIG. This patch fixes this problem. Signed-off-by: Karel Zak <kzak@redhat.com>
* disk-utils: let mkfs tools open with O_EXCLMatthias Koenig2007-07-273-6/+17
| | | | | | | | | | | | | Let mkswap, mkfs.bfs, mkfs.minix open with O_EXCL if used on block devices to prevent writing to the device even if they are busy (mounted). Unfortunately, O_EXCL has zero effect for 2.4 kernels where in-kernel code doesn't use O_EXCL-like access locks. (Tested on RHEL3.) Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* remove hardcoded package name from some utilsKarel Zak2007-07-271-2/+2
| | | | | | | We have PACKAGE_STRING in config.h that includes package name and version. It's better to use this macro that hardcoded strings. Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: fix signedness problems and remove obsolete codeKarel Zak2007-07-251-22/+2Star
| | | | | | The UUID is unsigned char * Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: default to V1 in any caseMatthias Koenig2007-07-242-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mkswap(8) enforces to use v0 swap format when pagesize > 16kB. (use case might be ppc64 with CONFIG_PPC_64K_PAGES). As version 0 swap is not supported anymore by recent kernels, the behaviour in this case is rather strange. Here is a testcase: for i in 4 8 16 32 64; do mkswap -p `expr $i \* 1024` ./swap.file; done Setting up swapspace version 1, size = 4294963 kB Using user-specified page size 8192, instead of the system values 4096/4096 Setting up swapspace version 1, size = 4294959 kB Using user-specified page size 16384, instead of the system values 4096/4096 Setting up swapspace version 1, size = 4294950 kB Using user-specified page size 32768, instead of the system values 4096/4096 Setting up swapspace version 0, size = 4294934 kB Using user-specified page size 65536, instead of the system values 4096/4096 Setting up swapspace version 0, size = 4294901 kB Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* man pages: add "AVAILABILITY" sectionKarel Zak2007-07-039-1/+25
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: cleanup usage() and update man pageKarel Zak2007-06-292-8/+32
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: add BLKFRAGET/BLKFRASET ioctlsKarel Zak2007-06-292-0/+14
| | | | | | | | | | | | | | In Linux 2.6 the BLKRASET ioctl has the desired effect for mounted file-systems. In Linux 2.4 it appears to set the number of blocks to read-ahead on the *device* as opposed to within a *file*, and the maximum value of this number is 255. As a result the invocation of blockdev will fail on Linux 2.4 for any usefully large value of READAHEAD, and will not in any case have the desired affect for fragmented files. (Based on the blockdev-getfra-setfra.patch Debian patch.) Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: cleanup HAVE_ macros usageKarel Zak2007-06-141-6/+9
| | | | | | | It's bad to use any HAVE_* macros for anything other than for build-system (autotools) stuff. Signed-off-by: Karel Zak <kzak@redhat.com>
* disk-utils: fix libuuid usage in mkswapMatthias Koenig2007-05-161-4/+4
| | | | | | Fix libuuid usage in mkswap. Signed-off-by: Matthias Koenig <mkoenig@suse.de>
* build-sys: do not build convenience libraries in lib/Stepan Kasal2007-05-161-2/+2
| | | | | | | Build lib/*.c individually for each project which uses it, so that the right set of flags is applied each time. Signed-off-by: Stepan Kasal <skasal@redhat.com>
* mkfs.cramfs: fix a way how mkfs works with empty filesKarel Zak2007-02-271-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: remove hardcoded limit for directoriesKarel Zak2007-02-271-9/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: automatically add selinux label to swapfileKarel Zak2007-02-082-6/+54
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: avoid mkswap usage on already mounted deviceKarel Zak2007-02-071-2/+37
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: gcc happy: unsigned long usageKarel Zak2007-02-071-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Clean up pagesize/PAGE_SIZE usage.Karel Zak2007-02-061-36/+20Star
| | | | | | | | | Now all code in util-linux uses sysconf(_SC_PAGESIZE) that is standardized and preferred way of querying page size. The asm/page.h file is not included to the code anymore. (This patch doesn't change mount's FS detection code which will be removed later). Signed-off-by: Karel Zak <kzak@redhat.com>
* raw: move the raw command to /sbinKarel Zak2007-01-261-1/+1
| | | | | | The raw command could be used from udev scripts. Signed-off-by: Karel Zak <kzak@redhat.com>
* raw: don't accept raw0 as a target nameKarel Zak2007-01-261-6/+28
| | | | | | | The raw0 is rawctl and cannot be used as a normal raw device. The patch also enlarge range of <N> for raw<N> and improve the query mode. Signed-off-by: Karel Zak <kzak@redhat.com>
* raw: update man page (about dd and O_DIRECT)Karel Zak2007-01-251-3/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add missing filesKarel Zak2007-01-041-4/+6
| | | | | | | This patch add all missing headers, man pages and README files to automake stuff and "make dist-gzip" produces useful tarball now. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: remove generated autotools stuff from gitKarel Zak2007-01-031-673/+0Star
| | | | | | | The generated autotools stuff shouldn't be maintained by SCM. After check out from git use ./autogen.sh. For more details see README.devel. Signed-off-by: Karel Zak <kzak@redhat.com>
* Imported from util-linux-2.13-pre6 tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.13-pre5 tarball.Karel Zak2006-12-072-360/+449
|
* Imported from util-linux-2.13-pre4 tarball.Karel Zak2006-12-072-2/+7
|
* Imported from util-linux-2.13-pre3 tarball.Karel Zak2006-12-072-13/+14
|
* Imported from util-linux-2.13-pre2 tarball.Karel Zak2006-12-0712-206/+67Star
|
* Imported from util-linux-2.13-pre1 tarball.Karel Zak2006-12-0717-346/+842
|
* Imported from util-linux-2.12p tarball.Karel Zak2006-12-071-3/+9
|
* Imported from util-linux-2.12o tarball.Karel Zak2006-12-074-14/+130
|
* Imported from util-linux-2.12k tarball.Karel Zak2006-12-072-2/+12
|
* Imported from util-linux-2.12h tarball.Karel Zak2006-12-071-2/+37
|
* Imported from util-linux-2.12d tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.12b tarball.Karel Zak2006-12-074-102/+78Star
|
* Imported from util-linux-2.12a tarball.Karel Zak2006-12-071-11/+12
|
* Imported from util-linux-2.12 tarball.Karel Zak2006-12-072-0/+9
|
* Imported from util-linux-2.11x tarball.Karel Zak2006-12-075-139/+245
|
* Imported from util-linux-2.11v tarball.Karel Zak2006-12-072-21/+24
|
* Imported from util-linux-2.11u tarball.Karel Zak2006-12-071-3/+8
|
* Imported from util-linux-2.11t tarball.Karel Zak2006-12-076-7/+1550
|