getuid(2) System Calls Manual getuid(2)Name
getuid, geteuid - get user identity
Syntax
#include <sys/types.h>
#include <unistd.h>
uid = getuid()
uid_t uid;
euid = geteuid()
uid_t euid;
Description
The system call returns the real user ID of the current process, the effective user ID.
The real user ID identifies the person who is logged in. The effective user ID gives the process additional permissions during execution
of "set-user-ID" mode processes, which use to determine the real-user-id of the process which invoked them.
Environment
System Five
Differs from the System V definition in that the return values are of type int, instead of unsigned short.
POSIX
When your program is compiled in POSIX mode, the and functions return a value of type uid_t. The and functions return a value of type
gid_t.
See Alsogetgid(2), setreuid(2)getuid(2)
Check Out this Related Man Page
getuid(2) System Calls getuid(2)NAME
getuid, geteuid, getgid, getegid - get real user, effective user, real group, and effective group IDs
SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
uid_t getuid(void);
uid_t geteuid(void);
gid_t getgid(void);
gid_t getegid(void);
DESCRIPTION
The getuid() function returns the real user ID of the calling process. The real user ID identifies the person who is logged in.
The geteuid() function returns the effective user ID of the calling process. The effective user ID gives the process various permissions
during execution of "set-user-ID" mode processes which use getuid() to determine the real user ID of the process that invoked them.
The getgid() function returns the real group ID of the calling process.
The getegid() function returns the effective group ID of the calling process.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
SEE ALSO Intro(2), setuid(2), attributes(5), standards(5)SunOS 5.11 28 Dec 1996 getuid(2)
Folks
I need help on following two.
1.
Say i am getting two values like this
::1:953 and :::8005
I need to replace "::" (first two colons with a * ).I can get these values in a variable.How to tweak this variable to separate out the way i want? Anything after third ":" should be set... (9 Replies)
Hello Gurus,
I just started Unix, i am neither a student nor a proffessional.
i just completed my masters degree and looking for a career in Unix/Linux.
so i will be preparing for myself with the help of different forum's guru's.
i just completed the os basics and going through baiscs of... (3 Replies)
Hello
My system is Debian-503-amd64. After I installed the "lpr" package, I found that some files with SUID bit come from this package. As:
ls -l /usr/bin/lp*
....
-rwsr-sr-x 1 root lp 31800 2008-05-20 /usr/bin/lpq
-rwsr-sr-x 1 root lp 28504 2008-05-20 /usr/bin/lpr
-rwsr-sr-x 1... (1 Reply)
Hi all,
I am OpenBSD newbie and currently need to manage some OpenBSD firewalls running pf. The OpenBSD version is 4.8
As the other sys admins are not so familiar with OpenBSD, so I have an idea across in my mind on how to minimize the root account usage and other unnecessary access and make... (9 Replies)
Hello all.
Despite the exec man page, the exec system call seems to turn my effective-user-id into my real-user-id.
I coded and compiled 2 very simple c programs as user 1 (uid=501)
The first one (A) prints real and effective user IDs and then execs the second one (B), which in turn prints... (7 Replies)
Hi,
I am facing strange problem in solaris 10.
My requirement is that on server A using user test, any user which is created on Server B will be able to login wihtout password (ssh) from Server A
All the users which are on Server B are able able to login from Server A using test user.
... (8 Replies)
Hello All,
Sendmail takes too long to start and the host is unable to send emails, below are the steps followed, Please let me know if I'm missing anything, is there a debug mode for mailx?
# time service sendmail restart
Shutting down sm-client:
Shutting... (6 Replies)
Hello,
I created a new user "rootNew"
After creation I manually change the file /etc/passwd and gave the new user "rootNew" uid 0.
Now I have 2 users with uid 0 (root,rootNew) how can I know which user is log in the system?
"whoami" command return "root" for both users.
Thanks,
Uri (10 Replies)
In our project we have several unix scripts that trigger different processes. These scripts write logs to a particular folder 'sesslogs', create output data files in a separate directory called 'datafiles' etc. Usually L1 support team re-run these scripts . We donot want L1 support team to have... (14 Replies)
Hi Forum.
I have an XML file with the following requirement to move the <AdditionalAccountHolders> tag and its content right after the <accountHolderName> tag within the same file but I'm not sure how to accomplish this through a Unix script.
Any feedback will be greatly appreciated.
... (19 Replies)
Someone, please help on this issue:-
Note : for security reason i didn't mention hostnames and ips.
==============================================================================
# ntpstat
unsynchronised
polling server every 1024 s
Ntpstat showing unsynchronised.
... (29 Replies)