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
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-12-14 23:01:53 +0300
committerCorinna Vinschen <corinna@vinschen.de>2001-12-14 23:01:53 +0300
commit8606f0058eb6615351b0174f057f78bf688677ec (patch)
tree5364e400bd148d699b5d278bfee1e11aba544d48 /winsup
parentf85be99c516888d5cfcb3fa2dec8be0676f66d56 (diff)
* mkpasswd.c (enum_users): Change to unconditionally use
the --path-to-home option, if supplied by the user. Use default --path-to-home option value, if appropriate. (usage): Change usage statement to reflect new semantics. (main): Remove defaulting of the --path-to-home option.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/utils/ChangeLog8
-rw-r--r--winsup/utils/mkpasswd.c31
2 files changed, 27 insertions, 12 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 3cb8a3627..186a98dc4 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,11 @@
+Fri Dec 14 14:04:37 2001 Jason Tishler <jason@tishler.net>
+
+ * mkpasswd.c (enum_users): Change to unconditionally use
+ the --path-to-home option, if supplied by the user. Use default
+ --path-to-home option value, if appropriate.
+ (usage): Change usage statement to reflect new semantics.
+ (main): Remove defaulting of the --path-to-home option.
+
Fri Dec 14 12:10:39 2001 Jason Tishler <jason@tishler.net>
* mkpasswd.c (opts): Add indication that '-p' option requires an
diff --git a/winsup/utils/mkpasswd.c b/winsup/utils/mkpasswd.c
index 413739e4a..ceab70fce 100644
--- a/winsup/utils/mkpasswd.c
+++ b/winsup/utils/mkpasswd.c
@@ -171,15 +171,26 @@ enum_users (LPWSTR servername, int print_sids, int print_cygpath,
uni2ansi (buffer[i].usri3_name, username, sizeof (username));
uni2ansi (buffer[i].usri3_full_name, fullname, sizeof (fullname));
homedir_w32[0] = homedir_psx[0] = '\0';
- uni2ansi (buffer[i].usri3_home_dir, homedir_w32, sizeof (homedir_w32));
- if (print_cygpath)
- cygwin_conv_to_posix_path (homedir_w32, homedir_psx);
+ if (passed_home_path[0] == '\0')
+ {
+ uni2ansi (buffer[i].usri3_home_dir, homedir_w32,
+ sizeof (homedir_w32));
+ if (homedir_w32[0] != '\0')
+ {
+ if (print_cygpath)
+ cygwin_conv_to_posix_path (homedir_w32, homedir_psx);
+ else
+ psx_dir (homedir_w32, homedir_psx);
+ }
+ else
+ {
+ strcpy (homedir_psx, "/home/");
+ strcat (homedir_psx, username);
+ }
+ }
else
- psx_dir (homedir_w32, homedir_psx);
-
- if (homedir_psx[0] == '\0')
{
- strcat (homedir_psx, passed_home_path);
+ strcpy (homedir_psx, passed_home_path);
strcat (homedir_psx, username);
}
@@ -394,8 +405,7 @@ usage ()
fprintf (stderr, " -m,--no-mount don't use mount points for home dir\n");
fprintf (stderr, " -s,--no-sids don't print SIDs in GCOS field\n");
fprintf (stderr, " (this affects ntsec)\n");
- fprintf (stderr, " -p,--path-to-home path if user account has no home dir, use\n");
- fprintf (stderr, " path instead of /home/\n");
+ fprintf (stderr, " -p,--path-to-home path use specified path instead of user account home dir\n");
fprintf (stderr, " -u,--username username only return information for the specified user\n");
fprintf (stderr, " -?,--help displays this message\n\n");
fprintf (stderr, "One of `-l', `-d' or `-g' must be given on NT/W2K.\n");
@@ -505,9 +515,6 @@ main (int argc, char **argv)
}
}
- if (passed_home_path[0] == '\0')
- strcpy (passed_home_path, "/home/");
-
/* This takes Windows 9x/ME into account. */
if (GetVersion () >= 0x80000000)
{