util-linux/util-linux-2.13-raw-raw0.patch
kzak 894b42f522 - use ncurses only
- fix #218915 - fdisk -b 4K
- upgrade to -pre7 release
- fix building problem with raw0 patch
- fix #217186 - /bin/sh: @MKINSTALLDIRS@: No such file or directory (port
    po/Makefile.in.in from gettext-0.16)
- sync with FC6 and RHEL5:
- fix #216489 - SCHED_BATCH option missing in chrt
- fix #216712 - issues with raw device support ("raw0" is wrong device
    name)
- fix #216760 - mount with context or fscontext option fails (temporarily
    disabled the support for additional contexts -- not supported by kernel
    yet)
- fix #211827 - Can't mount with additional contexts
- fix #213127 - mount --make-unbindable does not work
- fix #211749 - add -r option to losetup to create a read-only loop
- Resolves: rhbz#218915 rhbz#217186 rhbz#216489 rhbz#216712 rhbz#216760
    rhbz#211827 rhbz#213127 rhbz#211749
2006-12-14 12:42:01 +00:00

46 lines
1.1 KiB
Diff

--- util-linux-2.13-pre6/disk-utils/raw.c.kzak 2006-11-21 21:56:40.000000000 +0100
+++ util-linux-2.13-pre6/disk-utils/raw.c 2006-11-21 22:35:11.000000000 +0100
@@ -66,6 +66,7 @@
int err;
int block_major, block_minor;
int i;
+ int rc;
struct stat statbuf;
@@ -108,19 +109,23 @@
usage(1);
raw_name = argv[optind++];
+ rc = sscanf(raw_name, RAWDEVDIR "raw%d", &raw_minor);
+ if (rc != 1) {
+ fprintf (stderr,
+ "Unsupported raw device name '%s' (format is " RAWDEVDIR "rawN))\n",
+ raw_name);
+ exit(2);
+ }
+ if (raw_minor == 0) {
+ fprintf (stderr,
+ "Unsupported raw device name '%s' (minor number cannot be zero)\n",
+ raw_name);
+ exit(2);
+ }
+
err = stat(raw_name, &statbuf);
- if (err) {
- int rc;
-
- rc = sscanf(raw_name, RAWDEVDIR "raw%d", &raw_minor);
- if (rc != 1) {
- fprintf (stderr,
- "Cannot locate raw device '%s' (%s)\n",
- raw_name, strerror(errno));
- exit(2);
- }
+ if (err)
goto skip_test_rawdev;
- }
if (!S_ISCHR(statbuf.st_mode)) {
fprintf (stderr, "raw device '%s' is not a character dev\n",