summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-05-24 21:38:10 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-05-24 21:38:10 +0000
commitaaf60637370acb1db20fb4fe6d0f80752a06f418 (patch)
treea49c12ad4a109a36826139f7d11d754adf2bed2a /cpukit
parent9a23bf64539470303abc6b4c68489b0f433ad177 (diff)
downloadrtems-aaf60637370acb1db20fb4fe6d0f80752a06f418.tar.bz2
2000-05-24 Fernando Ruiz Casas <fernando.ruiz@ctv.es>
* src/getegid.c, src/geteuid.c, src/getgid.c, src/getlogin.c, src/getuid.c: Now save their values in private user environment.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/posix/ChangeLog5
-rw-r--r--cpukit/posix/src/getegid.c5
-rw-r--r--cpukit/posix/src/geteuid.c5
-rw-r--r--cpukit/posix/src/getgid.c6
-rw-r--r--cpukit/posix/src/getlogin.c17
-rw-r--r--cpukit/posix/src/getuid.c6
6 files changed, 43 insertions, 1 deletions
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 <fernando.ruiz@ctv.es>
+
+ * 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 <corsepiu@faw.uni-ulm.de>
* 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 <rtems/score/object.h>
#include <rtems/seterr.h>
+#include <rtems/libio_.h>
+
+/*
+ * 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 <rtems/score/object.h>
#include <rtems/seterr.h>
+#include <rtems/libio_.h>
+
+/*
+ * 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 <rtems/score/object.h>
#include <rtems/seterr.h>
+#include <rtems/libio_.h>
+
+/*
+ * 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 <rtems/score/object.h>
#include <rtems/seterr.h>
+#include <rtems/libio_.h>
+#include <string.h>
+#include <unistd.h>
+#include <pwd.h>
+
/*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 <rtems/score/object.h>
#include <rtems/seterr.h>
+#include <rtems/libio_.h>
+
+/*
+ * MACRO in libio_.h
+ *
uid_t _POSIX_types_Uid = 0;
+*/
/*PAGE
*