[Mono-bugs] [Bug 79123][Nor] Changed - UnixUserInfo.ToPasswd fails when fields are blank

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Aug 20 20:07:26 EDT 2006


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 jonpryor at vt.edu.

http://bugzilla.ximian.com/show_bug.cgi?id=79123

--- shadow/79123	2006-08-20 17:48:35.000000000 -0400
+++ shadow/79123.tmp.9382	2006-08-20 20:07:26.000000000 -0400
@@ -1,14 +1,14 @@
 Bug#: 79123
 Product: Mono: Class Libraries
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
-Status: NEW   
+Status: NEEDINFO   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: Mono.POSIX
 AssignedTo: miguel at ximian.com                            
 ReportedBy: samjie at gmail.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
@@ -23,6 +23,29 @@
         UnixUserInfo[] userinfo = UnixUserInfo.GetLocalUsers();
         Passwd[] users = new Passwd[userinfo.Length];
         for (int i = 0; i < userinfo.Length; i++)
         {
             users[i] = userinfo[i].ToPasswd();
         }
+
+------- Additional Comments From jonpryor at vt.edu  2006-08-20 20:07 -------
+Cannot reproduce.
+
+Your sample code doesn't produce an error, and neither does the following:
+
+    Passwd pw = new Passwd ();
+    pw.pw_name = pw.pw_passwd = pw.pw_gecos = pw.pw_dir = pw.pw_shell
+= "";
+    pw.pw_uid = 0;
+    pw.pw_gid = 0;
+
+    UnixUserInfo user = new UnixUserInfo (pw);
+    Passwd pw2 = user.ToPasswd ();
+
+    Console.WriteLine (pw2);
+
+If "fields are blank" were the actual problem, this would produce an
+error; it doesn't.  Using `null' instead of "" also yields no error.
+
+(Glancing at the source doesn't help either, as .ToPasswd() calls
+.CopyPasswd(), which just creates a new Passwd() instance, copies over
+the fields, and returns it.  I can't see any way for this to fail.)


More information about the mono-bugs mailing list