Your message dated Wed, 25 Feb 2009 22:26:22 GMT
with message-id <[email protected]>
and subject line nfs-user-server has been removed from Debian, closing #364676
has caused the Debian Bug report #364676,
regarding nfs-user-server: Wrong nobody/nogroup user ID and group ID on some 
systems
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
364676: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=364676
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: nfs-user-server
Severity: normal
Tags: patch

Hi,

the ugidd in nfs-user-server source package (2.2beta47-22) does not produce 
the right values for the group and the user ID of 'nobody'/'nogroup' on my 
debian system. 

In ugid.h, there is a hardcoded value of "-2" for the UID and GID. This value
would be correct (at least on my system) if casted to an uint16, but you (and
the kernel) use it as an uint32 value which produces absurd IDs. 

I have appended a patch which solves this problem and should work where
the nobody/nogroup user is called nobody/nogroup, which is on (hopefully) 
every debian system.

BTW: I have found no written information that the nfs-kernel-server does not
work with ugidd (at least it seems not to anything with the ugidd 
information).
Maybe I missed something, but I suggest that yo put a small note into your 
README.

BTW#2: Similar things happen for numerical-only IDs on an nfs-user-server and 
this patch does not solve them as the user/group ID is mapped earlier in the 
nfs daemon itself. The authentication system should probably be integrated 
into the ugidd daemon as well.

Should I file separate bug reports for these two issues?

Best regards,

Onno

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (600, 'stable'), (300, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12ok
Locale: lang=de...@euro, lc_ctype=de...@euro (charmap=ISO-8859-15)
diff -Nudr nfs-user-server-2.2beta47/ugidd.c nfs-user-server-2.2beta47.new/ugidd.c
--- nfs-user-server-2.2beta47/ugidd.c	2006-04-24 23:19:36.000000000 +0200
+++ nfs-user-server-2.2beta47.new/ugidd.c	2006-04-24 23:15:55.000000000 +0200
@@ -263,11 +263,15 @@
 	struct passwd	*pw;
 
 	bzero(&res, sizeof(res));
-	if ((pw = getpwnam(*argp)) == NULL)
-		res = NOBODY;
-	else
-		res = pw->pw_uid;
-
+	if ((pw = getpwnam(*argp)) == NULL) {
+		/* To prevent dereferencing a NULL pointer,
+		   use the old NOBODY as a last-resort fallback. */
+		if ((pw = getpwnam("nobody")) == NULL) {
+			res=FAIL_NOBODY;
+			return (&res);
+		}
+	}
+	res = pw->pw_uid;
 	return (&res);
 }
 
@@ -281,11 +285,15 @@
 	struct group	*gr;
 
 	bzero(&res, sizeof(res));
-	if ((gr = getgrnam(*argp)) == NULL)
-		res = NOBODY;
-	else
-		res = gr->gr_gid;
-
+	if ((gr = getgrnam(*argp)) == NULL) {
+		/* To prevent dereferencing a NULL pointer,
+		   use the old NOGROUP as a last-resort fallback. */
+		if ((gr = getgrnam("nogroup")) == NULL) {
+			res=FAIL_NOGROUP;
+			return (&res);
+		}
+	}
+	res = gr->gr_gid;
 	return (&res);
 }
 
diff -Nudr nfs-user-server-2.2beta47/ugid.h nfs-user-server-2.2beta47.new/ugid.h
--- nfs-user-server-2.2beta47/ugid.h	1997-12-12 14:16:21.000000000 +0100
+++ nfs-user-server-2.2beta47.new/ugid.h	2006-04-24 23:15:53.000000000 +0200
@@ -10,7 +10,14 @@
 
 #include <rpc/rpc.h>
 #define MAXUGLEN 64
-#define NOBODY -2
+
+/* The following two values are only used as a fallback if lookup of 'nobody' or 'nogroup'
+   in /etc/passwd resp. /etc/group fails. Depending on the bit length of int, the would-be
+   value in these two files etc. the values may well be wrong and lead to 'funny' UID/GID
+   lookups. */
+#define FAIL_NOBODY -2
+#define FAIL_NOGROUP -2
+
 #define WILDCARD -1
 
 typedef char *ugname;

--- End Message ---
--- Begin Message ---
Version: 2.2beta47-25+rm

The nfs-user-server package has been removed from Debian so we are closing
the bugs that were still opened against it.

For more information about this package's removal, read
http://bugs.debian.org/515957 . That bug might give the reasons why
this package was removed, and suggestions of possible replacements.

Don't hesitate to reply to this mail if you have any question.

Thank you for your contribution to Debian.

Kind regards,
--
Marco Rodrigues


--- End Message ---

Reply via email to