mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-19 07:22:14 +08:00
* 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.
This commit is contained in:
parent
f85be99c51
commit
8606f0058e
@ -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
|
||||
|
@ -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);
|
||||
else
|
||||
psx_dir (homedir_w32, homedir_psx);
|
||||
|
||||
if (homedir_psx[0] == '\0')
|
||||
if (passed_home_path[0] == '\0')
|
||||
{
|
||||
strcat (homedir_psx, passed_home_path);
|
||||
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
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user