The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Functions to produce and parse the FreeRADIUS presentation format. More...
#include <pwd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <grp.h>
#include <freeradius-devel/util/talloc.h>
Go to the source code of this file.
Functions | |
void | fr_perm_file_error (int num) |
Write a file access error to the fr_strerror buffer, including euid/egid. More... | |
int | fr_perm_getgrgid (TALLOC_CTX *ctx, struct group **out, gid_t gid)) |
Resolve a gid to a group database entry. More... | |
int | fr_perm_getgrnam (TALLOC_CTX *ctx, struct group **out, char const *name)) |
Resolve a group name to a group database entry. More... | |
int | fr_perm_getpwnam (TALLOC_CTX *ctx, struct passwd **out, char const *name)) |
Resolve a username to a passwd entry. More... | |
int | fr_perm_getpwuid (TALLOC_CTX *ctx, struct passwd **out, uid_t uid)) |
Resolve a uid to a passwd entry. More... | |
int | fr_perm_gid_from_str (TALLOC_CTX *ctx, gid_t *out, char const *name)) |
Resolve a group name to a GID. More... | |
char * | fr_perm_gid_to_str (TALLOC_CTX *ctx, gid_t gid) |
char const * | fr_perm_mode_to_oct (char out[static 5], mode_t mode) |
char const * | fr_perm_mode_to_str (char out[static 10], mode_t mode) |
Convert mode_t into humanly readable permissions flags. More... | |
int | fr_perm_uid_from_str (TALLOC_CTX *ctx, uid_t *out, char const *name)) |
Resolve a user name to a GID. More... | |
char * | fr_perm_uid_to_str (TALLOC_CTX *ctx, uid_t uid) |
Print uid to a string. More... | |
Functions to produce and parse the FreeRADIUS presentation format.
Definition in file perm.h.
void fr_perm_file_error | ( | int | num | ) |
Write a file access error to the fr_strerror buffer, including euid/egid.
num | Usually errno, unless the error is returned by the function. |
Definition at line 403 of file perm.c.
int fr_perm_getgrgid | ( | TALLOC_CTX * | ctx, |
struct group ** | out, | ||
gid_t | gid | ||
) |
Resolve a gid to a group database entry.
Resolves a gid to a group database entry. The memory to hold the group entry is talloced under ctx, and must be freed when no longer required.
ctx | to allocate passwd entry in. |
out | Where to write pointer to entry. |
gid | to resolve. |
Definition at line 201 of file perm.c.
int fr_perm_getgrnam | ( | TALLOC_CTX * | ctx, |
struct group ** | out, | ||
char const * | name | ||
) |
Resolve a group name to a group database entry.
Resolves a group name to a group database entry. The memory to hold the group entry is talloced under ctx, and must be freed when no longer required.
ctx | to allocate passwd entry in. |
out | Where to write pointer to entry. |
name | to resolve. |
Definition at line 264 of file perm.c.
int fr_perm_getpwnam | ( | TALLOC_CTX * | ctx, |
struct passwd ** | out, | ||
char const * | name | ||
) |
Resolve a username to a passwd entry.
Resolves a username to a passwd entry. The memory to hold the passwd entry is talloced under ctx, and must be freed when no longer required.
ctx | to allocate passwd entry in. |
out | Where to write pointer to entry. |
name | to resolve. |
Definition at line 138 of file perm.c.
int fr_perm_getpwuid | ( | TALLOC_CTX * | ctx, |
struct passwd ** | out, | ||
uid_t | uid | ||
) |
Resolve a uid to a passwd entry.
Resolves a uid to a passwd entry. The memory to hold the passwd entry is talloced under ctx, and must be freed when no longer required.
ctx | to allocate passwd entry in. |
out | Where to write pointer to entry. |
uid | to resolve. |
Definition at line 75 of file perm.c.
int fr_perm_gid_from_str | ( | TALLOC_CTX * | ctx, |
gid_t * | out, | ||
char const * | name | ||
) |
char* fr_perm_gid_to_str | ( | TALLOC_CTX * | ctx, |
gid_t | gid | ||
) |
char const* fr_perm_mode_to_oct | ( | char | out[static 5], |
mode_t | mode | ||
) |
char const* fr_perm_mode_to_str | ( | char | out[static 10], |
mode_t | mode | ||
) |
int fr_perm_uid_from_str | ( | TALLOC_CTX * | ctx, |
uid_t * | out, | ||
char const * | name | ||
) |
char* fr_perm_uid_to_str | ( | TALLOC_CTX * | ctx, |
uid_t | uid | ||
) |