summaryrefslogtreecommitdiffstats
path: root/sys-apps/util-linux/files/util-linux-2.12-gcloop.patch
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
commitca9627e70852f6b2e835660df870fe3ab405882d (patch)
tree0a008b1d5b16fa0679a195ed7b5662c7891f591c /sys-apps/util-linux/files/util-linux-2.12-gcloop.patch
downloaddarklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.gz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.bz2
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.xz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.zip
Initial import
Diffstat (limited to 'sys-apps/util-linux/files/util-linux-2.12-gcloop.patch')
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12-gcloop.patch116
1 files changed, 116 insertions, 0 deletions
diff --git a/sys-apps/util-linux/files/util-linux-2.12-gcloop.patch b/sys-apps/util-linux/files/util-linux-2.12-gcloop.patch
new file mode 100644
index 0000000..97be88c
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12-gcloop.patch
@@ -0,0 +1,116 @@
+diff -ruN util-linux-2.12.orig/mount/lomount.c util-linux-2.12/mount/lomount.c
+--- util-linux-2.12.orig/mount/lomount.c 2004-02-17 02:08:05.341716624 +0100
++++ util-linux-2.12/mount/lomount.c 2004-02-17 02:12:10.653423576 +0100
+@@ -60,7 +60,8 @@
+ info->lo_flags = info64->lo_flags;
+ info->lo_init[0] = info64->lo_init[0];
+ info->lo_init[1] = info64->lo_init[1];
+- if (info->lo_encrypt_type == LO_CRYPT_CRYPTOAPI)
++ if ((info->lo_encrypt_type == LO_CRYPT_CRYPTOAPI) ||
++ (info->lo_encrypt_type == LO_CRYPT_COMPRESS))
+ memcpy(info->lo_name, info64->lo_crypt_name, LO_NAME_SIZE);
+ else
+ memcpy(info->lo_name, info64->lo_file_name, LO_NAME_SIZE);
+@@ -321,7 +322,8 @@
+
+ int
+ set_loop(const char *device, const char *file, int offset,
+- const char *encryption, int pfd, int *loopro) {
++ const char *encnumber,const char *encryption,
++ int pfd, int *loopro) {
+ struct loop_info64 loopinfo64;
+ int fd, ffd, mode;
+ char *pass;
+@@ -344,8 +346,9 @@
+ memset(&loopinfo64, 0, sizeof(loopinfo64));
+
+ xstrncpy(loopinfo64.lo_file_name, file, LO_NAME_SIZE);
+-
++
+ if (encryption && *encryption) {
++
+ if (digits_only(encryption)) {
+ loopinfo64.lo_encrypt_type = atoi(encryption);
+ } else {
+@@ -386,6 +389,12 @@
+ }
+ }
+
++ if (encnumber && *encnumber) {
++
++ if (digits_only(encnumber))
++ loopinfo64.lo_encrypt_type = atoi(encnumber);
++ }
++
+ loopinfo64.lo_offset = offset;
+
+ #ifdef MCL_FUTURE
+@@ -601,7 +610,7 @@
+
+ int
+ main(int argc, char **argv) {
+- char *offset, *encryption, *passfd;
++ char *offset, *encryption, *encnumber, *passfd;
+ int delete, off, c;
+ int res = 0;
+ int ro = 0;
+@@ -612,7 +621,7 @@
+ textdomain(PACKAGE);
+
+ delete = off = 0;
+- offset = encryption = passfd = NULL;
++ offset = encryption = encnumber = passfd = NULL;
+ progname = argv[0];
+ while ((c = getopt(argc,argv,"de:E:o:p:v")) != -1) {
+ switch (c) {
+@@ -620,6 +629,7 @@
+ delete = 1;
+ break;
+ case 'E':
++ encnumber = optarg;
+ case 'e':
+ encryption = optarg;
+ break;
+@@ -651,7 +661,7 @@
+ if (passfd && sscanf(passfd,"%d",&pfd) != 1)
+ usage();
+ res = set_loop(argv[optind], argv[optind+1], off,
+- encryption, pfd, &ro);
++ encnumber, encryption, pfd, &ro);
+ }
+ return res;
+ }
+diff -ruN util-linux-2.12.orig/mount/lomount.h util-linux-2.12/mount/lomount.h
+--- util-linux-2.12.orig/mount/lomount.h 2004-02-17 02:08:05.339716928 +0100
++++ util-linux-2.12/mount/lomount.h 2004-02-17 02:08:14.921260312 +0100
+@@ -1,6 +1,6 @@
+ extern int verbose;
+ extern int set_loop(const char *, const char *, int, const char *,
+- int, int *);
++ const char *, int, int *);
+ extern int del_loop(const char *);
+ extern int is_loop_device(const char *);
+ extern char * find_unused_loop_device(void);
+diff -ruN util-linux-2.12.orig/mount/loop.h util-linux-2.12/mount/loop.h
+--- util-linux-2.12.orig/mount/loop.h 2004-02-17 02:08:05.341716624 +0100
++++ util-linux-2.12/mount/loop.h 2004-02-17 02:08:14.922260160 +0100
+@@ -2,6 +2,7 @@
+ #define LO_CRYPT_XOR 1
+ #define LO_CRYPT_DES 2
+ #define LO_CRYPT_CRYPTOAPI 18
++#define LO_CRYPT_COMPRESS 19
+
+ #define LOOP_SET_FD 0x4C00
+ #define LOOP_CLR_FD 0x4C01
+diff -ruN util-linux-2.12.orig/mount/mount.c util-linux-2.12/mount/mount.c
+--- util-linux-2.12.orig/mount/mount.c 2004-02-17 02:08:05.281725744 +0100
++++ util-linux-2.12/mount/mount.c 2004-02-17 02:08:14.924259856 +0100
+@@ -612,7 +612,7 @@
+ offset = opt_offset ? strtoul(opt_offset, NULL, 0) : 0;
+ if (opt_keygen)
+ pfd = use_keygen_prog(opt_keygen, keygen_args, _n_keygen_args);
+- if (set_loop(*loopdev, *loopfile, offset,
++ if (set_loop(*loopdev, *loopfile, offset, NULL,
+ opt_encryption, pfd, &loopro)) {
+ if (verbose)
+ printf(_("mount: failed setting up loop device\n"));