Package: nfs-kernel-server
Version: 1:1.1.1~git-20070709-4
Severity: normal
Tags: patch

--- Please enter the report below this line. ---

The manpage shows "squash_uids=0-15,20,25-50" as a valid entry for the
/etc/exports file.
So I tried to use "squash_uids=0-2003,2005-9999".
But this fails with the following message:
"""
Exporting directories for NFS kernel daemon...exportfs: /etc/exports:12:
unknown keyword "2005-9999"
"""

I looked at the code and found the bug in support/nfs/exports.c ...

The function "parsesquash" can handle multible uid and gid ranges, but
the function "parseopts" calls "parsesquash" only with the first range.

I think we need to change line 510 in exports.c from
                while (*cp && *cp != ',')
to
                while (*cp && !(*cp == ',' && !isdigit(cp[1])))
.
This is the same statement as used in "parsesquash" (line 700)

Perhaps we need a check if cp+1 really exists:
                while (*cp && !(*cp == ',' && cp[1] && !isdigit(cp[1])))

I think this issue needs to be reported to upstream...

btw.
Why are there ubuntu-strings in the dependslist of the debian/control?


Best regards
Per
http://zaubberer.net/


--- System information. ---
Architecture: i386
Kernel:       Linux 2.6.22.6-per-smp-1

Debian Release: sid

--- Package information. ---
Depends                                      (Version) | Installed
======================================================-+-=====================================
nfs-common                              (>= 1:1.0.8-1) |
1:1.1.1~git-20070709-4
ucf                                                    | 3.001
lsb-base                             (>= 1.3-9ubuntu3) | 3.1-24
libblkid1                                  (>= 1.39-1) | 1.40.2-1
libc6                                     (>= 2.6.1-1) | 2.6.1-4
libcomerr2                                 (>= 1.33-3) | 1.40.2-1
libgssglue1                                            | 0.1-1
libkrb53                               (>= 1.6.dfsg.1) | 1.6.dfsg.1-7
libnfsidmap2                                           | 0.20-0
librpcsecgss3                                          | 0.16-1
libwrap0                                               | 7.6.dbs-14
libblkid1         (>= 1.39+1.40-WIP-2006.11.14+dfsg-2) | 1.40.2-1

--- nfs-utils-1.1.1~git-20070709_org/support/nfs/exports.c	2007-08-09 17:28:21.000000000 +0200
+++ nfs-utils-1.1.1~git-20070709/support/nfs/exports.c	2007-09-15 16:01:06.000000000 +0200
@@ -507,7 +507,7 @@
 	while (*cp) {
 		char *opt = strdup(cp);
 		char *optstart = cp;
-		while (*cp && *cp != ',')
+		while (*cp && !(*cp == ',' && cp[1] && !isdigit(cp[1])))
 			cp++;
 		if (*cp) {
 			opt[cp-optstart] = '\0';

Reply via email to