CVS update: /ccvs/windows-NT/
[email protected] 31 May 2005 10:19:41 -0000
| Newsgroups | gmane.comp.version-control.cvs.cvs |
|---|---|
| Message-ID | <[email protected]> |
User: conradpino Date: 05/05/31 03:19:41 Modified: /ccvs/windows-NT/ ChangeLog, config.h.in.in, pwd.c, pwd.h, unistd.h Log: * config.h.in.in: Change macros (gid_t,pid_t,uid_t) to #undef. * pwd.c, pwd.h: Prototypes now (gid_t,uid_t) instead of "int". * pwd.c: Stop useing "root:root" for "uid:gid" values. * unistd.h: Use "windows-NT/sys/types.h" for definitions. File Changes: Directory: /ccvs/windows-NT/ ============================ File [changed]: ChangeLog Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/ChangeLog?r1=1.314&r2=1.315 Delta lines: +7 -0 ------------------- --- ChangeLog 31 May 2005 07:13:31 -0000 1.314 +++ ChangeLog 31 May 2005 10:19:38 -0000 1.315 @@ -1,5 +1,12 @@ 2005-05-31 Conrad T. Pino <[email protected]> + * config.h.in.in: Change macros (gid_t,pid_t,uid_t) to #undef. + * pwd.c, pwd.h: Prototypes now (gid_t,uid_t) instead of "int". + * pwd.c: Stop useing "root:root" for "uid:gid" values. + * unistd.h: Use "windows-NT/sys/types.h" for definitions. + +2005-05-31 Conrad T. Pino <[email protected]> + * unistd.c, unistd.c: Add new "usleep" function using "my_usleep" logic taken from "woe32.c" file. * woe32.c, woe32.h: Add new (woe32_home_dir,woe32_shell) functions. File [changed]: config.h.in.in Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/config.h.in.in?r1=1.35&r2=1.36 Delta lines: +3 -3 ------------------- --- config.h.in.in 31 May 2005 02:08:26 -0000 1.35 +++ config.h.in.in 31 May 2005 10:19:38 -0000 1.36 @@ -1119,7 +1119,7 @@ #undef gettimeofday /* Define to `int' if <sys/types.h> doesn't define. */ -#define gid_t int +#undef gid_t /* Define to rpl_gmtime if the replacement function should be used. */ #undef gmtime @@ -1164,7 +1164,7 @@ #define nanosleep woe32_nanosleep /* Define to `int' if <sys/types.h> does not define. */ -#define pid_t int +#undef pid_t /* Define to rpl_realloc if the replacement function should be used. */ #define realloc rpl_realloc @@ -1195,7 +1195,7 @@ #undef tzset /* Define to `int' if <sys/types.h> doesn't define. */ -#define uid_t int +#undef uid_t /* Define to the type of a unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ File [changed]: pwd.c Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/pwd.c?r1=1.11&r2=1.12 Delta lines: +15 -10 --------------------- --- pwd.c 31 May 2005 07:13:31 -0000 1.11 +++ pwd.c 31 May 2005 10:19:38 -0000 1.12 @@ -48,6 +48,10 @@ static struct passwd pw; /* should we return a malloc()'d structure */ static struct group gr; /* instead of pointers to static structures? */ +/* implement limited uid behavior */ +#define my_fake_uid ((const uid_t) 4545) +#define my_fake_gid my_fake_uid + /* return something like a username in a (butchered!) passwd structure. */ struct passwd * getpwuid (int uid) @@ -115,28 +119,28 @@ } /* return something like a uid. */ -int +uid_t getuid (void) { - return 0; /* every user is a super user ... */ + return my_fake_uid; } -int +gid_t getgid (void) { - return 0; + return my_fake_gid; } -int +uid_t geteuid (void) { - return 0; + return my_fake_uid; } -int +gid_t getegid (void) { - return 0; + return my_fake_gid; } struct passwd * @@ -162,9 +166,10 @@ /* return groups. */ int -getgroups (int ngroups, int *groups) +getgroups (int ngroups, gid_t *groups) { - *groups = 0; + if (ngroups > 0) + *groups = my_fake_gid; return 1; } File [changed]: pwd.h Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/pwd.h?r1=1.7&r2=1.8 Delta lines: +8 -11 -------------------- --- pwd.h 26 May 2005 16:40:00 -0000 1.7 +++ pwd.h 31 May 2005 10:19:38 -0000 1.8 @@ -16,10 +16,7 @@ much useful things under MS-DOS, but using them avoids many "#ifdef MSDOS" in ported UN*X code ... */ -#if 0 -/* This is taken care of in Windows-NT/config.h. */ -typedef int uid_t; -#endif +#include <sys/types.h> struct passwd { @@ -41,20 +38,20 @@ int gr_gid; }; -struct passwd *getpwuid (int); +struct passwd *getpwuid (uid_t); struct passwd *getpwnam (const char *); -struct group *getgrgid (int); +struct group *getgrgid (gid_t); struct group *getgrnam (const char *); char *getlogin (void); char *getgr_name (void); -int getuid (void); -int getgid (void); -int geteuid (void); -int getegid (void); +uid_t getuid (void); +gid_t getgid (void); +uid_t geteuid (void); +gid_t getegid (void); extern int *groups; extern int ngroups; -int getgroups (int, int *); +int getgroups (int, gid_t *); struct passwd *getpwent (void); void setpwent (void); File [changed]: unistd.h Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/unistd.h?r1=1.7&r2=1.8 Delta lines: +1 -5 ------------------- --- unistd.h 31 May 2005 07:13:31 -0000 1.7 +++ unistd.h 31 May 2005 10:19:38 -0000 1.8 @@ -27,11 +27,7 @@ /* include Microsoft's close, dup */ #include <io.h> -#ifndef pid_t -#define pid_t int -#endif /* pid_t */ - -typedef unsigned long useconds_t; +#include <sys/types.h> /* These functions doesn't exist under Windows NT; we provide stubs */ char * getpass (const char *prompt);