* mkpasswd.c (current_user): Don't use HOMEDRIVE/HOMEPATH to generate

user's homedir.

	* mkgroup.c: Accommodate ctype changes.
	* mkpasswd.c: Ditto.
	* setfacl.c: Ditto.
	* ssp.c: Ditto.
This commit is contained in:
Corinna Vinschen 2009-05-06 11:54:24 +00:00
parent 764d88e4a7
commit 05e6f7b2b9
5 changed files with 25 additions and 30 deletions

View File

@ -1,3 +1,13 @@
2009-05-06 Corinna Vinschen <corinna@vinschen.de>
* mkpasswd.c (current_user): Don't use HOMEDRIVE/HOMEPATH to generate
user's homedir.
* mkgroup.c: Accommodate ctype changes.
* mkpasswd.c: Ditto.
* setfacl.c: Ditto.
* ssp.c: Ditto.
2009-05-04 Corinna Vinschen <corinna@vinschen.de> 2009-05-04 Corinna Vinschen <corinna@vinschen.de>
* cygcheck.cc (usage): Fix option order and print. * cygcheck.cc (usage): Fix option order and print.

View File

@ -1,7 +1,7 @@
/* mkgroup.c: /* mkgroup.c:
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008 Red Hat, Inc. 2007, 2008, 2009 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -244,7 +244,7 @@ enum_unix_groups (domlist_t *dom_or_machine, const char *sep, DWORD id_offset,
for (gstr = strtok (grp_list, ","); gstr; gstr = strtok (NULL, ",")) for (gstr = strtok (grp_list, ","); gstr; gstr = strtok (NULL, ","))
{ {
if (!isdigit (gstr[0]) && gstr[0] != '-') if (!isdigit ((unsigned char) gstr[0]) && gstr[0] != '-')
{ {
PWCHAR p = wcpcpy (grp, L"Unix Group\\"); PWCHAR p = wcpcpy (grp, L"Unix Group\\");
ret = mbstowcs (p, gstr, GNLEN + 1); ret = mbstowcs (p, gstr, GNLEN + 1);
@ -276,7 +276,7 @@ enum_unix_groups (domlist_t *dom_or_machine, const char *sep, DWORD id_offset,
start = strtol (p, &p, 10); start = strtol (p, &p, 10);
if (!*p) if (!*p)
stop = start; stop = start;
else if (*p++ != '-' || !isdigit (*p) else if (*p++ != '-' || !isdigit ((unsigned char) *p)
|| (stop = strtol (p, &p, 10)) < start || *p) || (stop = strtol (p, &p, 10)) < start || *p)
{ {
fprintf (stderr, "%s: Malformed unix group list entry '%s'. " fprintf (stderr, "%s: Malformed unix group list entry '%s'. "
@ -807,7 +807,7 @@ main (int argc, char **argv)
if (opt && (p = strchr (opt, ','))) if (opt && (p = strchr (opt, ',')))
{ {
if (p == opt if (p == opt
|| !isdigit (p[1]) || !isdigit ((unsigned char) p[1])
|| (domlist[print_domlist].id_offset = strtol (p + 1, &ep, 10) || (domlist[print_domlist].id_offset = strtol (p + 1, &ep, 10)
, *ep)) , *ep))
{ {

View File

@ -1,7 +1,7 @@
/* mkpasswd.c: /* mkpasswd.c:
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006,
2008 Red Hat, Inc. 2008, 2009 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -146,7 +146,7 @@ put_sid (PSID sid)
static void static void
psx_dir (char *in, char *out) psx_dir (char *in, char *out)
{ {
if (isalpha (in[0]) && in[1] == ':') if (isalpha ((unsigned char) in[0]) && in[1] == ':')
{ {
sprintf (out, "/cygdrive/%c", in[0]); sprintf (out, "/cygdrive/%c", in[0]);
in += 2; in += 2;
@ -212,7 +212,7 @@ current_user (int print_cygpath, const char *sep, const char *passed_home_path,
DWORD dlen = MAX_DOMAIN_NAME_LEN + 1; DWORD dlen = MAX_DOMAIN_NAME_LEN + 1;
SID_NAME_USE acc_type; SID_NAME_USE acc_type;
int uid, gid; int uid, gid;
char homedir_psx[PATH_MAX] = {0}, homedir_w32[MAX_PATH] = {0}; char homedir_psx[PATH_MAX] = {0};
if (!curr_user.psid || !curr_pgrp.psid if (!curr_user.psid || !curr_pgrp.psid
|| !LookupAccountSidW (NULL, curr_user.psid, user, &ulen, dom, &dlen, || !LookupAccountSidW (NULL, curr_user.psid, user, &ulen, dom, &dlen,
@ -229,8 +229,6 @@ current_user (int print_cygpath, const char *sep, const char *passed_home_path,
if (passed_home_path[0] == '\0') if (passed_home_path[0] == '\0')
{ {
char *envhome = getenv ("HOME"); char *envhome = getenv ("HOME");
char *envhomedrive = getenv ("HOMEDRIVE");
char *envhomepath = getenv ("HOMEPATH");
if (envhome && envhome[0]) if (envhome && envhome[0])
{ {
@ -240,19 +238,6 @@ current_user (int print_cygpath, const char *sep, const char *passed_home_path,
else else
psx_dir (envhome, homedir_psx); psx_dir (envhome, homedir_psx);
} }
else if (envhomepath && envhomepath[0])
{
if (envhomedrive)
strlcpy (homedir_w32, envhomedrive, sizeof (homedir_w32));
if (envhomepath[0] != '\\')
strlcat (homedir_w32, "\\", sizeof (homedir_w32));
strlcat (homedir_w32, envhomepath, sizeof (homedir_w32));
if (print_cygpath)
cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, homedir_w32,
homedir_psx, PATH_MAX);
else
psx_dir (homedir_w32, homedir_psx);
}
else else
{ {
wcstombs (stpncpy (homedir_psx, "/home/", sizeof (homedir_psx)), wcstombs (stpncpy (homedir_psx, "/home/", sizeof (homedir_psx)),
@ -319,7 +304,7 @@ enum_unix_users (domlist_t *dom_or_machine, const char *sep, DWORD id_offset,
for (ustr = strtok (user_list, ","); ustr; ustr = strtok (NULL, ",")) for (ustr = strtok (user_list, ","); ustr; ustr = strtok (NULL, ","))
{ {
if (!isdigit (ustr[0]) && ustr[0] != '-') if (!isdigit ((unsigned char) ustr[0]) && ustr[0] != '-')
{ {
PWCHAR p = wcpcpy (user, L"Unix User\\"); PWCHAR p = wcpcpy (user, L"Unix User\\");
ret = mbstowcs (p, ustr, UNLEN + 1); ret = mbstowcs (p, ustr, UNLEN + 1);
@ -351,7 +336,7 @@ enum_unix_users (domlist_t *dom_or_machine, const char *sep, DWORD id_offset,
start = strtol (p, &p, 10); start = strtol (p, &p, 10);
if (!*p) if (!*p)
stop = start; stop = start;
else if (*p++ != '-' || !isdigit (*p) else if (*p++ != '-' || !isdigit ((unsigned char) *p)
|| (stop = strtol (p, &p, 10)) < start || *p) || (stop = strtol (p, &p, 10)) < start || *p)
{ {
fprintf (stderr, "%s: Malformed unix user list entry '%s'. " fprintf (stderr, "%s: Malformed unix user list entry '%s'. "
@ -776,7 +761,7 @@ main (int argc, char **argv)
if (opt && (p = strchr (opt, ','))) if (opt && (p = strchr (opt, ',')))
{ {
if (p == opt if (p == opt
|| !isdigit (p[1]) || !isdigit ((unsigned char) p[1])
|| (domlist[print_domlist].id_offset = strtol (p + 1, &ep, 10) || (domlist[print_domlist].id_offset = strtol (p + 1, &ep, 10)
, *ep)) , *ep))
{ {

View File

@ -1,6 +1,6 @@
/* setfacl.c /* setfacl.c
Copyright 2000, 2001, 2002, 2003 Red Hat Inc. Copyright 2000, 2001, 2002, 2003, 2006, 2008, 2009 Red Hat Inc.
Written by Corinna Vinschen <vinschen@redhat.com> Written by Corinna Vinschen <vinschen@redhat.com>
@ -51,7 +51,7 @@ typedef enum {
mode_t getperm (char *in) mode_t getperm (char *in)
{ {
if (isdigit (*in) && !in[1]) if (isdigit ((unsigned char) *in) && !in[1])
{ {
int i = atoi (in); int i = atoi (in);
if (i < 0 || i > 7) if (i < 0 || i > 7)
@ -127,7 +127,7 @@ getaclentry (action_t action, char *c, aclent_t *ace)
if (action == Delete) if (action == Delete)
return FALSE; return FALSE;
} }
else if (isdigit (*c)) else if (isdigit ((unsigned char) *c))
{ {
char *c3; char *c3;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2001, 2002 Red Hat, Inc. * Copyright (c) 2000, 2001, 2002, 2009 Red Hat, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -596,7 +596,7 @@ run_program (char *cmdline)
{ {
dll_ptr = cp+1; dll_ptr = cp+1;
} }
*cp = tolower (*cp); *cp = tolower ((unsigned char) *cp);
} }
} }
} }