Hello community, here is the log from the commit of package util-linux checked in at Thu May 18 02:21:41 CEST 2006. -------- --- util-linux/util-linux.changes 2006-04-24 14:33:51.000000000 +0200 +++ util-linux/util-linux.changes 2006-05-17 23:49:50.000000000 +0200 @@ -1,0 +2,6 @@ +Wed May 17 23:48:27 CEST 2006 - jeffm@suse.com + +- Fixed support for calling external programs w/o -t <type>, + it would add mtab twice [#176582] + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ util-linux.spec ++++++ --- /var/tmp/diff_new_pack.2mZK7r/_old 2006-05-18 02:19:27.000000000 +0200 +++ /var/tmp/diff_new_pack.2mZK7r/_new 2006-05-18 02:19:27.000000000 +0200 @@ -20,7 +20,7 @@ Group: System/Base Autoreqprov: on Version: 2.12r -Release: 31 +Release: 35 Summary: A collection of basic system utilities Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/%name-%version.tar.bz2 Source2: nologin.c @@ -592,6 +592,9 @@ %endif %changelog -n util-linux +* Wed May 17 2006 - jeffm@suse.com +- Fixed support for calling external programs w/o -t <type>, + it would add mtab twice [#176582] * Mon Apr 24 2006 - hvogel@suse.de - document xfs dmapi mount options better [#158955] * Fri Apr 21 2006 - olh@suse.de ++++++ util-linux-2.12r-external-prog-on-guess.diff ++++++ --- /var/tmp/diff_new_pack.2mZK7r/_old 2006-05-18 02:19:30.000000000 +0200 +++ /var/tmp/diff_new_pack.2mZK7r/_new 2006-05-18 02:19:30.000000000 +0200 @@ -1,12 +1,21 @@ -From: Jeff Mahoney <jeffm@suse.com> Subject: [PATCH] mount: needs to handle special mountprog even on guessed file systems. +From: Jeff Mahoney <jeffm@suse.com> +Subject: [PATCH] mount: needs to handle special mountprog even on guessed file systems. If the user doesn't specify -t <fstype> mount.fstype will never be called. This patch fixes that. -diff -rup util-linux-2.12r/mount/mount.c util-linux-2.12r.devel/mount/mount.c ---- util-linux-2.12r/mount/mount.c 2006-03-13 17:02:52.000000000 -0500 -+++ util-linux-2.12r.devel/mount/mount.c 2006-03-13 17:18:41.000000000 -0500 + Update: Fixes a bug where the mount would get added to mtab twice. + +-- + + mount.c | 47 +++++++++++++++++++++++++++++++++++++++++------ + mount_guess_fstype.c | 3 +-- + 2 files changed, 42 insertions(+), 8 deletions(-) + +diff -rup util-linux-2.12r/mount/mount.c util-linux-2.12r.updated/mount/mount.c +--- util-linux-2.12r/mount/mount.c 2006-05-17 17:35:37.000000000 -0400 ++++ util-linux-2.12r.updated/mount/mount.c 2006-05-17 17:35:17.000000000 -0400 @@ -451,6 +451,10 @@ create_mtab (void) { unlock_mtab(); } @@ -18,7 +27,7 @@ /* count successful mount system calls */ static int mountcount = 0; -@@ -462,12 +466,26 @@ static int mountcount = 0; +@@ -462,12 +466,30 @@ static int mountcount = 0; static int do_mount_syscall (struct mountargs *args) { int flags = args->flags; @@ -43,20 +52,29 @@ + if (check_special_mountprog(args->spec, args->node, args->type, + args->flags, args->data, &ret) == 0) + ret = do_mount_syscall(args); ++ else if (ret == 0) { /* set by the call */ ++ mountcount++; ++ ret = 1; ++ } + if (ret == 0) mountcount++; return ret; -@@ -509,7 +527,7 @@ guess_fstype_and_mount(const char *spec, +@@ -507,10 +529,11 @@ guess_fstype_and_mount(const char *spec, + char *p; + while((p = index(t,',')) != NULL) { ++ int ret; *p = 0; args.type = *types = t; - if(do_mount_syscall (&args) == 0) -+ if(do_mount (&args) == 0) - return 0; +- return 0; ++ if((ret = do_mount (&args)) >= 0) ++ return ret; t = p+1; } -@@ -519,10 +537,10 @@ guess_fstype_and_mount(const char *spec, + /* do last type below */ +@@ -519,10 +542,10 @@ guess_fstype_and_mount(const char *spec, if (*types || (flags & MS_REMOUNT)) { args.type = *types; @@ -69,3 +87,47 @@ } /* +@@ -895,8 +918,16 @@ retry_nfs: + nosigblock: + + if (!fake) { ++ int skip_mtab = 0; + mnt5_res = guess_fstype_and_mount (spec, node, &types, flags & ~MS_NOSYS, + mount_opts); ++ /* External program was executed to mount the file system, skip updating ++ * mtab. */ ++ if (mnt5_res == 1) { ++ skip_mtab = 1; ++ mnt5_res = 0; ++ res = 0; ++ } + if(!mnt5_res && LoopMountAutomaticChmod && (getuid() == 0)) { + /* + * If loop was set up using random keys and new file system +@@ -907,8 +938,12 @@ nosigblock: + error (_("Error: encrypted file system chmod() failed")); + } + } ++ ++ if (skip_mtab) ++ goto out; + } + ++ + if (fake || mnt5_res == 0) { + /* Mount succeeded, report this (if verbose) and write mtab entry. */ + if (loop) +diff -rup util-linux-2.12r/mount/mount_guess_fstype.c util-linux-2.12r.updated/mount/mount_guess_fstype.c +--- util-linux-2.12r/mount/mount_guess_fstype.c 2006-05-17 17:35:37.000000000 -0400 ++++ util-linux-2.12r.updated/mount/mount_guess_fstype.c 2006-05-17 17:19:44.000000000 -0400 +@@ -695,9 +695,8 @@ procfsloop(int (*mount_fn)(struct mounta + printf(_("Trying %s\n"), fsname); + fflush(stdout); + } +- if ((*mount_fn) (args) == 0) { ++ if ((ret = (*mount_fn) (args)) >= 0) { + *types = fsname; +- ret = 0; + break; + } else if (errno != EINVAL && + is_in_procfs(fsname) == 1) { ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de