* (child_info.h, cygheap.h, dcrt0.cc, dir.cc, fhandler.cc, fhandler.h,
fhandler_clipboard.cc, fhandler_disk_file.cc, fhandler_dsp.cc, fhandler_floppy.cc, fhandler_mem.cc, fhandler_random.cc, fhandler_tape.cc, fhandler_zero.cc, grp.cc, mmap.cc, passwd.cc, pinfo.cc, pinfo.h, pipe.cc, sec_acl.cc, sec_helper.cc, security.cc, security.h, spawn.cc, syscalls.cc, thread.h, uinfo.cc, winsup.h): Change usage of uid_t to __uid16_t, gid_t to __gid16_t and off_t to __off32_t throughout. Use INVALID_UID, INVALID_GID and INVALID_SEEK instead casting -1 to the appropriate type. * winsup.h: Define INVALID_UID, INVALID_GID and INVALID_SEEK. * include/cygwin/acl.h: Define internal __aclent16_t and __aclent32_t types. Don't declare acl functions when compiling Cygwin. * include/cygwin/grp.h: Declare getgrgid() and getgrnam() with correct types for internal usage.
This commit is contained in:
@@ -174,7 +174,7 @@ internal_getlogin (cygheap_user &user)
|
||||
if (psid.getfrompw (pw) && EqualSid (user.sid (), psid))
|
||||
{
|
||||
user.set_name (pw->pw_name);
|
||||
struct group *gr = getgrgid (pw->pw_gid);
|
||||
struct __group16 *gr = getgrgid (pw->pw_gid);
|
||||
if (gr)
|
||||
if (!gsid.getfromgr (gr))
|
||||
gsid = NO_SID;
|
||||
@@ -249,9 +249,9 @@ uinfo_init ()
|
||||
cygheap->user.token = INVALID_HANDLE_VALUE;
|
||||
cygheap->user.impersonated = TRUE;
|
||||
|
||||
/* If uid is USHRT_MAX, the process is started from a non cygwin
|
||||
/* If uid is ILLEGAL_UID, the process is started from a non cygwin
|
||||
process or the user context was changed in spawn.cc */
|
||||
if (myself->uid == USHRT_MAX)
|
||||
if (myself->uid == ILLEGAL_UID)
|
||||
if ((p = internal_getlogin (cygheap->user)) != NULL)
|
||||
{
|
||||
myself->uid = p->pw_uid;
|
||||
@@ -283,25 +283,25 @@ getlogin (void)
|
||||
return strcpy (this_username, cygheap->user.name ());
|
||||
}
|
||||
|
||||
extern "C" uid_t
|
||||
extern "C" __uid16_t
|
||||
getuid (void)
|
||||
{
|
||||
return cygheap->user.real_uid;
|
||||
}
|
||||
|
||||
extern "C" gid_t
|
||||
extern "C" __gid16_t
|
||||
getgid (void)
|
||||
{
|
||||
return cygheap->user.real_gid;
|
||||
}
|
||||
|
||||
extern "C" uid_t
|
||||
extern "C" __uid16_t
|
||||
geteuid (void)
|
||||
{
|
||||
return myself->uid;
|
||||
}
|
||||
|
||||
extern "C" gid_t
|
||||
extern "C" __gid16_t
|
||||
getegid (void)
|
||||
{
|
||||
return myself->gid;
|
||||
|
Reference in New Issue
Block a user