Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Humblet <phumblet@phumblet.no-ip.org>2005-01-12 02:03:24 +0300
committerPierre Humblet <phumblet@phumblet.no-ip.org>2005-01-12 02:03:24 +0300
commit114b7248ee21c647c2b2c712961518a0d425d743 (patch)
tree9899e90b4982c908b8aad1d081c250d37caef412 /winsup/utils
parent773039547015612b09cd182239800e4bcb73a913 (diff)
2005-01-11 Pierre Humblet <pierre.humblet@ieee.org>
* mkpasswd.c (print_win_error): Transform into macro. (_print_win_error): Upgrade former print_win_error by printing the line. (current_user): Call _print_win_error. (enum_users): Print name in case of lookup failure. (enum_local_groups): Ditto.
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/ChangeLog9
-rw-r--r--winsup/utils/mkpasswd.c17
2 files changed, 19 insertions, 7 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index d16a1b5ca..e852946a6 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,12 @@
+2005-01-11 Pierre Humblet <pierre.humblet@ieee.org>
+
+ * mkpasswd.c (print_win_error): Transform into macro.
+ (_print_win_error): Upgrade former print_win_error by
+ printing the line.
+ (current_user): Call _print_win_error.
+ (enum_users): Print name in case of lookup failure.
+ (enum_local_groups): Ditto.
+
2004-11-18 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
* cygcheck.cc (eprintf): New function.
diff --git a/winsup/utils/mkpasswd.c b/winsup/utils/mkpasswd.c
index d2493b47d..30e53cf33 100644
--- a/winsup/utils/mkpasswd.c
+++ b/winsup/utils/mkpasswd.c
@@ -23,6 +23,8 @@
#include <lmerr.h>
#include <lmcons.h>
+#define print_win_error(x) _print_win_error(x, __LINE__)
+
static const char version[] = "$Revision$";
SID_IDENTIFIER_AUTHORITY sid_world_auth = {SECURITY_WORLD_SID_AUTHORITY};
@@ -111,7 +113,7 @@ uni2ansi (LPWSTR wcs, char *mbs, int size)
}
void
-print_win_error(DWORD code)
+_print_win_error(DWORD code, int line)
{
char buf[4096];
@@ -121,9 +123,9 @@ print_win_error(DWORD code)
code,
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) buf, sizeof (buf), NULL))
- fprintf (stderr, "mkpasswd: [%lu] %s", code, buf);
+ fprintf (stderr, "mkpasswd (%d): [%lu] %s", line, code, buf);
else
- fprintf (stderr, "mkpasswd: error %lu", code);
+ fprintf (stderr, "mkpasswd (%d): error %lu", line, code);
}
void
@@ -159,10 +161,7 @@ current_user (int print_sids, int print_cygpath,
|| (!CloseHandle (ptok) && (errpos = __LINE__)))
{
if (errpos)
- {
- print_win_error (GetLastError ());
- fprintf(stderr, " on line %d\n", errpos);
- }
+ _print_win_error (GetLastError (), errpos);
return;
}
@@ -309,6 +308,7 @@ enum_users (LPWSTR servername, int print_sids, int print_cygpath,
&acc_type))
{
print_win_error(GetLastError ());
+ fprintf(stderr, " (%s)\n", username);
continue;
}
else if (acc_type == SidTypeDomain)
@@ -327,6 +327,7 @@ enum_users (LPWSTR servername, int print_sids, int print_cygpath,
&acc_type))
{
print_win_error(GetLastError ());
+ fprintf(stderr, " (%s)\n", domname);
continue;
}
}
@@ -401,6 +402,7 @@ enum_local_groups (int print_sids)
&acc_type))
{
print_win_error(GetLastError ());
+ fprintf(stderr, " (%s)\n", localgroup_name);
continue;
}
else if (acc_type == SidTypeDomain)
@@ -418,6 +420,7 @@ enum_local_groups (int print_sids)
&acc_type))
{
print_win_error(GetLastError ());
+ fprintf(stderr, " (%s)\n", domname);
continue;
}
}