]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Fix handling of explicit uuid
authorDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 28 Aug 2008 14:29:54 +0000 (10:29 -0400)
committerSteve Dickson <steved@redhat.com>
Thu, 28 Aug 2008 14:29:54 +0000 (10:29 -0400)
Fix a couple of bugs which show up if you try to explicitly set a
16-byte UUID when exporting a file system. First, exportfs cuts the
first two bytes off the UUID and writes something invalid to etab.
Second, mountd writes the _ascii_ form of the UUID to the kernel,
instead of converting it to hex.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
support/nfs/exports.c
utils/mountd/cache.c

index 525e5b1d4286c997dcdb6f7e30daa7c0d8e02e0d..334c08e1642051210c10f35a1137b9ae5999e8fd 100644 (file)
@@ -595,7 +595,7 @@ bad_option:
                                if (opt[5]!='\0' && *oe == '\0') 
                                        ep->e_flags |= NFSEXP_FSID;
                                else if (valid_uuid(opt+5))
-                                       ep->e_uuid = strdup(opt+7);
+                                       ep->e_uuid = strdup(opt+5);
                                else {
                                        xlog(L_ERROR, "%s: %d: bad fsid \"%s\"\n",
                                             flname, flline, opt);      
index 609c6e3ed015f23b14934471104d184c06be5590..2ebdd45b2007be60923cb5343c73c40c8728ba42 100644 (file)
@@ -592,8 +592,10 @@ static int dump_to_cache(FILE *f, char *domain, char *path, struct exportent *ex
                                qword_printhex(f, u, 16);
                        }
                } else {
+                       char u[16];
+                       get_uuid(NULL, exp->e_uuid, 16, u);
                        qword_print(f, "uuid");
-                       qword_printhex(f, exp->e_uuid, 16);
+                       qword_printhex(f, u, 16);
                }
 #endif
        }