IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

setuid (2)

SETUID(2)                  Linux Programmer's Manual                 SETUID(2)



NAME
       setuid - set user identity

SYNOPSIS
       #include<sys/types.h>
       #include<unistd.h>

       intsetuid(uid_t uid);

DESCRIPTION
       setuid  sets  the  effective  user  ID  of the current process.  If the
       effective userid of the caller is root, the real and  saved  user  ID's
       are also set.

       Under  Linux,  setuid  is  implemented  like the POSIX version with the
       _POSIX_SAVED_IDS feature.  This allows a setuid (other than root)  pro-
       gram  to  drop  all of its user privileges, do some un-privileged work,
       and then re-engage the original effective user ID in a secure manner.

       If the user is root or the program is setuid root, special care must be
       taken.  The  setuid function checks the effective uid of the caller and
       if it is the superuser, all process related user ID's are set  to  uid.
       After  this  has  occurred,  it is impossible for the program to regain
       root privileges.

       Thus, a setuid-root program wishing to  temporarily  drop  root  privi-
       leges,  assume  the  identity  of a non-root user, and then regain root
       privileges afterwards cannot use setuid.  You can accomplish this  with
       the (non-POSIX, BSD) call seteuid.

RETURNVALUE
       On  success,  zero is returned.  On error, -1 is returned, and errno is
       set appropriately.

ERRORS
       EPERM  The user is not the super-user, and uid does not match the  real
              or saved user ID of the calling process.

CONFORMINGTO
       SVr4,  SVID, POSIX.1.  Not quite compatible with the 4.4BSD call, which
       sets all of the real, saved, and effective user IDs.  SVr4 documents an
       additional EINVAL error condition.

LINUX-SPECIFICREMARKS
       Linux  has  the  concept  of  filesystem user ID, normally equal to the
       effective user ID.  The setuid call also sets the filesystem user ID of
       the current process.  See setfsuid(2).

       If  uid  is  different  from the old effective uid, the process will be
       forbidden from leaving core dumps.

SEEALSO
       getuid(2), setreuid(2), seteuid(2), setfsuid(2)



Linux 1.1.36                      1994-07-29                         SETUID(2)

_Exitgetsockoptoutwshmat
_exitgettidoutw_pshmctl
_llseekgettimeofdaypauseshmdt
_newselectgetuidpersonalityshmget
_sysctlgttypipeshmop
acceptidlepivot_rootshutdown
accessinbpollsigaction
acctinb_pprctlsigaltstack
adjtimexinlpreadsigblock
afs_syscallinl_pprofsiggetmask
alarminsbpselectsigmask
alloc_hugepagesinslptracesignal
arch_prctlinswpwritesigpause
bdflushintroquotactlsigpending
bindinwreadsigprocmask
breakinw_preaddirsigqueue
brkioctlreadlinksigreturn
cacheflushioctl_listreadvsigsetmask
capgetiopermrebootsigsuspend
capsetioplrecvsigtimedwait
chdiripcrecvfromsigvec
chmodkillrecvmsgsigwaitinfo
chownkillpgrenamesocket
chrootlchownrmdirsocketcall
clonelinksbrksocketpair
closelistensched_get_priority_maxssetmask
connectllseeksched_get_priority_minstat
creatlocksched_getaffinitystatfs
duplseeksched_getparamstime
dup2lstatsched_getschedulerstty
execvemadvisesched_rr_get_intervalswapoff
exitmincoresched_setaffinityswapon
fchdirmkdirsched_setparamsymlink
fchmodmknodsched_setschedulersync
fchownmlocksched_yieldsyscall
fcntlmlockallselectsyscalls
fdatasyncmmapselect_tutsysctl
flockmmap2semctlsysfs
forkmodify_ldtsemgetsysinfo
free_hugepagesmountsemopsyslog
fstatmprotectsendtime
fstatfsmpxsendfiletimes
fsyncmremapsendmsgtkill
ftruncatemsgctlsendtotruncate
futexmsggetsetcontextumask
getcontextmsgopsetdomainnameumount
getdentsmsgrcvsetegidumount2
getdomainnamemsgsndseteuiduname
getdtablesizemsyncsetfsgidundocumented
getegidmunlocksetfsuidunimplemented
geteuidmunlockallsetgidunlink
getgidmunmapsetgroupsuselib
getgroupsnanosleepsethostidustat
gethostidnfsservctlsethostnameutime
gethostnamenicesetitimerutimes
getitimerobsoletesetpgidvfork
getpagesizeoldfstatsetpgrpvhangup
getpeernameoldlstatsetpriorityvm86
getpgidoldoldunamesetregidwait
getpgrpoldstatsetresgidwait3
getpidoldunamesetresuidwait4
getppidopensetreuidwaitpid
getpriorityoutbsetrlimitwrite
getresgidoutb_psetsidwritev
getresuidoutlsetsockopt 
getrlimitoutl_psettimeofday 
getrusageoutsbsetuid 
getsidoutslsetup 


My Money 2.0.49
Personal financial software
Linux Kernel 2.6 2.6.32-rc8
Linux Kernel
GCstar 1.5.0
Personal collections manager
ImageMagick 6.5.7.9
ImageMagick image processing studio
BibleTime 2.4
Bible study software for Linux / KDE
PHP 5.3.1
Server-side, cross-platform, HTML embedded scripting language.
LFTP 4.0.4
Shell-like command line ftp client.
Tellico 2.1.1
Collection manager for books, music, videos, and bibliographies
Totem 2.28.4
Movie player for Gnome
GNOME 2.29.2
GNOME desktop environment
Free IT Magazines, White Papers, eBooks, and more !
Oracle Magazine

Contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more.

Vulnerability Management for Dummies

Get all the Facts and See How to Implement a Successful Vulnerability Management Program.

Website Magazine

Has tapped premier talent in the Internet industry for our content and each and every issue will contain practical advice and insights for website owners.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info