This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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
 	  break;
 
 	default:
-	  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);

Attachment: mkpasswd.c.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]