From aaf60637370acb1db20fb4fe6d0f80752a06f418 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 24 May 2001 21:38:10 +0000 Subject: 2000-05-24 Fernando Ruiz Casas * src/getegid.c, src/geteuid.c, src/getgid.c, src/getlogin.c, src/getuid.c: Now save their values in private user environment. --- cpukit/posix/ChangeLog | 5 +++++ cpukit/posix/src/getegid.c | 5 +++++ cpukit/posix/src/geteuid.c | 5 +++++ cpukit/posix/src/getgid.c | 6 ++++++ cpukit/posix/src/getlogin.c | 17 ++++++++++++++++- cpukit/posix/src/getuid.c | 6 ++++++ 6 files changed, 43 insertions(+), 1 deletion(-) (limited to 'cpukit') diff --git a/cpukit/posix/ChangeLog b/cpukit/posix/ChangeLog index 0d57fc4ac1..878b718d68 100644 --- a/cpukit/posix/ChangeLog +++ b/cpukit/posix/ChangeLog @@ -1,3 +1,8 @@ +2000-05-24 Fernando Ruiz Casas + + * src/getegid.c, src/geteuid.c, src/getgid.c, src/getlogin.c, + src/getuid.c: Now save their values in private user environment. + 2001-04-27 Ralf Corsepius * configure.in: Add [-ansi -fasm] to RTEMS_PROG_CC_FOR_TARGET. diff --git a/cpukit/posix/src/getegid.c b/cpukit/posix/src/getegid.c index 0eee106fe6..c7c48603b5 100644 --- a/cpukit/posix/src/getegid.c +++ b/cpukit/posix/src/getegid.c @@ -15,7 +15,12 @@ #include #include +#include + +/* + * MACRO in libio_.h gid_t _POSIX_types_Egid = 0; +*/ /*PAGE * diff --git a/cpukit/posix/src/geteuid.c b/cpukit/posix/src/geteuid.c index 04e59f2fe6..9e58615446 100644 --- a/cpukit/posix/src/geteuid.c +++ b/cpukit/posix/src/geteuid.c @@ -15,7 +15,12 @@ #include #include +#include + +/* + * MACRO in libio_.h uid_t _POSIX_types_Euid = 0; +*/ /*PAGE * diff --git a/cpukit/posix/src/getgid.c b/cpukit/posix/src/getgid.c index 4b50762ede..24bd88a2b4 100644 --- a/cpukit/posix/src/getgid.c +++ b/cpukit/posix/src/getgid.c @@ -15,7 +15,13 @@ #include #include +#include + +/* + * MACRO in libio_.h + * gid_t _POSIX_types_Gid = 0; +*/ /*PAGE * diff --git a/cpukit/posix/src/getlogin.c b/cpukit/posix/src/getlogin.c index 3e4d320b89..08a16c6430 100644 --- a/cpukit/posix/src/getlogin.c +++ b/cpukit/posix/src/getlogin.c @@ -15,6 +15,11 @@ #include #include +#include +#include +#include +#include + /*PAGE * * 4.2.4 Get User Name, P1003.1b-1993, p. 87 @@ -22,7 +27,11 @@ * NOTE: P1003.1c/D10, p. 49 adds getlogin_r(). */ +/* + * MACRO in libio_.h + * static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ]; +*/ char *getlogin( void ) { @@ -42,9 +51,15 @@ int getlogin_r( size_t namesize ) { + struct passwd *pw; if ( namesize < LOGIN_NAME_MAX ) return ERANGE; - strcpy( name, "posixapp" ); + pw=getpwuid(getuid()); + if (!pw) { + strcpy(name,""); + } else { + strncpy(name,pw->pw_name,LOGIN_NAME_MAX); + }; return 0; } diff --git a/cpukit/posix/src/getuid.c b/cpukit/posix/src/getuid.c index de8a521693..aafc818c01 100644 --- a/cpukit/posix/src/getuid.c +++ b/cpukit/posix/src/getuid.c @@ -15,7 +15,13 @@ #include #include +#include + +/* + * MACRO in libio_.h + * uid_t _POSIX_types_Uid = 0; +*/ /*PAGE * -- cgit v1.2.3