Loading...
Searching...
No Matches
XrdSysPriv.cc File Reference
`#include "XrdSys/XrdSysPriv.hh"`
`#include <cstdio>`
`#include "XrdSys/XrdSysHeaders.hh"`
`#include "XrdSys/XrdSysPwd.hh"`
`#include <unistd.h>`
`#include <pwd.h>`
`#include <cerrno>`
Include dependency graph for XrdSysPriv.cc:

Go to the source code of this file.

## Macros

#define | NOGC ((gid_t)(-1))
#define | NOUC ((uid_t)(-1))
#define | XSPERR(x)

## Functions

static int | getresgid (gid_t *r, gid_t *e, gid_t *)
static int | getresuid (uid_t *r, uid_t *e, uid_t *)
static int | setresgid (gid_t r, gid_t e, gid_t)
static int | setresuid (uid_t r, uid_t e, uid_t)

## Macro Definition Documentation

## NOGC

#define NOGC ((gid_t)(-1))

Definition at line 52 of file XrdSysPriv.cc.

Referenced by setresgid().

## NOUC

#define NOUC ((uid_t)(-1))

Definition at line 51 of file XrdSysPriv.cc.

Referenced by setresuid().

## XSPERR

#define XSPERR | ( |  | x | ) |

Value:
((x == 0) ? -1 : -x)

Definition at line 53 of file XrdSysPriv.cc.

Referenced by XrdSysPriv::ChangePerm(), setresgid(), and setresuid().

## Function Documentation

## getresgid()

int getresgid | ( | gid_t * | r,
|  | gid_t * | e,
|  | gid_t * | )

static

Definition at line 89 of file XrdSysPriv.cc.

{
*r = getgid();
*e = getegid();
return 0;
}

Referenced by XrdSysPriv::ChangePerm().

Here is the caller graph for this function:

## getresuid()

int getresuid | ( | uid_t * | r,
|  | uid_t * | e,
|  | uid_t * | )

static

Definition at line 96 of file XrdSysPriv.cc.

{
*r = getuid();
*e = geteuid();
return 0;
}

Referenced by XrdSysPriv::ChangePerm().

Here is the caller graph for this function:

## setresgid()

int setresgid | ( | gid_t | r,
|  | gid_t | e,
|  | gid_t | )

static

Definition at line 75 of file XrdSysPriv.cc.

{
if (r != NOGC && setgid(r) == -1)
return XSPERR(errno);
return ((e != NOGC) ? setegid(e) : 0);
}
XSPERR
#define XSPERR(x)
Definition XrdSysPriv.cc:53
NOGC
#define NOGC
Definition XrdSysPriv.cc:52

References NOGC, and XSPERR.

Referenced by XrdSysPriv::ChangePerm().

Here is the caller graph for this function:

## setresuid()

int setresuid | ( | uid_t | r,
|  | uid_t | e,
|  | uid_t | )

static

Definition at line 82 of file XrdSysPriv.cc.

{
if (r != NOUC && setuid(r) == -1)
return XSPERR(errno);
return ((e != NOUC) ? seteuid(e) : 0);
}
NOUC
#define NOUC
Definition XrdSysPriv.cc:51

References NOUC, and XSPERR.

Referenced by XrdSysPriv::ChangePerm().

Here is the caller graph for this function: