group
group__libshare__syspam
Provides capabilities for managing user accounts.
Permission Access Management
typedef struct shseed_t shseed_t
typedef struct shadow_t shadow_t
uint64_t shpam_uid
(char *username)
A unique reference to a share account.
shkey_t* shpam_ident_gen
(uint64_t uid, shpeer_t *peer)
An identity key referencing an account for an application.
shkey_t* shpam_ident_root
(shpeer_t *peer)
The 'root' identity for an application.
int shpam_ident_verify
(shkey_t *id_key, uint64_t uid, shpeer_t *peer)
Verify that an identity key references an application account.
uint64_t shpam_salt
(void)
Generate a random salt to be used to perterb a password key.
const char* shpam_username_sys
(void)
The current user's system account name.
const char* shuser_self
(void)
uint64_t shuser_id
(char *acc_name)
uint64_t shuser_self_id
(void)
int shuser_create
(char *acc_name, shpriv_t **priv_p)
Create a new user account.
Param
username
The account name.
ret_sess
A session key which can be used to perform priveleged operations on the user account created.
Return Value
A libshare error code.
Note
The effective current user must have SHPERM_CREATE permission to peform this action.
int shuser_create_priv
(char *acc_name, shpriv_t *priv, shpriv_t **priv_p)
int shuser_login_2fa
(char *acc_name, char *passphrase, uint32_t code_2fa, shpriv_t **priv_p)
int shuser_login
(char *acc_name, char *passphrase, shpriv_t **priv_p)
int shuser_pass_set
(char *acc_name, shpriv_t *priv, char *passphrase)
int shuser_info_set
(char *acc_name, shpriv_t *priv, int cmd, unsigned char *data, size_t data_len)
int shuser_remove
(char *acc_name, shpriv_t *priv)
int shuser_info
(char *acc_name, int cmd, unsigned char *ret_data, size_t *ret_len_p)
shjson_t* shuser_json
(char *acc_name)
int shuser_verify
(char *acc_name)
int shuser_inform
(uint64_t uid)
Notify the shared daemon of an account.
int shuser_admin_default
(shpriv_t **priv_p)
int shpam_shadow_login
(shfs_ino_t *file, char *acc_name, uint32_t code_2fa, unsigned char *pass_data, size_t pass_len, shpriv_t **priv_p)
int shpam_shadow_pass_set
(shfs_ino_t *file, char *acc_name, shpriv_t *priv, unsigned char *pass_data, size_t pass_len)
int shpam_shadow_remove
(shfs_ino_t *file, uint64_t uid, shpriv_t *priv)
int shpam_shadow_get
(shfs_ino_t *file, uint64_t uid, int cmd, unsigned char *raw, size_t *raw_len_p)
int shpam_shadow_set
(shfs_ino_t *file, uint64_t uid, shpriv_t *priv, int cmd, unsigned char *raw, size_t raw_len)
int shpam_shadow_uid_verify
(shfs_ino_t *file, uint64_t uid)
shjson_t* shpam_shadow_json
(shfs_ino_t *file, uint64_t uid)
shfs_ino_t* shpam_shadow_file
(shfs_t **fs_p)
int shpam_shadow_remote_set
(shfs_ino_t *file, uint64_t uid, shauth_t *auth)
int shpam_shadow_priv_verify
(shfs_ino_t *file, shpriv_t *priv)
int shpam_shadow_admin_login
(shfs_ino_t *file, unsigned char *pass_data, size_t pass_len, shpriv_t **priv_p)
shpriv_t* shpam_shadow_admin_default
(shfs_ino_t *file)
shtime_t shpam_shadow_ctime
(shfs_ino_t *file, uint64_t uid)
int shpam_shadow_auth_load
(shfs_ino_t *file, uint64_t uid, int scope, shauth_t *ret_auth)
int shpam_auth_set
(shseed_t *seed, char *username, unsigned char *pass_data, size_t pass_len)
Generate a pass key from the username and pass code provided.
int shpam_auth_verify
(shseed_t *seed, char *username, unsigned char *pass_data, size_t pass_len)
Verify a password seed references a username and password.
uint64_t shpam_salt_crypt
(void)
Obtain the linux PAM salt used to "crypt" the passphrase.
int shpam_auth_alg_default
(int scope)
int shpam_auth_init
(uint64_t uid, shseed_t *seed)
int shpam_auth_2fa_verify
(shseed_t *seed, char *username, uint32_t code_2fa)
uint64_t shpam_master_seed
(shseed_t *seed)
A checksum which is representative of the "secret data" associated with an account.
uint64_t shpam_euid
(void)
char* shapp_name
(char *app_name)
Strips the absolute parent from .
app_name
Note
"/test/one/two" becomes "two"
Return Value
Relative filename of executable.
Param
app_name
The running application's executable path
shpeer_t* shapp_init
(char *exec_path, char *host, int flags)
Initialize the share library runtime for an application.
Param
exec_path
The process's executable path.
host
The host that the app runs on or NULL for localhost.
flags
application flags
int shapp_register
(shpeer_t *peer)
int shapp_listen
(int tx, shpeer_t *peer)
int shapp_account
(const char *username, char *passphrase, shseed_t **seed_p)
int shapp_ident
(uint64_t uid, shkey_t **id_key_p)
shkey_t* shapp_kpriv
(shpeer_t *peer)
shkey_t* shapp_kpub
(shpeer_t *peer)
SHAUTH_SECONDARY
(1 << 1)
SHAUTH_SECRET
(1 << 2)
public key is derived from local seed secret
SHAUTH_EXTERNAL
(1 << 3)
authorization method provided via external (not local user) means
SHAUTH_TIME
(1 << 4)
the algorithm uses a relative time as the payload message to sign (2fa).
SHPERM_ADMIN
(SHPERM_READ | SHPERM_WRITE | SHPERM_CREATE | \
SHPERM_VERIFY | SHPERM_DELETE)
SHAPP_LOCAL
(1 << 0)
An application that is not intended to be publically accessible.
SHAPP_RLIMIT
(1 << 1)
Indicates that the "soft" resource limitations set by OS should be utilized.