version 1.2, 2015/04/20 18:10:10
|
version 1.3, 2015/04/20 18:19:50
|
|
|
#define _omi_user_h | #define _omi_user_h |
| |
#include <common.h> | #include <common.h> |
#include "strings.h" |
#include <pal/strings.h> |
#if defined(CONFIG_POSIX) | #if defined(CONFIG_POSIX) |
#include <pwd.h> | #include <pwd.h> |
#else | #else |
|
|
Returns: | Returns: |
0 if operation was successful; -1 otherwise | 0 if operation was successful; -1 otherwise |
*/ | */ |
int CreateAuthFile(uid_t uid, char* content, size_t size, char path[MAX_PATH_SIZE]); |
int CreateAuthFile(uid_t uid, _In_reads_(size) char* content, size_t size, _Pre_writable_size_(PAL_MAX_PATH_SIZE) char path[PAL_MAX_PATH_SIZE]); |
| |
#if defined(CONFIG_POSIX) | #if defined(CONFIG_POSIX) |
/* | /* |
|
|
Returns: | Returns: |
0 - if success; -1 otherwise | 0 - if success; -1 otherwise |
*/ | */ |
int FormatLogFileName(uid_t uid, gid_t gid, char path[MAX_PATH_SIZE]); |
int FormatLogFileName(uid_t uid, gid_t gid, char path[PAL_MAX_PATH_SIZE]); |
| |
/* | /* |
Disables authentication calls so 'AuthUser' always retunrs 'ok'; | Disables authentication calls so 'AuthUser' always retunrs 'ok'; |
|
|
*/ | */ |
void IgnoreAuthCalls(int flag); | void IgnoreAuthCalls(int flag); |
| |
|
/* |
|
Get if authentication calls was ignored or not |
|
Return value: |
|
1 - ignored; 0 - not |
|
*/ |
|
int IsAuthCallsIgnored(); |
| |
/* | /* |
Changes user/group IDs of current process. | Changes user/group IDs of current process. |
|
|
*/ | */ |
int IsRoot(); | int IsRoot(); |
| |
|
/* |
|
Gets username by uid |
|
*/ |
|
#define USERNAME_SIZE 128 |
|
int GetUserName( |
|
uid_t uid, |
|
char name[USERNAME_SIZE]); |
|
|
#endif | #endif |
| |
END_EXTERNC | END_EXTERNC |