forked from pool/util-linux
This commit is contained in:
parent
a685642dab
commit
e68493f4c1
@ -1,70 +0,0 @@
|
|||||||
commit 5d1f6bae3b298809ecd63b3e55f6ab30caaa4dbf
|
|
||||||
Author: Matthias Koenig <mkoenig@suse.de>
|
|
||||||
Date: Thu Sep 20 11:11:18 2007 +0200
|
|
||||||
|
|
||||||
hwclock: fix --rtc option
|
|
||||||
|
|
||||||
The --rtc option does not set the name of the device correctly.
|
|
||||||
It still uses /dev/rtc even if the --rtc option is given.
|
|
||||||
|
|
||||||
Testcase:
|
|
||||||
$ mv /dev/rtc /dev/foo
|
|
||||||
$ hwclock --show --debug --rtc=/dev/foo
|
|
||||||
hwclock from util-linux-2.13-rc2
|
|
||||||
Using /dev interface to clock.
|
|
||||||
Last drift adjustment done at 1190198135 seconds after 1969
|
|
||||||
Last calibration done at 1190198135 seconds after 1969
|
|
||||||
Hardware clock is on local time
|
|
||||||
Assuming hardware clock is kept in local time.
|
|
||||||
Waiting for clock tick...
|
|
||||||
hwclock: open() of /dev/rtc failed, errno=2: No such file or directory.
|
|
||||||
...got clock tick
|
|
||||||
|
|
||||||
Co-Author: Karel Zak <kzak@redhat.com>
|
|
||||||
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
|
|
||||||
diff --git a/hwclock/rtc.c b/hwclock/rtc.c
|
|
||||||
index f8e626e..724daf9 100644
|
|
||||||
--- a/hwclock/rtc.c
|
|
||||||
+++ b/hwclock/rtc.c
|
|
||||||
@@ -104,24 +104,21 @@ open_rtc(void) {
|
|
||||||
"/dev/misc/rtc",
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
- char **p = fls;
|
|
||||||
- char *fname = rtc_dev_name ? : *p;
|
|
||||||
-
|
|
||||||
- do {
|
|
||||||
- int fd = open(fname, O_RDONLY);
|
|
||||||
-
|
|
||||||
- if (fd < 0 && errno == ENOENT) {
|
|
||||||
- if (fname == rtc_dev_name)
|
|
||||||
- break;
|
|
||||||
- fname = *++p;
|
|
||||||
- } else {
|
|
||||||
- rtc_dev_name = *p;
|
|
||||||
- return fd;
|
|
||||||
- }
|
|
||||||
- } while(fname);
|
|
||||||
-
|
|
||||||
- if (!rtc_dev_name)
|
|
||||||
- rtc_dev_name = *fls;
|
|
||||||
+ char **p;
|
|
||||||
+
|
|
||||||
+ /* --rtc option has been given */
|
|
||||||
+ if (rtc_dev_name)
|
|
||||||
+ return open(rtc_dev_name, O_RDONLY);
|
|
||||||
+
|
|
||||||
+ for (p=fls; *p; ++p) {
|
|
||||||
+ int fd = open(*p, O_RDONLY);
|
|
||||||
+
|
|
||||||
+ if (fd < 0 && errno == ENOENT)
|
|
||||||
+ continue;
|
|
||||||
+ rtc_dev_name = *p;
|
|
||||||
+ return fd;
|
|
||||||
+ }
|
|
||||||
+ rtc_dev_name = *fls; /* default */
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
|||||||
commit ebbeb2c7ac1b00b6083905957837a271e80b187e
|
|
||||||
Author: Ludwig Nussel <ludwig.nussel@suse.de>
|
|
||||||
Date: Thu Sep 20 14:57:20 2007 +0200
|
|
||||||
|
|
||||||
mount: doesn't drop privileges properly when calling helpers
|
|
||||||
|
|
||||||
{,u}mount calls setuid() and setgid() in the wrong order and doesn't checking
|
|
||||||
the return value of set{u,g}id(() when running helpers like mount.nfs.
|
|
||||||
|
|
||||||
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
|
|
||||||
diff --git a/mount/mount.c b/mount/mount.c
|
|
||||||
index 40699f3..5bc2b30 100644
|
|
||||||
--- a/mount/mount.c
|
|
||||||
+++ b/mount/mount.c
|
|
||||||
@@ -634,8 +634,12 @@ check_special_mountprog(const char *spec, const char *node, const char *type, in
|
|
||||||
char *oo, *mountargs[10];
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
- setuid(getuid());
|
|
||||||
- setgid(getgid());
|
|
||||||
+ if(setgid(getgid()) < 0)
|
|
||||||
+ die(EX_FAIL, _("mount: cannot set group id: %s"), strerror(errno));
|
|
||||||
+
|
|
||||||
+ if(setuid(getuid()) < 0)
|
|
||||||
+ die(EX_FAIL, _("mount: cannot set user id: %s"), strerror(errno));
|
|
||||||
+
|
|
||||||
oo = fix_opts_string (flags, extra_opts, NULL);
|
|
||||||
mountargs[i++] = mountprog; /* 1 */
|
|
||||||
mountargs[i++] = (char *) spec; /* 2 */
|
|
||||||
diff --git a/mount/umount.c b/mount/umount.c
|
|
||||||
index b3100c9..3221619 100644
|
|
||||||
--- a/mount/umount.c
|
|
||||||
+++ b/mount/umount.c
|
|
||||||
@@ -102,8 +102,12 @@ check_special_umountprog(const char *spec, const char *node,
|
|
||||||
char *umountargs[8];
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
- setuid(getuid());
|
|
||||||
- setgid(getgid());
|
|
||||||
+ if(setgid(getgid()) < 0)
|
|
||||||
+ die(EX_FAIL, _("umount: cannot set group id: %s"), strerror(errno));
|
|
||||||
+
|
|
||||||
+ if(setuid(getuid()) < 0)
|
|
||||||
+ die(EX_FAIL, _("umount: cannot set user id: %s"), strerror(errno));
|
|
||||||
+
|
|
||||||
umountargs[i++] = umountprog;
|
|
||||||
umountargs[i++] = xstrdup(node);
|
|
||||||
if (nomtab)
|
|
@ -4,10 +4,10 @@
|
|||||||
|
|
||||||
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
|
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
|
||||||
|
|
||||||
Index: util-linux-ng-2.13rc2+git20070725/mount/Makefile.am
|
Index: util-linux-ng-2.13.0.1+git20071106/mount/Makefile.am
|
||||||
===================================================================
|
===================================================================
|
||||||
--- util-linux-ng-2.13rc2+git20070725.orig/mount/Makefile.am
|
--- util-linux-ng-2.13.0.1+git20071106.orig/mount/Makefile.am
|
||||||
+++ util-linux-ng-2.13rc2+git20070725/mount/Makefile.am
|
+++ util-linux-ng-2.13.0.1+git20071106/mount/Makefile.am
|
||||||
@@ -12,7 +12,7 @@ headers_common = fstab.h linux_fs.h moun
|
@@ -12,7 +12,7 @@ headers_common = fstab.h linux_fs.h moun
|
||||||
mount_paths.h lomount.h fsprobe.h realpath.h xmalloc.h \
|
mount_paths.h lomount.h fsprobe.h realpath.h xmalloc.h \
|
||||||
getusername.h loop.h sundries.h
|
getusername.h loop.h sundries.h
|
||||||
@ -21,15 +21,15 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/Makefile.am
|
|||||||
|
|
||||||
swapon_SOURCES = swapon.c swap_constants.h $(utils_common)
|
swapon_SOURCES = swapon.c swap_constants.h $(utils_common)
|
||||||
|
|
||||||
-losetup_SOURCES = lomount.c loop.h lomount.h
|
-losetup_SOURCES = lomount.c sundries.c xmalloc.c realpath.c \
|
||||||
+losetup_SOURCES = lomount.c loop.h lomount.h rmd160.c sha512.c
|
+losetup_SOURCES = lomount.c sundries.c xmalloc.c realpath.c rmd160.c sha512.c \
|
||||||
|
loop.h lomount.h xmalloc.h sundries.h realpath.h
|
||||||
losetup_CPPFLAGS = -DMAIN $(AM_CPPFLAGS)
|
losetup_CPPFLAGS = -DMAIN $(AM_CPPFLAGS)
|
||||||
|
|
||||||
mount_LDADD = $(LDADD_common)
|
Index: util-linux-ng-2.13.0.1+git20071106/mount/rmd160.h
|
||||||
Index: util-linux-ng-2.13rc2+git20070725/mount/rmd160.h
|
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ util-linux-ng-2.13rc2+git20070725/mount/rmd160.h
|
+++ util-linux-ng-2.13.0.1+git20071106/mount/rmd160.h
|
||||||
@@ -0,0 +1,11 @@
|
@@ -0,0 +1,11 @@
|
||||||
+#ifndef RMD160_H
|
+#ifndef RMD160_H
|
||||||
+#define RMD160_H
|
+#define RMD160_H
|
||||||
@ -42,11 +42,11 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/rmd160.h
|
|||||||
+#endif /*RMD160_H*/
|
+#endif /*RMD160_H*/
|
||||||
+
|
+
|
||||||
+
|
+
|
||||||
Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
Index: util-linux-ng-2.13.0.1+git20071106/mount/lomount.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- util-linux-ng-2.13rc2+git20070725.orig/mount/lomount.c
|
--- util-linux-ng-2.13.0.1+git20071106.orig/mount/lomount.c
|
||||||
+++ util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
+++ util-linux-ng-2.13.0.1+git20071106/mount/lomount.c
|
||||||
@@ -20,9 +20,15 @@
|
@@ -20,12 +20,18 @@
|
||||||
|
|
||||||
#include "loop.h"
|
#include "loop.h"
|
||||||
#include "lomount.h"
|
#include "lomount.h"
|
||||||
@ -54,20 +54,23 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
+#include "sha512.h"
|
+#include "sha512.h"
|
||||||
#include "xstrncpy.h"
|
#include "xstrncpy.h"
|
||||||
#include "nls.h"
|
#include "nls.h"
|
||||||
|
#include "sundries.h"
|
||||||
|
#include "xmalloc.h"
|
||||||
|
#include "realpath.h"
|
||||||
|
|
||||||
+#ifndef MAX
|
+#ifndef MAX
|
||||||
+#define MAX(a,b) ((a>b)?(a):(b))
|
+#define MAX(a,b) ((a>b)?(a):(b))
|
||||||
+#endif
|
+#endif
|
||||||
+
|
+
|
||||||
extern int verbose;
|
#define SIZE(a) (sizeof(a)/sizeof(a[0]))
|
||||||
extern char *progname;
|
|
||||||
extern char *xstrdup (const char *s); /* not: #include "sundries.h" */
|
#ifdef LOOP_SET_FD
|
||||||
@@ -95,12 +101,22 @@ show_loop(char *device) {
|
@@ -93,12 +99,22 @@ show_loop(char *device) {
|
||||||
|
|
||||||
if (loopinfo64.lo_encrypt_type ||
|
if (loopinfo64.lo_encrypt_type ||
|
||||||
loopinfo64.lo_crypt_name[0]) {
|
loopinfo64.lo_crypt_name[0]) {
|
||||||
- char *e = loopinfo64.lo_crypt_name;
|
- char *e = (char *)loopinfo64.lo_crypt_name;
|
||||||
+ const char *e = (const char*)loopinfo64.lo_crypt_name;
|
+ const char *e = (const char *)loopinfo64.lo_crypt_name;
|
||||||
|
|
||||||
if (*e == 0 && loopinfo64.lo_encrypt_type == 1)
|
if (*e == 0 && loopinfo64.lo_encrypt_type == 1)
|
||||||
e = "XOR";
|
e = "XOR";
|
||||||
@ -88,7 +91,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
close (fd);
|
close (fd);
|
||||||
@@ -259,7 +275,7 @@ xgetpass(int pfd, const char *prompt) {
|
@@ -353,7 +369,7 @@ xgetpass(int pfd, const char *prompt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pass == NULL)
|
if (pass == NULL)
|
||||||
@ -97,7 +100,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
|
|
||||||
pass[i] = 0;
|
pass[i] = 0;
|
||||||
return pass;
|
return pass;
|
||||||
@@ -273,12 +289,30 @@ digits_only(const char *s) {
|
@@ -367,12 +383,30 @@ digits_only(const char *s) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,18 +130,15 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
int fd, ffd, mode, i;
|
int fd, ffd, mode, i;
|
||||||
- char *pass;
|
- char *pass;
|
||||||
+ char *pass = NULL;
|
+ char *pass = NULL;
|
||||||
|
char *filename;
|
||||||
|
|
||||||
mode = (*loopro ? O_RDONLY : O_RDWR);
|
if (verbose) {
|
||||||
if ((ffd = open(file, mode)) < 0) {
|
@@ -406,13 +440,41 @@ set_loop(const char *device, const char
|
||||||
@@ -297,15 +331,43 @@ set_loop(const char *device, const char
|
filename = (char *) file;
|
||||||
|
xstrncpy((char *)loopinfo64.lo_file_name, filename, LO_NAME_SIZE);
|
||||||
|
|
||||||
memset(&loopinfo64, 0, sizeof(loopinfo64));
|
|
||||||
|
|
||||||
- xstrncpy(loopinfo64.lo_file_name, file, LO_NAME_SIZE);
|
|
||||||
+ xstrncpy((char*)loopinfo64.lo_file_name, file, LO_NAME_SIZE);
|
|
||||||
+
|
|
||||||
+ loopinfo64.lo_encrypt_key_size = 0;
|
+ loopinfo64.lo_encrypt_key_size = 0;
|
||||||
|
+
|
||||||
if (encryption && *encryption) {
|
if (encryption && *encryption) {
|
||||||
+ // a hint for suse users
|
+ // a hint for suse users
|
||||||
+ if(!strcmp(encryption, "twofishSL92")) {
|
+ if(!strcmp(encryption, "twofishSL92")) {
|
||||||
@ -151,7 +151,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
loopinfo64.lo_encrypt_type = atoi(encryption);
|
loopinfo64.lo_encrypt_type = atoi(encryption);
|
||||||
} else {
|
} else {
|
||||||
- loopinfo64.lo_encrypt_type = LO_CRYPT_CRYPTOAPI;
|
- loopinfo64.lo_encrypt_type = LO_CRYPT_CRYPTOAPI;
|
||||||
- snprintf(loopinfo64.lo_crypt_name, LO_NAME_SIZE,
|
- snprintf((char *)loopinfo64.lo_crypt_name, LO_NAME_SIZE,
|
||||||
+ // check for something like twofish256
|
+ // check for something like twofish256
|
||||||
+ unsigned len = strlen(encryption);
|
+ unsigned len = strlen(encryption);
|
||||||
+ snprintf((char*)loopinfo64.lo_crypt_name, LO_NAME_SIZE,
|
+ snprintf((char*)loopinfo64.lo_crypt_name, LO_NAME_SIZE,
|
||||||
@ -177,7 +177,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,20 +387,64 @@ set_loop(const char *device, const char
|
@@ -432,20 +494,64 @@ set_loop(const char *device, const char
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
+ void (*hfunc)(const unsigned char*, size_t, unsigned char*, size_t) = NULL;
|
+ void (*hfunc)(const unsigned char*, size_t, unsigned char*, size_t) = NULL;
|
||||||
+
|
+
|
||||||
memset(loopinfo64.lo_encrypt_key, 0, LO_KEY_SIZE);
|
memset(loopinfo64.lo_encrypt_key, 0, LO_KEY_SIZE);
|
||||||
- xstrncpy(loopinfo64.lo_encrypt_key, pass, LO_KEY_SIZE);
|
- xstrncpy((char *)loopinfo64.lo_encrypt_key, pass, LO_KEY_SIZE);
|
||||||
+
|
+
|
||||||
+ pass = xgetpass(pfd, _("Password: "));
|
+ pass = xgetpass(pfd, _("Password: "));
|
||||||
+ if(!pass) {
|
+ if(!pass) {
|
||||||
@ -254,7 +254,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ioctl(fd, LOOP_SET_FD, ffd) < 0) {
|
if (ioctl(fd, LOOP_SET_FD, ffd) < 0) {
|
||||||
@@ -416,8 +522,8 @@ mutter(void) {
|
@@ -532,8 +638,8 @@ mutter(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -265,7 +265,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
mutter();
|
mutter();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -456,7 +562,13 @@ usage(void) {
|
@@ -569,7 +675,13 @@ usage(void) {
|
||||||
" %1$s [ options ] {-f|--find|loop_device} file # setup\n"
|
" %1$s [ options ] {-f|--find|loop_device} file # setup\n"
|
||||||
"\nOptions:\n"
|
"\nOptions:\n"
|
||||||
" -e | --encryption <type> enable data encryption with specified <name/num>\n"
|
" -e | --encryption <type> enable data encryption with specified <name/num>\n"
|
||||||
@ -279,7 +279,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
" -o | --offset <num> start at offset <num> into file\n"
|
" -o | --offset <num> start at offset <num> into file\n"
|
||||||
" -p | --pass-fd <num> read passphrase from file descriptor <num>\n"
|
" -p | --pass-fd <num> read passphrase from file descriptor <num>\n"
|
||||||
" -r | --read-only setup read-only loop device\n"
|
" -r | --read-only setup read-only loop device\n"
|
||||||
@@ -497,11 +609,14 @@ error (const char *fmt, ...) {
|
@@ -582,11 +694,14 @@ usage(void) {
|
||||||
int
|
int
|
||||||
main(int argc, char **argv) {
|
main(int argc, char **argv) {
|
||||||
char *p, *offset, *encryption, *passfd, *device, *file;
|
char *p, *offset, *encryption, *passfd, *device, *file;
|
||||||
@ -294,7 +294,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
unsigned long long off;
|
unsigned long long off;
|
||||||
struct option longopts[] = {
|
struct option longopts[] = {
|
||||||
{ "all", 0, 0, 'a' },
|
{ "all", 0, 0, 'a' },
|
||||||
@@ -509,6 +624,8 @@ main(int argc, char **argv) {
|
@@ -594,6 +709,8 @@ main(int argc, char **argv) {
|
||||||
{ "encryption", 1, 0, 'e' },
|
{ "encryption", 1, 0, 'e' },
|
||||||
{ "find", 0, 0, 'f' },
|
{ "find", 0, 0, 'f' },
|
||||||
{ "help", 0, 0, 'h' },
|
{ "help", 0, 0, 'h' },
|
||||||
@ -303,7 +303,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
{ "offset", 1, 0, 'o' },
|
{ "offset", 1, 0, 'o' },
|
||||||
{ "pass-fd", 1, 0, 'p' },
|
{ "pass-fd", 1, 0, 'p' },
|
||||||
{ "read-only", 0, 0, 'r' },
|
{ "read-only", 0, 0, 'r' },
|
||||||
@@ -524,12 +641,13 @@ main(int argc, char **argv) {
|
@@ -609,12 +726,13 @@ main(int argc, char **argv) {
|
||||||
delete = find = all = 0;
|
delete = find = all = 0;
|
||||||
off = 0;
|
off = 0;
|
||||||
offset = encryption = passfd = NULL;
|
offset = encryption = passfd = NULL;
|
||||||
@ -318,7 +318,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
longopts, NULL)) != -1) {
|
longopts, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'a':
|
case 'a':
|
||||||
@@ -548,6 +666,12 @@ main(int argc, char **argv) {
|
@@ -633,6 +751,12 @@ main(int argc, char **argv) {
|
||||||
case 'f':
|
case 'f':
|
||||||
find = 1;
|
find = 1;
|
||||||
break;
|
break;
|
||||||
@ -331,7 +331,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
case 'o':
|
case 'o':
|
||||||
offset = optarg;
|
offset = optarg;
|
||||||
break;
|
break;
|
||||||
@@ -611,8 +735,10 @@ main(int argc, char **argv) {
|
@@ -696,8 +820,10 @@ main(int argc, char **argv) {
|
||||||
usage();
|
usage();
|
||||||
if (passfd && sscanf(passfd, "%d", &pfd) != 1)
|
if (passfd && sscanf(passfd, "%d", &pfd) != 1)
|
||||||
usage();
|
usage();
|
||||||
@ -343,11 +343,11 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
if (res == 2 && find) {
|
if (res == 2 && find) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf("stolen loop=%s...trying again\n",
|
printf("stolen loop=%s...trying again\n",
|
||||||
Index: util-linux-ng-2.13rc2+git20070725/mount/mount.c
|
Index: util-linux-ng-2.13.0.1+git20071106/mount/mount.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- util-linux-ng-2.13rc2+git20070725.orig/mount/mount.c
|
--- util-linux-ng-2.13.0.1+git20071106.orig/mount/mount.c
|
||||||
+++ util-linux-ng-2.13rc2+git20070725/mount/mount.c
|
+++ util-linux-ng-2.13.0.1+git20071106/mount/mount.c
|
||||||
@@ -93,6 +93,9 @@ static int suid = 0;
|
@@ -88,6 +88,9 @@ static int suid = 0;
|
||||||
/* Contains the fd to read the passphrase from, if any. */
|
/* Contains the fd to read the passphrase from, if any. */
|
||||||
static int pfd = -1;
|
static int pfd = -1;
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/mount.c
|
|||||||
/* Map from -o and fstab option strings to the flag argument to mount(2). */
|
/* Map from -o and fstab option strings to the flag argument to mount(2). */
|
||||||
struct opt_map {
|
struct opt_map {
|
||||||
const char *opt; /* option name */
|
const char *opt; /* option name */
|
||||||
@@ -190,6 +193,7 @@ static int opt_nofail = 0;
|
@@ -185,6 +188,7 @@ static int opt_nofail = 0;
|
||||||
|
|
||||||
static const char *opt_loopdev, *opt_vfstype, *opt_offset, *opt_encryption,
|
static const char *opt_loopdev, *opt_vfstype, *opt_offset, *opt_encryption,
|
||||||
*opt_speed, *opt_comment, *opt_uhelper;
|
*opt_speed, *opt_comment, *opt_uhelper;
|
||||||
@ -365,7 +365,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/mount.c
|
|||||||
|
|
||||||
static int mounted (const char *spec0, const char *node0);
|
static int mounted (const char *spec0, const char *node0);
|
||||||
static int check_special_mountprog(const char *spec, const char *node,
|
static int check_special_mountprog(const char *spec, const char *node,
|
||||||
@@ -204,6 +208,9 @@ static struct string_opt_map {
|
@@ -199,6 +203,9 @@ static struct string_opt_map {
|
||||||
{ "vfs=", 1, &opt_vfstype },
|
{ "vfs=", 1, &opt_vfstype },
|
||||||
{ "offset=", 0, &opt_offset },
|
{ "offset=", 0, &opt_offset },
|
||||||
{ "encryption=", 0, &opt_encryption },
|
{ "encryption=", 0, &opt_encryption },
|
||||||
@ -375,7 +375,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/mount.c
|
|||||||
{ "speed=", 0, &opt_speed },
|
{ "speed=", 0, &opt_speed },
|
||||||
{ "comment=", 1, &opt_comment },
|
{ "comment=", 1, &opt_comment },
|
||||||
{ "uhelper=", 0, &opt_uhelper },
|
{ "uhelper=", 0, &opt_uhelper },
|
||||||
@@ -858,7 +865,7 @@ loop_check(const char **spec, const char
|
@@ -902,7 +909,7 @@ loop_check(const char **spec, const char
|
||||||
*type = opt_vfstype;
|
*type = opt_vfstype;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,7 +384,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/mount.c
|
|||||||
*loopfile = *spec;
|
*loopfile = *spec;
|
||||||
|
|
||||||
if (*loop) {
|
if (*loop) {
|
||||||
@@ -879,9 +886,17 @@ loop_check(const char **spec, const char
|
@@ -928,9 +935,17 @@ loop_check(const char **spec, const char
|
||||||
return EX_SYSERR; /* no more loop devices */
|
return EX_SYSERR; /* no more loop devices */
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf(_("mount: going to use the loop device %s\n"), *loopdev);
|
printf(_("mount: going to use the loop device %s\n"), *loopdev);
|
||||||
@ -404,24 +404,15 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/mount.c
|
|||||||
if (res == 2) {
|
if (res == 2) {
|
||||||
/* loop dev has been grabbed by some other process,
|
/* loop dev has been grabbed by some other process,
|
||||||
try again, if not given explicitly */
|
try again, if not given explicitly */
|
||||||
@@ -1184,7 +1199,7 @@ try_mount_one (const char *spec0, const
|
@@ -1677,6 +1692,7 @@ static struct option longopts[] = {
|
||||||
error (_("mount: %s not mounted already, or bad option"), node);
|
|
||||||
} else {
|
|
||||||
error (_("mount: wrong fs type, bad option, bad superblock on %s,\n"
|
|
||||||
- " missing codepage or other error"),
|
|
||||||
+ " missing codepage or helper program, or other error"),
|
|
||||||
spec);
|
|
||||||
|
|
||||||
if (stat(spec, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)
|
|
||||||
@@ -1629,6 +1644,7 @@ static struct option longopts[] = {
|
|
||||||
{ "options", 1, 0, 'o' },
|
{ "options", 1, 0, 'o' },
|
||||||
{ "test-opts", 1, 0, 'O' },
|
{ "test-opts", 1, 0, 'O' },
|
||||||
{ "pass-fd", 1, 0, 'p' },
|
{ "pass-fd", 1, 0, 'p' },
|
||||||
+ { "keybits", 1, 0, 'k' },
|
+ { "keybits", 1, 0, 'k' },
|
||||||
{ "types", 1, 0, 't' },
|
{ "types", 1, 0, 't' },
|
||||||
{ "bind", 0, 0, 128 },
|
{ "bind", 0, 0, 128 },
|
||||||
{ "replace", 0, 0, 129 },
|
{ "move", 0, 0, 133 },
|
||||||
@@ -1781,6 +1797,7 @@ main(int argc, char *argv[]) {
|
@@ -1823,6 +1839,7 @@ main(int argc, char *argv[]) {
|
||||||
char *options = NULL, *test_opts = NULL, *node;
|
char *options = NULL, *test_opts = NULL, *node;
|
||||||
const char *spec = NULL;
|
const char *spec = NULL;
|
||||||
char *label = NULL;
|
char *label = NULL;
|
||||||
@ -429,7 +420,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/mount.c
|
|||||||
char *uuid = NULL;
|
char *uuid = NULL;
|
||||||
char *types = NULL;
|
char *types = NULL;
|
||||||
char *p;
|
char *p;
|
||||||
@@ -1811,7 +1828,7 @@ main(int argc, char *argv[]) {
|
@@ -1853,7 +1870,7 @@ main(int argc, char *argv[]) {
|
||||||
initproctitle(argc, argv);
|
initproctitle(argc, argv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -438,7 +429,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/mount.c
|
|||||||
longopts, NULL)) != -1) {
|
longopts, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'a': /* mount everything in fstab */
|
case 'a': /* mount everything in fstab */
|
||||||
@@ -1829,6 +1846,9 @@ main(int argc, char *argv[]) {
|
@@ -1871,6 +1888,9 @@ main(int argc, char *argv[]) {
|
||||||
case 'i':
|
case 'i':
|
||||||
external_allowed = 0;
|
external_allowed = 0;
|
||||||
break;
|
break;
|
||||||
@ -448,9 +439,9 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/mount.c
|
|||||||
case 'l':
|
case 'l':
|
||||||
list_with_volumelabel = 1;
|
list_with_volumelabel = 1;
|
||||||
break;
|
break;
|
||||||
@@ -1975,6 +1995,9 @@ main(int argc, char *argv[]) {
|
@@ -2007,6 +2027,9 @@ main(int argc, char *argv[]) {
|
||||||
create_mtab ();
|
|
||||||
}
|
atexit(unlock_mtab);
|
||||||
|
|
||||||
+ if (keysize && sscanf(keysize,"%d",&keysz) != 1)
|
+ if (keysize && sscanf(keysize,"%d",&keysz) != 1)
|
||||||
+ die (EX_USAGE, _("mount: argument to --keybits or -k must be a number"));
|
+ die (EX_USAGE, _("mount: argument to --keybits or -k must be a number"));
|
||||||
@ -458,23 +449,10 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/mount.c
|
|||||||
switch (argc+specseen) {
|
switch (argc+specseen) {
|
||||||
case 0:
|
case 0:
|
||||||
/* mount -a */
|
/* mount -a */
|
||||||
Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.h
|
Index: util-linux-ng-2.13.0.1+git20071106/mount/rmd160.c
|
||||||
===================================================================
|
|
||||||
--- util-linux-ng-2.13rc2+git20070725.orig/mount/lomount.h
|
|
||||||
+++ util-linux-ng-2.13rc2+git20070725/mount/lomount.h
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
extern int verbose;
|
|
||||||
-extern int set_loop(const char *, const char *, unsigned long long,
|
|
||||||
- const char *, int, int *);
|
|
||||||
+extern int set_loop(const char *device, const char *file, unsigned long long offset,
|
|
||||||
+ const char *encryption, const char* phash, int pfd, int *loopro, int keysz);
|
|
||||||
extern int del_loop(const char *);
|
|
||||||
extern int is_loop_device(const char *);
|
|
||||||
extern char * find_unused_loop_device(void);
|
|
||||||
Index: util-linux-ng-2.13rc2+git20070725/mount/rmd160.c
|
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ util-linux-ng-2.13rc2+git20070725/mount/rmd160.c
|
+++ util-linux-ng-2.13.0.1+git20071106/mount/rmd160.c
|
||||||
@@ -0,0 +1,532 @@
|
@@ -0,0 +1,532 @@
|
||||||
+/* rmd160.c - RIPE-MD160
|
+/* rmd160.c - RIPE-MD160
|
||||||
+ * Copyright (C) 1998 Free Software Foundation, Inc.
|
+ * Copyright (C) 1998 Free Software Foundation, Inc.
|
||||||
@ -1008,10 +986,10 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/rmd160.c
|
|||||||
+ rmd160_final( &hd );
|
+ rmd160_final( &hd );
|
||||||
+ memcpy( outbuf, hd.buf, 20 );
|
+ memcpy( outbuf, hd.buf, 20 );
|
||||||
+}
|
+}
|
||||||
Index: util-linux-ng-2.13rc2+git20070725/mount/sha512.c
|
Index: util-linux-ng-2.13.0.1+git20071106/mount/sha512.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ util-linux-ng-2.13rc2+git20070725/mount/sha512.c
|
+++ util-linux-ng-2.13.0.1+git20071106/mount/sha512.c
|
||||||
@@ -0,0 +1,432 @@
|
@@ -0,0 +1,432 @@
|
||||||
+/*
|
+/*
|
||||||
+ * sha512.c
|
+ * sha512.c
|
||||||
@ -1445,10 +1423,10 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/sha512.c
|
|||||||
+ memset(&ctx, 0, sizeof(ctx));
|
+ memset(&ctx, 0, sizeof(ctx));
|
||||||
+}
|
+}
|
||||||
+#endif
|
+#endif
|
||||||
Index: util-linux-ng-2.13rc2+git20070725/mount/sha512.h
|
Index: util-linux-ng-2.13.0.1+git20071106/mount/sha512.h
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ util-linux-ng-2.13rc2+git20070725/mount/sha512.h
|
+++ util-linux-ng-2.13.0.1+git20071106/mount/sha512.h
|
||||||
@@ -0,0 +1,45 @@
|
@@ -0,0 +1,45 @@
|
||||||
+/*
|
+/*
|
||||||
+ * sha512.h
|
+ * sha512.h
|
||||||
@ -1495,3 +1473,15 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/sha512.h
|
|||||||
+/* no sha384_write(), use sha512_write() */
|
+/* no sha384_write(), use sha512_write() */
|
||||||
+/* no sha384_final(), use sha512_final(), result in ctx->sha_out[0...47] */
|
+/* no sha384_final(), use sha512_final(), result in ctx->sha_out[0...47] */
|
||||||
+extern void sha384_hash_buffer(const unsigned char *, size_t, unsigned char *, size_t);
|
+extern void sha384_hash_buffer(const unsigned char *, size_t, unsigned char *, size_t);
|
||||||
|
Index: util-linux-ng-2.13.0.1+git20071106/mount/lomount.h
|
||||||
|
===================================================================
|
||||||
|
--- util-linux-ng-2.13.0.1+git20071106.orig/mount/lomount.h
|
||||||
|
+++ util-linux-ng-2.13.0.1+git20071106/mount/lomount.h
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
-extern int set_loop(const char *, const char *, unsigned long long,
|
||||||
|
- const char *, int, int *);
|
||||||
|
+extern int set_loop(const char *device, const char *file, unsigned long long offset,
|
||||||
|
+ const char *encryption, const char* phash, int pfd, int *loopro, int keysz);
|
||||||
|
extern int del_loop(const char *);
|
||||||
|
extern int is_loop_device(const char *);
|
||||||
|
extern char * find_unused_loop_device(void);
|
||||||
|
3
util-linux-ng-2.13.0.1+git20071106.tar.bz2
Normal file
3
util-linux-ng-2.13.0.1+git20071106.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:b7a2605c41e987edeec27dd043952517c81d06291a41bc491fed60871edb0759
|
||||||
|
size 1565548
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:002412e93d8e85b1796fdbe65bbb0a4d193d0317a7155fda4270667e08bdfbfc
|
|
||||||
size 2702618
|
|
@ -1,3 +1,12 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Nov 6 16:11:02 CET 2007 - mkoenig@suse.de
|
||||||
|
|
||||||
|
- update to 2.13.0.1+git20071106
|
||||||
|
- prevent loop mounting the same file twice [#240653]
|
||||||
|
- merged upstream:
|
||||||
|
util-linux-2.13-mount_helper_fix.patch
|
||||||
|
util-linux-2.13-hwclock_rtc_option.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Oct 4 22:24:04 CEST 2007 - bg@suse.de
|
Thu Oct 4 22:24:04 CEST 2007 - bg@suse.de
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# spec file for package util-linux (Version 2.13)
|
# spec file for package util-linux (Version 2.13.0.1+git20071106)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
# This file and all modifications and additions to the pristine
|
# This file and all modifications and additions to the pristine
|
||||||
@ -20,11 +20,10 @@ PreReq: %install_info_prereq permissions
|
|||||||
License: BSD 3-Clause; GPL v2 or later
|
License: BSD 3-Clause; GPL v2 or later
|
||||||
Group: System/Base
|
Group: System/Base
|
||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
Version: 2.13
|
Version: 2.13.0.1+git20071106
|
||||||
Release: 2
|
Release: 1
|
||||||
%define upver 2.13
|
|
||||||
Summary: A collection of basic system utilities
|
Summary: A collection of basic system utilities
|
||||||
Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/%name-ng-%upver.tar.bz2
|
Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/%name-ng-%version.tar.bz2
|
||||||
Source2: nologin.c
|
Source2: nologin.c
|
||||||
Source3: nologin.8
|
Source3: nologin.8
|
||||||
Source4: raw.init
|
Source4: raw.init
|
||||||
@ -67,8 +66,6 @@ Patch38: util-linux-2.12r-mount_swapon_swsuspend_resume.patch
|
|||||||
Patch10: util-linux-2.13-mount_losetup_crypto.patch
|
Patch10: util-linux-2.13-mount_losetup_crypto.patch
|
||||||
Patch11: util-linux-2.13-mount_fd_leak.patch
|
Patch11: util-linux-2.13-mount_fd_leak.patch
|
||||||
Patch12: util-linux-2.13-fdisk_cfdisk_ncursesw.patch
|
Patch12: util-linux-2.13-fdisk_cfdisk_ncursesw.patch
|
||||||
Patch13: util-linux-2.13-mount_helper_fix.patch
|
|
||||||
Patch14: util-linux-2.13-hwclock_rtc_option.patch
|
|
||||||
##
|
##
|
||||||
##
|
##
|
||||||
## adjtimex
|
## adjtimex
|
||||||
@ -102,7 +99,7 @@ Authors:
|
|||||||
Karel Zak <kzak@redhat.com>
|
Karel Zak <kzak@redhat.com>
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -a 9 -b 10 -b 11 -b 12 -b 13 -n %name-ng-%upver
|
%setup -q -a 9 -b 10 -b 11 -b 12 -b 13 -n %name-ng-%version
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
@ -111,8 +108,6 @@ Authors:
|
|||||||
%patch10 -p1
|
%patch10 -p1
|
||||||
%patch11 -p1
|
%patch11 -p1
|
||||||
%patch12 -p1
|
%patch12 -p1
|
||||||
%patch13 -p1
|
|
||||||
%patch14 -p1
|
|
||||||
#
|
#
|
||||||
cd adjtimex-*
|
cd adjtimex-*
|
||||||
%patch50 -p1
|
%patch50 -p1
|
||||||
@ -176,8 +171,8 @@ make setctsid CFLAGS="$RPM_OPT_FLAGS"
|
|||||||
CFLAGS=-DCONFIG_SMP
|
CFLAGS=-DCONFIG_SMP
|
||||||
%endif
|
%endif
|
||||||
# Use autogen, when building from git tree
|
# Use autogen, when building from git tree
|
||||||
autoreconf -fi
|
#autoreconf -fi
|
||||||
#./autogen.sh
|
./autogen.sh
|
||||||
./configure --mandir=%{_mandir} \
|
./configure --mandir=%{_mandir} \
|
||||||
--datadir=%{_datadir} \
|
--datadir=%{_datadir} \
|
||||||
--with-fsprobe=volume_id \
|
--with-fsprobe=volume_id \
|
||||||
@ -277,6 +272,12 @@ rm -f $RPM_BUILD_ROOT/usr/bin/parisc
|
|||||||
rm -f $RPM_BUILD_ROOT/usr/bin/parisc32
|
rm -f $RPM_BUILD_ROOT/usr/bin/parisc32
|
||||||
rm -f $RPM_BUILD_ROOT/usr/bin/parisc64
|
rm -f $RPM_BUILD_ROOT/usr/bin/parisc64
|
||||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/setarch.8
|
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/setarch.8
|
||||||
|
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/i386.8
|
||||||
|
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/x86_64.8
|
||||||
|
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/linux{32,64}.8
|
||||||
|
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/ia64.8
|
||||||
|
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/s390{,x}.8
|
||||||
|
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/ppc{,32,64}.8
|
||||||
# arch dependent
|
# arch dependent
|
||||||
%ifarch s390 s390x
|
%ifarch s390 s390x
|
||||||
rm -f $RPM_BUILD_ROOT/etc/fdprm
|
rm -f $RPM_BUILD_ROOT/etc/fdprm
|
||||||
@ -553,6 +554,12 @@ fi
|
|||||||
#/usr/bin/ia64
|
#/usr/bin/ia64
|
||||||
#%endif
|
#%endif
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 06 2007 - mkoenig@suse.de
|
||||||
|
- update to 2.13.0.1+git20071106
|
||||||
|
- prevent loop mounting the same file twice [#240653]
|
||||||
|
- merged upstream:
|
||||||
|
util-linux-2.13-mount_helper_fix.patch
|
||||||
|
util-linux-2.13-hwclock_rtc_option.patch
|
||||||
* Thu Oct 04 2007 - bg@suse.de
|
* Thu Oct 04 2007 - bg@suse.de
|
||||||
- don't use parisc, parisc32 and parisc64.
|
- don't use parisc, parisc32 and parisc64.
|
||||||
* Mon Oct 01 2007 - mkoenig@suse.de
|
* Mon Oct 01 2007 - mkoenig@suse.de
|
||||||
|
Loading…
Reference in New Issue
Block a user