Description Usage Arguments Details Value Note Author(s) Examples
set.user
attempts to change the user running the current
process. Note that this is only possible if the process has the
privilege to do so.
1 |
name |
either a string specifying the username or an integer
specifying the |
gid |
optional, integer, desired |
set.user
can be used in two ways: with a user name or with a
specific uid
/gid
combination. If used with a user name,
then set.user
attempts to find the user in the user database,
changes the uid
, gid
and supplemental groups according
to the user database.
When name
is a number, then set.user
only sets the
uid
and (if gid
is specified) gid
. Supplemental
groups are not changed in that case.
This function is typically used when R is started with elevated
privileges (or is suid
) and it needs to relinquish those to run
as a particular user. The recommended way is to use the username and
not the uid
/gid
specification.
The function will raise an error if either of the required steps fails.
integer, uid
if used with a username, TRUE
otherwise
When changing users, make sure you also change the permissions for
tempdir()
before you change the user. Otherwise R will
not function properly as it cannot create temporary files.
Simon Urbanek
1 2 3 4 | ## Not run:
set.user("myname")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.