forked from pool/util-linux
This commit is contained in:
parent
6b1cb9fd1b
commit
e9c228c255
@ -130,7 +130,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
|
|
||||||
mode = (*loopro ? O_RDONLY : O_RDWR);
|
mode = (*loopro ? O_RDONLY : O_RDWR);
|
||||||
if ((ffd = open(file, mode)) < 0) {
|
if ((ffd = open(file, mode)) < 0) {
|
||||||
@@ -297,15 +331,39 @@ set_loop(const char *device, const char
|
@@ -297,15 +331,43 @@ set_loop(const char *device, const char
|
||||||
|
|
||||||
memset(&loopinfo64, 0, sizeof(loopinfo64));
|
memset(&loopinfo64, 0, sizeof(loopinfo64));
|
||||||
|
|
||||||
@ -143,6 +143,8 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
+ // a hint for suse users
|
+ // a hint for suse users
|
||||||
+ if(!strcmp(encryption, "twofishSL92")) {
|
+ if(!strcmp(encryption, "twofishSL92")) {
|
||||||
+ fprintf(stderr, _("twofishSL92 is not supported via cryptoloop, please use dm-crypt to access the volume\n"));
|
+ fprintf(stderr, _("twofishSL92 is not supported via cryptoloop, please use dm-crypt to access the volume\n"));
|
||||||
|
+ close(fd);
|
||||||
|
+ close(ffd);
|
||||||
+ return 1;
|
+ return 1;
|
||||||
+ }
|
+ }
|
||||||
if (digits_only(encryption)) {
|
if (digits_only(encryption)) {
|
||||||
@ -167,13 +169,15 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
+ fprintf(stderr, _("please either specify '%s%d' or -e '%s' -k '%d'\n"),
|
+ fprintf(stderr, _("please either specify '%s%d' or -e '%s' -k '%d'\n"),
|
||||||
+ loopinfo64.lo_crypt_name, loopinfo64.lo_encrypt_key_size<<3,
|
+ loopinfo64.lo_crypt_name, loopinfo64.lo_encrypt_key_size<<3,
|
||||||
+ loopinfo64.lo_crypt_name, keysz);
|
+ loopinfo64.lo_crypt_name, keysz);
|
||||||
|
+ close(fd);
|
||||||
|
+ close(ffd);
|
||||||
+ return 1;
|
+ return 1;
|
||||||
+ }
|
+ }
|
||||||
+ loopinfo64.lo_encrypt_type = LO_CRYPT_CRYPTOAPI;
|
+ loopinfo64.lo_encrypt_type = LO_CRYPT_CRYPTOAPI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,20 +383,57 @@ set_loop(const char *device, const char
|
@@ -325,20 +387,64 @@ set_loop(const char *device, const char
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -194,8 +198,11 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
- xstrncpy(loopinfo64.lo_encrypt_key, pass, LO_KEY_SIZE);
|
- xstrncpy(loopinfo64.lo_encrypt_key, pass, LO_KEY_SIZE);
|
||||||
+
|
+
|
||||||
+ pass = xgetpass(pfd, _("Password: "));
|
+ pass = xgetpass(pfd, _("Password: "));
|
||||||
+ if(!pass)
|
+ if(!pass) {
|
||||||
|
+ close(fd);
|
||||||
|
+ close(ffd);
|
||||||
+ return 1;
|
+ return 1;
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
+ // set default hash functions, loop-AES compatible
|
+ // set default hash functions, loop-AES compatible
|
||||||
+ if(loopinfo64.lo_encrypt_type == LO_CRYPT_CRYPTOAPI) {
|
+ if(loopinfo64.lo_encrypt_type == LO_CRYPT_CRYPTOAPI) {
|
||||||
@ -211,6 +218,8 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
+ if(!keysz) {
|
+ if(!keysz) {
|
||||||
+ if(verbose)
|
+ if(verbose)
|
||||||
+ fprintf(stderr, _("please specify a key length\n"));
|
+ fprintf(stderr, _("please specify a key length\n"));
|
||||||
|
+ close(fd);
|
||||||
|
+ close(ffd);
|
||||||
+ return 1;
|
+ return 1;
|
||||||
+ }
|
+ }
|
||||||
+ loopinfo64.lo_encrypt_key_size = keysz>>3;
|
+ loopinfo64.lo_encrypt_key_size = keysz>>3;
|
||||||
@ -229,6 +238,8 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
+ hfunc = phash_none;
|
+ hfunc = phash_none;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ fprintf(stderr, _("unsupported hash method '%s'\n"), phash);
|
+ fprintf(stderr, _("unsupported hash method '%s'\n"), phash);
|
||||||
|
+ close(fd);
|
||||||
|
+ close(ffd);
|
||||||
+ return 1;
|
+ return 1;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
@ -243,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 +511,8 @@ mutter(void) {
|
@@ -416,8 +522,8 @@ mutter(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -254,7 +265,7 @@ Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
|||||||
mutter();
|
mutter();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -456,7 +551,13 @@ usage(void) {
|
@@ -456,7 +562,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"
|
||||||
@ -268,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 +598,14 @@ error (const char *fmt, ...) {
|
@@ -497,11 +609,14 @@ error (const char *fmt, ...) {
|
||||||
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;
|
||||||
@ -283,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 +613,8 @@ main(int argc, char **argv) {
|
@@ -509,6 +624,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' },
|
||||||
@ -292,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 +630,13 @@ main(int argc, char **argv) {
|
@@ -524,12 +641,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;
|
||||||
@ -307,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 +655,12 @@ main(int argc, char **argv) {
|
@@ -548,6 +666,12 @@ main(int argc, char **argv) {
|
||||||
case 'f':
|
case 'f':
|
||||||
find = 1;
|
find = 1;
|
||||||
break;
|
break;
|
||||||
@ -320,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 +724,10 @@ main(int argc, char **argv) {
|
@@ -611,8 +735,10 @@ main(int argc, char **argv) {
|
||||||
usage();
|
usage();
|
||||||
if (passfd && sscanf(passfd, "%d", &pfd) != 1)
|
if (passfd && sscanf(passfd, "%d", &pfd) != 1)
|
||||||
usage();
|
usage();
|
||||||
|
12
util-linux-2.13-mount_fd_leak.patch
Normal file
12
util-linux-2.13-mount_fd_leak.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
||||||
|
===================================================================
|
||||||
|
--- util-linux-ng-2.13rc2+git20070725.orig/mount/lomount.c
|
||||||
|
+++ util-linux-ng-2.13rc2+git20070725/mount/lomount.c
|
||||||
|
@@ -325,6 +325,7 @@ set_loop(const char *device, const char
|
||||||
|
}
|
||||||
|
if ((fd = open(device, mode)) < 0) {
|
||||||
|
perror (device);
|
||||||
|
+ close(ffd);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
*loopro = (mode == O_RDONLY);
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Aug 29 12:22:21 CEST 2007 - mkoenig@suse.de
|
||||||
|
|
||||||
|
- fix fd leaks in previous patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Aug 28 16:42:04 CEST 2007 - lnussel@suse.de
|
Tue Aug 28 16:42:04 CEST 2007 - lnussel@suse.de
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ License: BSD 3-Clause, GPL v2 or later
|
|||||||
Group: System/Base
|
Group: System/Base
|
||||||
Autoreqprov: on
|
Autoreqprov: on
|
||||||
Version: 2.12r+2.13rc2+git20070725
|
Version: 2.12r+2.13rc2+git20070725
|
||||||
Release: 14
|
Release: 16
|
||||||
%define upver 2.13rc2+git20070725
|
%define upver 2.13rc2+git20070725
|
||||||
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-%upver.tar.bz2
|
||||||
@ -52,27 +52,28 @@ Source30: README.largedisk
|
|||||||
# add hostid
|
# add hostid
|
||||||
Patch1: util-linux-2.12-misc_utils_hostid.patch
|
Patch1: util-linux-2.12-misc_utils_hostid.patch
|
||||||
# 104405 - mount -a doesn't work with hotpluggable devices
|
# 104405 - mount -a doesn't work with hotpluggable devices
|
||||||
Patch16: util-linux-mount_opt_nofail.patch
|
Patch2: util-linux-mount_opt_nofail.patch
|
||||||
# 176582 - If the user doesn't specify -t <fstype> mount.fstype will never be called
|
# 176582 - If the user doesn't specify -t <fstype> mount.fstype will never be called
|
||||||
#TODO: check alternative upstream fix
|
#TODO: check alternative upstream fix
|
||||||
#Patch96: util-linux-2.12r-mount_external_prog_on_guess.patch
|
#Patch96: util-linux-2.12r-mount_external_prog_on_guess.patch
|
||||||
# 160822 - fix for 153657
|
# 160822 - fix for 153657
|
||||||
Patch29: util-linux-2.12r-fdisk_cyl.patch
|
Patch3: util-linux-2.12r-fdisk_cyl.patch
|
||||||
# 238687 - let mkfs tools open block devices with O_EXCL
|
# 238687 - let mkfs tools open block devices with O_EXCL
|
||||||
Patch34: util-linux-2.12r-disk_utils_mkfs_open_exclusive.patch
|
Patch4: util-linux-2.12r-disk_utils_mkfs_open_exclusive.patch
|
||||||
# 241372 - remove legacy warnings from fdisk
|
# 241372 - remove legacy warnings from fdisk
|
||||||
Patch35: util-linux-2.12r-fdisk_remove_bogus_warnings.patch
|
Patch5: util-linux-2.12r-fdisk_remove_bogus_warnings.patch
|
||||||
# 254437 - swapon should automatically reset the suspend signature
|
# 254437 - swapon should automatically reset the suspend signature
|
||||||
# TODO: Needs to be ported to new version
|
# TODO: Needs to be ported to new version
|
||||||
Patch38: util-linux-2.12r-mount_swapon_swsuspend_resume.patch
|
Patch38: util-linux-2.12r-mount_swapon_swsuspend_resume.patch
|
||||||
# suse48633 - util-linux on x86_64 does not contain "rdev" and "vidmode"
|
# suse48633 - util-linux on x86_64 does not contain "rdev" and "vidmode"
|
||||||
Patch45: util-linux-2.13-sys_utils_build_rdev_x86_64.patch
|
Patch6: util-linux-2.13-sys_utils_build_rdev_x86_64.patch
|
||||||
# 297172 - mount does not free loop devices if it fails
|
# 297172 - mount does not free loop devices if it fails
|
||||||
Patch46: util-linux-2.13-loop.patch
|
Patch7: util-linux-2.13-loop.patch
|
||||||
Patch47: util-linux-2.13-mount_create_mtab.patch
|
Patch8: util-linux-2.13-mount_create_mtab.patch
|
||||||
Patch48: util-linux-2.13-schedutils_error_handling.patch
|
Patch9: util-linux-2.13-schedutils_error_handling.patch
|
||||||
# 304861 - support password hashing and key length
|
# 304861 - support password hashing and key length
|
||||||
Patch49: cryptsetup-2.13-crypto.diff
|
Patch10: cryptsetup-2.13-crypto.diff
|
||||||
|
Patch11: util-linux-2.13-mount_fd_leak.patch
|
||||||
##
|
##
|
||||||
##
|
##
|
||||||
## adjtimex
|
## adjtimex
|
||||||
@ -108,19 +109,17 @@ Authors:
|
|||||||
%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-%upver
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%patch16 -p1
|
%patch2 -p1
|
||||||
#%patch26
|
%patch3 -p1
|
||||||
%patch29 -p1
|
%patch4 -p1
|
||||||
#%patch30 -p1
|
%patch5 -p1
|
||||||
#%patch32 -p1
|
|
||||||
%patch34 -p1
|
|
||||||
%patch35 -p1
|
|
||||||
#%patch38 -p1
|
#%patch38 -p1
|
||||||
%patch45 -p1
|
%patch6 -p1
|
||||||
%patch46 -p1
|
%patch7 -p1
|
||||||
%patch47 -p1
|
%patch8 -p1
|
||||||
%patch48 -p1
|
%patch9 -p1
|
||||||
%patch49 -p1
|
%patch10 -p1
|
||||||
|
%patch11 -p1
|
||||||
#
|
#
|
||||||
cd adjtimex-*
|
cd adjtimex-*
|
||||||
%patch50 -p1
|
%patch50 -p1
|
||||||
@ -561,6 +560,8 @@ fi
|
|||||||
#%endif
|
#%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Aug 29 2007 - mkoenig@suse.de
|
||||||
|
- fix fd leaks in previous patch
|
||||||
* Tue Aug 28 2007 - lnussel@suse.de
|
* Tue Aug 28 2007 - lnussel@suse.de
|
||||||
- add support for specifying the key length and password hash
|
- add support for specifying the key length and password hash
|
||||||
algorithm [#304861]
|
algorithm [#304861]
|
||||||
|
Loading…
Reference in New Issue
Block a user