]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Imported Debian patch 1.0.9-2 debian/1%1.0.9-2
authorSteinar H. Gunderson <sesse@debian.org>
Sat, 8 Jul 2006 22:16:54 +0000 (00:16 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 14 Jul 2010 01:36:58 +0000 (02:36 +0100)
debian/changelog
debian/nfs-common.install
debian/nfs-common.manpages
debian/rules
utils/mount/Makefile.am
utils/mount/Makefile.in
utils/mount/mount.c
utils/mount/nfsumount.c

index e39ef6ce07b161e19e815606a42560d180c3a3f4..59cc3c63e9bce1bd6b845aed101b705f9ecbce14 100644 (file)
@@ -1,3 +1,15 @@
+nfs-utils (1:1.0.9-2) unstable; urgency=low
+
+  * Merge changes from 1.0.9-1 and 1.0.9pre1-4:
+    * Disable mount.nfs once again; it's not ready for regular use according
+      to upstream.
+    * Revert mount options patch to mount.nfs; it's irrelevant as long as we
+      don't install the binary.
+  * Install the new rpcdebug program.
+  * Remove the {mount,umount}.nfs manpages.
+
+ -- Steinar H. Gunderson <sesse@debian.org>  Sun,  9 Jul 2006 00:16:54 +0200
+
 nfs-utils (1:1.0.9-1) unstable; urgency=high
 
   * Updated co-mantainer mail address.
 nfs-utils (1:1.0.9-1) unstable; urgency=high
 
   * Updated co-mantainer mail address.
@@ -21,6 +33,15 @@ nfs-utils (1:1.0.9-1) unstable; urgency=high
 
  -- Anibal Monsalve Salazar <anibal@debian.org>  Sat, 08 Jul 2006 14:26:40 +1000
 
 
  -- Anibal Monsalve Salazar <anibal@debian.org>  Sat, 08 Jul 2006 14:26:40 +1000
 
+nfs-utils (1:1.0.8+1.0.9pre1-4) unstable; urgency=low
+
+  * Back out having separate mount.nfs; this is in line with upstream, who
+    wants to delay this to 1.0.10. 
+    * No longer install {mount,umount}.{nfs,nfs4} to /sbin.
+    * Revert patch applied in -3.
+
+ -- Steinar H. Gunderson <sesse@debian.org>  Sat,  8 Jul 2006 16:43:38 +0200
+
 nfs-utils (1:1.0.8+1.0.9pre1-3) unstable; urgency=high
 
   * Add patch from upstream to check for common mount options like "user"
 nfs-utils (1:1.0.8+1.0.9pre1-3) unstable; urgency=high
 
   * Add patch from upstream to check for common mount options like "user"
index 9657884d7d18f67f843ecb93feb3308e89b1fbea..e329d9371a1d018aad10d1b6fe5b9ceff97366c1 100644 (file)
@@ -1,15 +1,12 @@
 debian/tmp/usr/sbin/rpc.lockd sbin/
 debian/tmp/usr/sbin/rpc.statd sbin/
 debian/tmp/usr/sbin/showmount sbin/
 debian/tmp/usr/sbin/rpc.lockd sbin/
 debian/tmp/usr/sbin/rpc.statd sbin/
 debian/tmp/usr/sbin/showmount sbin/
-debian/tmp/usr/sbin/mount.nfs sbin/
-debian/tmp/usr/sbin/mount.nfs4 sbin/
-debian/tmp/usr/sbin/umount.nfs sbin/
-debian/tmp/usr/sbin/umount.nfs4 sbin/
 debian/tmp/usr/sbin/nfsstat
 debian/tmp/usr/sbin/rpc.gssd
 debian/tmp/usr/sbin/rpc.idmapd
 debian/tmp/usr/sbin/gss_clnt_send_err
 debian/tmp/usr/sbin/gss_destroy_creds
 debian/tmp/usr/sbin/nfsstat
 debian/tmp/usr/sbin/rpc.gssd
 debian/tmp/usr/sbin/rpc.idmapd
 debian/tmp/usr/sbin/gss_clnt_send_err
 debian/tmp/usr/sbin/gss_destroy_creds
+debian/tmp/usr/sbin/rpcdebug
 debian/idmapd.conf usr/share/nfs-common/conffiles/
 debian/idmapd.conf.md5sum usr/share/nfs-common/conffiles/
 debian/nfs-common.default usr/share/nfs-common/conffiles/
 debian/idmapd.conf usr/share/nfs-common/conffiles/
 debian/idmapd.conf.md5sum usr/share/nfs-common/conffiles/
 debian/nfs-common.default usr/share/nfs-common/conffiles/
index dccdeb2890d202b8ada3af1fab55bb83cef3b1cf..c17c5e7d45f6fee542820fd892e6f207e1b1858d 100644 (file)
@@ -6,5 +6,4 @@ debian/tmp/usr/share/man/man8/statd.8
 debian/tmp/usr/share/man/man8/nfsstat*
 debian/tmp/usr/share/man/man8/showmount*
 debian/tmp/usr/share/man/man8/idmapd*
 debian/tmp/usr/share/man/man8/nfsstat*
 debian/tmp/usr/share/man/man8/showmount*
 debian/tmp/usr/share/man/man8/idmapd*
-debian/tmp/usr/share/man/man8/mount.nfs.8
-debian/tmp/usr/share/man/man8/umount.nfs.8
+debian/tmp/usr/share/man/man8/rpcdebug.8
index 250a13bd6409ce93e5a14ad345beb1e2d4b157d4..ab230c4395db44475d264bbc3832baa6462f3162 100755 (executable)
@@ -11,8 +11,7 @@ build-stamp:
        dh_testdir
        ./configure \
                --mandir='$${prefix}/share/man' \
        dh_testdir
        ./configure \
                --mandir='$${prefix}/share/man' \
-               --enable-secure-statd \
-               --enable-mount
+               --enable-secure-statd 
        $(MAKE)
        touch build-stamp
 
        $(MAKE)
        touch build-stamp
 
index 94dbeaf170c90e3d205081a76b032d34c61acd89..4a2f43728de4317abe383e6ad12af97d494d6b08 100644 (file)
@@ -14,7 +14,6 @@ MAINTAINERCLEANFILES = Makefile.in
 
 install-exec-hook:
        (cd $(DESTDIR)$(sbindir) && \
 
 install-exec-hook:
        (cd $(DESTDIR)$(sbindir) && \
-         chmod +s $(sbin_PROGRAMS) && \
          ln -sf $(sbin_PROGRAMS) mount.nfs4 && \
          ln -sf $(sbin_PROGRAMS) umount.nfs && \
          ln -sf $(sbin_PROGRAMS) umount.nfs4)
          ln -sf $(sbin_PROGRAMS) mount.nfs4 && \
          ln -sf $(sbin_PROGRAMS) umount.nfs && \
          ln -sf $(sbin_PROGRAMS) umount.nfs4)
index 344cd920a784a9ff069b4f8118ec0f38aceec953..9b327c2491cf9e495207a8ebdb2065c829cd3ef9 100644 (file)
@@ -565,7 +565,6 @@ uninstall-man: uninstall-man8
 
 install-exec-hook:
        (cd $(DESTDIR)$(sbindir) && \
 
 install-exec-hook:
        (cd $(DESTDIR)$(sbindir) && \
-         chmod +s $(sbin_PROGRAMS) && \
          ln -sf $(sbin_PROGRAMS) mount.nfs4 && \
          ln -sf $(sbin_PROGRAMS) umount.nfs && \
          ln -sf $(sbin_PROGRAMS) umount.nfs4)
          ln -sf $(sbin_PROGRAMS) mount.nfs4 && \
          ln -sf $(sbin_PROGRAMS) umount.nfs && \
          ln -sf $(sbin_PROGRAMS) umount.nfs4)
index b1ff6a4f9129a00cc53a95d20ca4c349e4ff564a..ca87e3d1b7fb60bc04d7e3504a7bcb4985e79b38 100644 (file)
@@ -28,7 +28,6 @@
 #include <sys/mount.h>
 #include <getopt.h>
 #include <mntent.h>
 #include <sys/mount.h>
 #include <getopt.h>
 #include <mntent.h>
-#include <pwd.h>
 
 #include "fstab.h"
 #include "xcommon.h"
 
 #include "fstab.h"
 #include "xcommon.h"
@@ -75,14 +74,6 @@ struct opt_map {
   int  mask;                    /* flag mask value */
 };
 
   int  mask;                    /* flag mask value */
 };
 
-/* Custom mount options for our own purposes.  */
-/* Maybe these should now be freed for kernel use again */
-#define MS_DUMMY       0x00000000
-#define MS_USERS       0x40000000
-#define MS_USER                0x20000000
-#define MS_OWNER       0x10000000
-#define MS_GROUP       0x08000000
-
 static const struct opt_map opt_map[] = {
   { "defaults", 0, 0, 0         },      /* default options */
   { "ro",       1, 0, MS_RDONLY },      /* read-only */
 static const struct opt_map opt_map[] = {
   { "defaults", 0, 0, 0         },      /* default options */
   { "ro",       1, 0, MS_RDONLY },      /* read-only */
@@ -99,18 +90,6 @@ static const struct opt_map opt_map[] = {
   { "remount",  0, 0, MS_REMOUNT},      /* Alter flags of mounted FS */
   { "bind",     0, 0, MS_BIND   },      /* Remount part of tree elsewhere */
   { "rbind",    0, 0, MS_BIND|MS_REC }, /* Idem, plus mounted subtrees */
   { "remount",  0, 0, MS_REMOUNT},      /* Alter flags of mounted FS */
   { "bind",     0, 0, MS_BIND   },      /* Remount part of tree elsewhere */
   { "rbind",    0, 0, MS_BIND|MS_REC }, /* Idem, plus mounted subtrees */
-  { "auto",     0, 0, MS_DUMMY },      /* Can be mounted using -a */
-  { "noauto",   0, 0, MS_DUMMY },      /* Can  only be mounted explicitly */
-  { "users",    0, 0, MS_USERS  },      /* Allow ordinary user to mount */
-  { "nousers",  0, 0, MS_USERS  },      /* Forbid ordinary user to mount */
-  { "user",     0, 0, MS_USER   },      /* Allow ordinary user to mount */
-  { "nouser",   0, 0, MS_USER   },      /* Forbid ordinary user to mount */
-  { "owner",    0, 0, MS_OWNER  },      /* Let the owner of the device mount */
-  { "noowner",  0, 0, MS_OWNER  },      /* Device owner has no special privs */
-  { "group",    0, 0, MS_GROUP  },      /* Let the group of the device mount */
-  { "nogroup",  0, 0, MS_GROUP  },      /* Device group has no special privs */
-  { "_netdev",  0, 0, MS_DUMMY},      /* Device requires network */
-  { "comment",  0, 0, MS_DUMMY},      /* fstab comment only (kudzu,_netdev)*/
 
   /* add new options here */
 #ifdef MS_NOSUB
 
   /* add new options here */
 #ifdef MS_NOSUB
@@ -125,7 +104,6 @@ static const struct opt_map opt_map[] = {
   { "mand",     0, 0, MS_MANDLOCK },    /* Allow mandatory locks on this FS */
   { "nomand",   0, 1, MS_MANDLOCK },    /* Forbid mandatory locks on this FS */
 #endif
   { "mand",     0, 0, MS_MANDLOCK },    /* Allow mandatory locks on this FS */
   { "nomand",   0, 1, MS_MANDLOCK },    /* Forbid mandatory locks on this FS */
 #endif
-  { "loop",     1, 0, MS_DUMMY   },      /* use a loop device */
 #ifdef MS_NOATIME
   { "atime",    0, 1, MS_NOATIME },     /* Update access time */
   { "noatime",  0, 0, MS_NOATIME },     /* Do not update access time */
 #ifdef MS_NOATIME
   { "atime",    0, 1, MS_NOATIME },     /* Update access time */
   { "noatime",  0, 0, MS_NOATIME },     /* Do not update access time */
@@ -143,12 +121,6 @@ static char * fix_opts_string (int flags, const char *extra_opts) {
        char *new_opts;
 
        new_opts = xstrdup((flags & MS_RDONLY) ? "ro" : "rw");
        char *new_opts;
 
        new_opts = xstrdup((flags & MS_RDONLY) ? "ro" : "rw");
-       if (flags & MS_USER) {
-               struct passwd *pw = getpwuid(getuid());
-               if(pw)
-                       new_opts = xstrconcat3(new_opts, ",user=", pw->pw_name);
-       }
-       
        for (om = opt_map; om->opt != NULL; om++) {
                if (om->skip)
                        continue;
        for (om = opt_map; om->opt != NULL; om++) {
                if (om->skip)
                        continue;
@@ -160,20 +132,9 @@ static char * fix_opts_string (int flags, const char *extra_opts) {
        if (extra_opts && *extra_opts) {
                new_opts = xstrconcat3(new_opts, ",", extra_opts);
        }
        if (extra_opts && *extra_opts) {
                new_opts = xstrconcat3(new_opts, ",", extra_opts);
        }
-
        return new_opts;
 }
 
        return new_opts;
 }
 
-void copy_mntent(struct mntent *ment, nfs_mntent_t *nment)
-{
-       /* Not sure why nfs_mntent_t should exist */
-       strcpy(nment->mnt_fsname, ment->mnt_fsname);
-       strcpy(nment->mnt_dir, ment->mnt_dir);
-       strcpy(nment->mnt_type, ment->mnt_type);
-       strcpy(nment->mnt_opts, ment->mnt_opts);
-       nment->mnt_freq = ment->mnt_freq;
-       nment->mnt_passno = ment->mnt_passno;
-}
 
 int add_mtab(char *fsname, char *mount_point, char *fstype, int flags, char *opts, int freq, int passno)
 {
 
 int add_mtab(char *fsname, char *mount_point, char *fstype, int flags, char *opts, int freq, int passno)
 {
@@ -185,16 +146,8 @@ int add_mtab(char *fsname, char *mount_point, char *fstype, int flags, char *opt
        ment.mnt_dir = mount_point;
        ment.mnt_type = fstype;
        ment.mnt_opts = fix_opts_string(flags, opts);
        ment.mnt_dir = mount_point;
        ment.mnt_type = fstype;
        ment.mnt_opts = fix_opts_string(flags, opts);
-       ment.mnt_freq = freq;
-       ment.mnt_passno= passno;
-
-       if(flags & MS_REMOUNT) {
-               nfs_mntent_t nment;
-               
-               copy_mntent(&ment, &nment);
-               update_mtab(nment.mnt_dir, &nment);
-               return 0;
-       }
+       ment.mnt_freq = 0;
+       ment.mnt_passno= 0;
 
        if ((fd = open(MOUNTED"~", O_RDWR|O_CREAT|O_EXCL, 0600)) == -1) {
                fprintf(stderr, "Can't get "MOUNTED"~ lock file");
 
        if ((fd = open(MOUNTED"~", O_RDWR|O_CREAT|O_EXCL, 0600)) == -1) {
                fprintf(stderr, "Can't get "MOUNTED"~ lock file");
@@ -293,16 +246,16 @@ static void mount_error(char *node)
 {
        switch(errno) {
                case ENOTDIR:
 {
        switch(errno) {
                case ENOTDIR:
-                       fprintf(stderr, "%s: mount point %s is not a directory\n", progname, node);
+                       printf("%s: mount point %s is not a directory\n", progname, node);
                        break;
                case EBUSY:
                        break;
                case EBUSY:
-                       fprintf(stderr, "%s: %s is already mounted or busy\n", progname, node);
+                       printf("%s: %s is already mounted or busy\n", progname, node);
                        break;
                case ENOENT:
                        break;
                case ENOENT:
-                       fprintf(stderr, "%s: mount point %s does not exist\n", progname, node);
+                       printf("%s: mount point %s does not exist\n", progname, node);
                        break;
                default:
                        break;
                default:
-                       fprintf(stderr, "%s: %s\n", progname, strerror(errno));
+                       printf("%s: %s\n", progname, strerror(errno));
        }
 }
 
        }
 }
 
@@ -316,6 +269,11 @@ int main(int argc, char *argv[])
        if ((p = strrchr(progname, '/')) != NULL)
                progname = p+1;
 
        if ((p = strrchr(progname, '/')) != NULL)
                progname = p+1;
 
+       if (getuid() != 0) {
+               printf("%s: only root can do that.\n", progname);
+               exit(1);
+       }
+
        if(!strncmp(progname, "umount", strlen("umount"))) {
                if(argc < 2) {
                        umount_usage();
        if(!strncmp(progname, "umount", strlen("umount"))) {
                if(argc < 2) {
                        umount_usage();
@@ -400,11 +358,6 @@ int main(int argc, char *argv[])
        
        parse_opts(mount_opts, &flags, &extra_opts);
 
        
        parse_opts(mount_opts, &flags, &extra_opts);
 
-       if (getuid() != 0 && !(flags & MS_USERS) && !(flags & MS_USER)) {
-               fprintf(stderr, "%s: permission denied.\n", progname);
-               exit(1);
-       }
-
        if (!strcmp(progname, "mount.nfs4") || nfs_mount_vers == 4) {
                nfs_mount_vers = 4;
                mnt_err = nfs4mount(spec, mount_point, &flags, &extra_opts, &mount_opts, 0);
        if (!strcmp(progname, "mount.nfs4") || nfs_mount_vers == 4) {
                nfs_mount_vers = 4;
                mnt_err = nfs4mount(spec, mount_point, &flags, &extra_opts, &mount_opts, 0);
@@ -417,19 +370,16 @@ int main(int argc, char *argv[])
        }
 
        if (!mnt_err && !fake) {
        }
 
        if (!mnt_err && !fake) {
-               if(!(flags & MS_REMOUNT)) {
-                       mnt_err = do_mount_syscall(spec, mount_point,
-                                       nfs_mount_vers == 4 ? "nfs4" : "nfs", flags, mount_opts);
+               mnt_err = do_mount_syscall(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs", flags, mount_opts);
                
                
-                       if(mnt_err) {
-                               mount_error(mount_point);
-                               exit(-1);
-                       }
+               if(mnt_err) {
+                       mount_error(mount_point);
+                       exit(-1);
                }
                }
-               if(!nomtab) {
+
+               if(!nomtab)
                        add_mtab(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs",
                                 flags, extra_opts, 0, 0);
                        add_mtab(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs",
                                 flags, extra_opts, 0, 0);
-               }
        }
 
        return 0;
        }
 
        return 0;
index d408e2f0f84c550a469f581706a226f5b644d7a0..28f42448105d20efcf18a00ab77e330ccc256851 100644 (file)
@@ -23,7 +23,6 @@
 #include <mntent.h>
 #include <sys/mount.h>
 #include <ctype.h>
 #include <mntent.h>
 #include <sys/mount.h>
 #include <ctype.h>
-#include <pwd.h>
 
 #include "xcommon.h"
 #include "fstab.h"
 
 #include "xcommon.h"
 #include "fstab.h"
@@ -157,42 +156,6 @@ static void complain(int err, const char *dev) {
   }
 }
 
   }
 }
 
-/*
- * Look for an option in a comma-separated list
- */
-static int
-contains(const char *list, const char *s) {
-       int n = strlen(s);
-
-       while (*list) {
-               if (strncmp(list, s, n) == 0 &&
-                 (list[n] == 0 || list[n] == ','))
-                       return 1;
-               while (*list && *list++ != ',') ;
-       }
-       return 0;
-}
-
-/*
- * If list contains "user=peter" and we ask for "user=", return "peter"
- */
-static char *
-get_value(const char *list, const char *s) {
-       const char *t;
-       int n = strlen(s);
-
-       while (*list) {
-               if (strncmp(list, s, n) == 0) {
-                       s = t = list+n;
-                       while (*s && *s != ',')
-                               s++;
-                       return xstrndup(t, s-t);
-               }
-               while (*list && *list++ != ',') ;
-       }
-       return 0;
-}
-
 int add_mtab2(const char *spec, const char *node, const char *type,
                const char *opts, struct mntentchn *mc)
 {
 int add_mtab2(const char *spec, const char *node, const char *type,
                const char *opts, struct mntentchn *mc)
 {
@@ -344,7 +307,7 @@ int _nfsumount(const char *spec, const char *opts)
                goto out_bad;
        return nfs_call_umount(&mnt_server, &dirname);
  out_bad:
                goto out_bad;
        return nfs_call_umount(&mnt_server, &dirname);
  out_bad:
-       fprintf(stderr, "%s: %s: not found or not mounted\n", progname, spec);
+       printf("%s: %s: not found or not mounted\n", progname, spec);
        return 0;
 }
 
        return 0;
 }
 
@@ -413,21 +376,6 @@ int nfsumount(int argc, char *argv[])
                printf(_("Could not find %s in mtab\n"), spec);
 
        if(mc) {
                printf(_("Could not find %s in mtab\n"), spec);
 
        if(mc) {
-               if(contains(mc->m.mnt_opts, "user") && getuid() != 0) {
-                       struct passwd *pw = getpwuid(getuid());
-                       if(!pw || strcmp(pw->pw_name, get_value(mc->m.mnt_opts, "user="))) {
-                               fprintf(stderr, "%s: permission denied to unmount %s\n",
-                                               progname, spec);
-                               exit(1);
-                       }
-               } else {
-                       if(!contains(mc->m.mnt_opts, "users") && getuid() != 0) {
-                               fprintf(stderr, "%s: only root can unmount %s from %s\n",
-                                               progname, mc->m.mnt_fsname, mc->m.mnt_dir);
-                               exit(1);
-                       }
-               }
-
                ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
                if(ret)
                        ret = add_mtab2(mc->m.mnt_fsname, mc->m.mnt_dir,
                ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
                if(ret)
                        ret = add_mtab2(mc->m.mnt_fsname, mc->m.mnt_dir,