2003-03-01 Pierre Humblet <pierre.humblet@ieee.org>
* mkpasswd.cc (main): On Win95, output both a default line and a line for the current user (if known) with a pseudorandom uid. If the -u switch is given, produce a line for the specified user. * mkgroup.cc (main): On Win95 change the group name from "unknown" to "all".
This commit is contained in:
parent
5a082e9eac
commit
f78765dadd
|
@ -1,3 +1,11 @@
|
||||||
|
2003-03-01 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
|
* mkpasswd.cc (main): On Win95, output both a default line and a
|
||||||
|
line for the current user (if known) with a pseudorandom uid. If
|
||||||
|
the -u switch is given, produce a line for the specified user.
|
||||||
|
* mkgroup.cc (main): On Win95 change the group name from "unknown" to
|
||||||
|
"all".
|
||||||
|
|
||||||
2003-02-28 Christopher Faylor <cgf@redhat.com>
|
2003-02-28 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* Makefile.in (cygcheck.o): Fix so that actual mingw include files are
|
* Makefile.in (cygcheck.o): Fix so that actual mingw include files are
|
||||||
|
|
|
@ -612,7 +612,7 @@ main (int argc, char **argv)
|
||||||
/* This takes Windows 9x/ME into account. */
|
/* This takes Windows 9x/ME into account. */
|
||||||
if (!isNT)
|
if (!isNT)
|
||||||
{
|
{
|
||||||
printf ("unknown::%ld:\n", DOMAIN_ALIAS_RID_ADMINS);
|
printf ("all::%ld:\n", DOMAIN_ALIAS_RID_ADMINS);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -632,24 +632,34 @@ main (int argc, char **argv)
|
||||||
if (!isNT)
|
if (!isNT)
|
||||||
{
|
{
|
||||||
/* This takes Windows 9x/ME into account. */
|
/* This takes Windows 9x/ME into account. */
|
||||||
if (!disp_username)
|
|
||||||
{
|
|
||||||
if (GetUserName (name, (len = 256, &len)))
|
|
||||||
disp_username = name;
|
|
||||||
else
|
|
||||||
/* Same behaviour as in cygwin/shared.cc (memory_init). */
|
|
||||||
disp_username = (char *) "unknown";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (passed_home_path[0] == '\0')
|
if (passed_home_path[0] == '\0')
|
||||||
strcpy (passed_home_path, "/home/");
|
strcpy (passed_home_path, "/home/");
|
||||||
|
if (!disp_username)
|
||||||
printf ("%s:*:%ld:%ld:%s:%s%s:/bin/bash\n", disp_username,
|
{
|
||||||
DOMAIN_USER_RID_ADMIN,
|
printf ("admin:use_crypt:%lu:%lu:Administrator:%sadmin:/bin/bash\n",
|
||||||
DOMAIN_ALIAS_RID_ADMINS,
|
DOMAIN_USER_RID_ADMIN,
|
||||||
disp_username,
|
DOMAIN_ALIAS_RID_ADMINS,
|
||||||
passed_home_path,
|
passed_home_path);
|
||||||
disp_username);
|
if (GetUserName (name, (len = 256, &len)))
|
||||||
|
disp_username = name;
|
||||||
|
}
|
||||||
|
if (disp_username && disp_username[0])
|
||||||
|
{
|
||||||
|
/* Create a pseudo random uid */
|
||||||
|
unsigned long uid = 0, i;
|
||||||
|
for (i = 0; disp_username[i]; i++)
|
||||||
|
uid += toupper (disp_username[i]) << ((6 * i) % 25);
|
||||||
|
uid = (uid % (65535 - DOMAIN_USER_RID_ADMIN - 1))
|
||||||
|
+ DOMAIN_USER_RID_ADMIN + 1;
|
||||||
|
|
||||||
|
printf ("%s:use_crypt:%lu:%lu:%s:%s%s:/bin/bash\n",
|
||||||
|
disp_username,
|
||||||
|
uid,
|
||||||
|
DOMAIN_ALIAS_RID_ADMINS,
|
||||||
|
disp_username,
|
||||||
|
passed_home_path,
|
||||||
|
disp_username);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!print_local && !print_domain && !print_local_groups)
|
if (!print_local && !print_domain && !print_local_groups)
|
||||||
|
|
Loading…
Reference in New Issue