Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2
util-linux
util-linux-2.16-no-canonicalize.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File util-linux-2.16-no-canonicalize.patch of Package util-linux
--- mount/devname.c | 2 +- mount/mount.8 | 7 +++++++ mount/mount.c | 8 ++++++-- mount/sundries.c | 13 ++++++++++--- mount/sundries.h | 1 + mount/umount.8 | 4 ++++ mount/umount.c | 10 ++++++++-- 7 files changed, 37 insertions(+), 8 deletions(-) Index: util-linux-ng/mount/mount.8 =================================================================== --- util-linux-ng.orig/mount/mount.8 2010-11-15 14:09:14.000000000 +0100 +++ util-linux-ng/mount/mount.8 2010-11-15 14:23:26.000000000 +0100 @@ -408,6 +408,13 @@ Mount without writing in This is necessary for example when .I /etc is on a read-only file system. +.IP "\fB\-\-no\-canonicalize\fP" +Don't canonicalize paths. The mount command canonicalizes all paths +(from command line or fstab) and stores canonicalized paths to the +.IR /etc/mtab +file. This option can be used together with the +.B \-f +flag for already canonicalized absolut paths. .TP .BI \-p " num" In case of a loop mount with encryption, read the passphrase from Index: util-linux-ng/mount/mount.c =================================================================== --- util-linux-ng.orig/mount/mount.c 2010-11-15 14:09:14.000000000 +0100 +++ util-linux-ng/mount/mount.c 2010-11-15 14:26:17.000000000 +0100 @@ -1878,6 +1878,7 @@ static struct option longopts[] = { { "make-rslave", 0, 0, 141 }, { "make-rprivate", 0, 0, 142 }, { "make-runbindable", 0, 0, 143 }, + { "no-canonicalize", 0, 0, 144 }, { "internal-only", 0, 0, 'i' }, { NULL, 0, 0, 0 } }; @@ -2170,7 +2171,9 @@ main(int argc, char *argv[]) { case 143: mounttype = (MS_UNBINDABLE | MS_REC); break; - + case 144: + nocanonicalize = 1; + break; case '?': default: usage (stderr, EX_USAGE); @@ -2209,7 +2212,8 @@ main(int argc, char *argv[]) { if (restricted && (types || options || readwrite || nomtab || mount_all || - fake || mounttype || (argc + specseen) != 1)) { + nocanonicalize || fake || mounttype || + (argc + specseen) != 1)) { die (EX_USAGE, _("mount: only root can do that")); } Index: util-linux-ng/mount/sundries.c =================================================================== --- util-linux-ng.orig/mount/sundries.c 2010-11-15 14:09:14.000000000 +0100 +++ util-linux-ng/mount/sundries.c 2010-11-15 14:23:26.000000000 +0100 @@ -21,6 +21,7 @@ int mount_quiet; int verbose; +int nocanonicalize; char *progname; char * @@ -266,9 +267,9 @@ canonicalize_spec (const char *path) { char *res; - if (path == NULL) + if (!path) return NULL; - if (is_pseudo_fs(path)) + if (nocanonicalize || is_pseudo_fs(path)) return xstrdup(path); res = canonicalize_path(path); @@ -279,8 +280,14 @@ canonicalize_spec (const char *path) char *canonicalize (const char *path) { - char *res = canonicalize_path(path); + char *res; + if (!path) + return NULL; + else if (nocanonicalize) + return xstrdup(path); + + res = canonicalize_path(path); if (!res) die(EX_SYSERR, _("not enough memory")); return res; Index: util-linux-ng/mount/sundries.h =================================================================== --- util-linux-ng.orig/mount/sundries.h 2010-11-15 14:09:14.000000000 +0100 +++ util-linux-ng/mount/sundries.h 2010-11-15 14:23:26.000000000 +0100 @@ -16,6 +16,7 @@ /* global mount, umount, and losetup variables */ extern int mount_quiet; extern int verbose; +extern int nocanonicalize; extern char *progname; #define streq(s, t) (strcmp ((s), (t)) == 0) Index: util-linux-ng/mount/umount.8 =================================================================== --- util-linux-ng.orig/mount/umount.8 2010-11-15 14:09:14.000000000 +0100 +++ util-linux-ng/mount/umount.8 2010-11-15 14:27:15.000000000 +0100 @@ -111,6 +111,10 @@ Lazy unmount. Detach the filesystem from and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.) +.IP "\fB\-\-no\-canonicalize\fP" +Don't canonicalize paths. For more details about this option see the +.B mount(8) +man page. .SH "THE LOOP DEVICE" The Index: util-linux-ng/mount/umount.c =================================================================== --- util-linux-ng.orig/mount/umount.c 2010-11-15 14:18:33.000000000 +0100 +++ util-linux-ng/mount/umount.c 2010-11-15 14:27:15.000000000 +0100 @@ -388,6 +388,8 @@ static struct option longopts[] = { "version", 0, 0, 'V' }, { "read-only", 0, 0, 'r' }, { "types", 1, 0, 't' }, + + { "no-canonicalize", 0, 0, 144 }, { NULL, 0, 0, 0 } }; @@ -672,7 +674,10 @@ main (int argc, char *argv[]) { types = optarg; break; case 'i': - external_allowed = 0; + external_allowed = 0; + break; + case 144: + nocanonicalize = 1; break; case 0: break; @@ -691,7 +696,8 @@ main (int argc, char *argv[]) { } } - if (restricted && (all || types || nomtab || force || remount)) { + if (restricted && + (all || types || nomtab || force || remount || nocanonicalize)) { die (2, _("umount: only root can do that")); } Index: util-linux-ng/mount/devname.c =================================================================== --- util-linux-ng.orig/mount/devname.c 2010-11-11 15:33:47.000000000 +0100 +++ util-linux-ng/mount/devname.c 2010-11-15 14:42:22.000000000 +0100 @@ -8,7 +8,7 @@ spec_to_devname(const char *spec) { if (!spec) return NULL; - if (is_pseudo_fs(spec)) + if (nocanonicalize || is_pseudo_fs(spec)) return xstrdup(spec); return fsprobe_get_devname_by_spec(spec); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor