[Mono-bugs] [Bug 80776][Nor] Changed - Syscall.getpwuid_r not working
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Tue Feb 13 18:59:20 EST 2007
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by mrj001 at shaw.ca.
http://bugzilla.ximian.com/show_bug.cgi?id=80776
--- shadow/80776 2007-02-11 17:09:47.000000000 -0500
+++ shadow/80776.tmp.30385 2007-02-13 18:59:20.000000000 -0500
@@ -1,12 +1,12 @@
Bug#: 80776
Product: Mono: Class Libraries
Version: 1.2
OS: unknown
OS Details: linux
-Status: NEEDINFO
+Status: CLOSED
Resolution:
Severity: Unknown
Priority: Normal
Component: Mono.POSIX
AssignedTo: miguel at ximian.com
ReportedBy: mrj001 at shaw.ca
@@ -127,6 +127,37 @@
printf("home dir: %s\n", ppw->pw_dir);
}
This is surprising!
More investigation is required.
+
+------- Additional Comments From mrj001 at shaw.ca 2007-02-13 18:59 -------
+This is NOT a mono bug.
+
+Once the buffer passed to getwpuid_r reached a certain size, it
+returned 0 rather than ERANGE, AND returned null in the output
+pointer. This, of course, is how it indicates no such user. However,
+in my case, there was such a user (in NIS). A larger still buffer
+returned the correct information. This MAY be a bug in my glibc 2.3.5.
+
+My original /etc/nsswitch.conf had:
+passwd: compat
+My original /etc/passwd ended with:
++::::::
+
+This last entry was what was in the passwd structure passed to
+getpwuid_r when it returned no such user. For some reason, getpwuid_r
+did not go on to search NIS (or did search it, but the buffer was too
+small, and it erroneously returned 0 instead of ERANGE).
+
+I changed /etc/nsswitch.conf to
+passwd: files nis
+(also group and shadow)
+and removed the line from /etc/passwd
+
+Now, the sequence
+UnixUserInfo uui;
+uui = UnixEnvironment.RealUser;
+sHomeDir = uui.HomeDirectory;
+works as expected.
+
More information about the mono-bugs
mailing list