[PATCH] mkpasswd.c - allows selection of specific user

Mark Bradshaw bradshaw@staff.crosswalk.com
Thu Nov 1 05:36:00 GMT 2001

It just occurred to me that the patch I submitted for mkpasswd.c causes one
of its error messages to be a bit misleading.  If you ask mkpasswd for a
user that doesn't exist it will say:
"NetUserEnum() failed with error 2221.
That user doesn't exist."

While the error number is correct, and the explanation on the second line is
right, it's not actually NetUserEnum that's been called to determine that.
I don't know if you care about this, but maybe the following patch could be
thrown in to make that error a bit more generic (and correct).


2001-12-03  Mark Bradshaw  <bradshaw@staff.crosswalk.com>

	* mkpasswd.c: (enum_users): Fix an error message.


--- mkpasswd.c	Wed Nov 21 20:55:41 2001
+++ mkpasswd.c.new	Mon Dec  3 21:17:14 2001
@@ -147,7 +147,7 @@ enum_users (LPWSTR servername, int print
-	  fprintf (stderr, "NetUserEnum() failed with error %ld.\n", rc);
+	  fprintf (stderr, "Mkpasswd failed with error %ld.\n", rc);
 	  if (rc == NERR_UserNotFound) 
 	    fprintf (stderr, "That user doesn't exist.\n");
 	  exit (1);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mkpasswd.c.diff
Type: application/octet-stream
Size: 402 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20011101/fa3d2e32/attachment.obj>

More information about the Cygwin-patches mailing list