65#define PQS_SHELL_DATABASE_MAGIC "PQSSHELLDB1"
70#define PQS_SHELL_PRIVILEGE_GUEST 0x01U
75#define PQS_SHELL_PRIVILEGE_USER 0x02U
80#define PQS_SHELL_PRIVILEGE_ADMIN 0x04U
85#define PQS_SHELL_PRIVILEGE_ALL (PQS_SHELL_PRIVILEGE_GUEST | PQS_SHELL_PRIVILEGE_USER | PQS_SHELL_PRIVILEGE_ADMIN)
92 char name[PQS_SHELL_PROFILE_NAME_MAX];
93 char type[PQS_SHELL_PROFILE_TYPE_MAX];
94 char path[PQS_SHELL_PROFILE_PATH_MAX];
106 char path[QSC_SYSTEM_MAX_PATH];
PQS_EXPORT_API pqs_shell_profile * pqs_shell_store_find_mutable(pqs_shell_store *store, const char *name)
Find a mutable shell profile record by name.
Definition pqsshell.c:327
PQS_EXPORT_API bool pqs_shell_store_set_privilege(pqs_shell_store *store, const char *name, pqs_user_privileges privilege, bool allowed)
Enable or disable shell profile access for a specific PQS user privilege level.
Definition pqsshell.c:549
PQS_EXPORT_API bool pqs_shell_store_enable(pqs_shell_store *store, const char *name, bool enabled)
Enable or disable an existing shell profile record.
Definition pqsshell.c:284
PQS_EXPORT_API bool pqs_shell_store_add(pqs_shell_store *store, const char *name, const char *type, const char *path, uint32_t privilege_mask, bool enabled)
Add or replace a shell profile record in a PQS shell profile store.
Definition pqsshell.c:256
PQS_EXPORT_API bool pqs_shell_store_save(const pqs_shell_store *store)
Save a PQS shell profile store to its persistent database file.
Definition pqsshell.c:481
PQS_EXPORT_API const pqs_shell_profile * pqs_shell_store_find(const pqs_shell_store *store, const char *name)
Find a shell profile record by name.
Definition pqsshell.c:303
PQS_EXPORT_API bool pqs_shell_store_remove(pqs_shell_store *store, const char *name)
Remove a shell profile record from a PQS shell profile store.
Definition pqsshell.c:440
PQS_EXPORT_API bool pqs_shell_profile_allows_privilege(const pqs_shell_profile *profile, pqs_user_privileges privilege)
Test whether a shell profile permits access for a specified PQS user privilege level.
Definition pqsshell.c:600
PQS_EXPORT_API bool pqs_shell_store_set_default(pqs_shell_store *store, const char *name)
Set the default shell profile for a PQS shell profile store.
Definition pqsshell.c:524
PQS_EXPORT_API const pqs_shell_profile * pqs_shell_store_default(const pqs_shell_store *store)
Find the default shell profile in a PQS shell profile store.
Definition pqsshell.c:351
PQS_EXPORT_API bool pqs_shell_store_initialize(pqs_shell_store *store, const char *path)
Initialize a PQS shell profile store and load or create its persistent database file.
Definition pqsshell.c:380
PQS_EXPORT_API uint32_t pqs_shell_privilege_to_mask(pqs_user_privileges privilege)
Convert a PQS user privilege value to the corresponding shell profile privilege-mask bit.
Definition pqsshell.c:578
A PQS server shell profile record.
Definition pqsshell.h:91
bool isdefault
Definition pqsshell.h:97
char path[PQS_SHELL_PROFILE_PATH_MAX]
Definition pqsshell.h:94
uint32_t privilege_mask
Definition pqsshell.h:95
bool enabled
Definition pqsshell.h:96
char type[PQS_SHELL_PROFILE_TYPE_MAX]
Definition pqsshell.h:93
char name[PQS_SHELL_PROFILE_NAME_MAX]
Definition pqsshell.h:92
The fixed-size PQS server shell profile database.
Definition pqsshell.h:104
size_t count
Definition pqsshell.h:107
char path[QSC_SYSTEM_MAX_PATH]
Definition pqsshell.h:106
pqs_shell_profile profiles[PQS_SHELL_PROFILE_DATABASE_MAX]
Definition pqsshell.h:105
bool initialized
Definition pqsshell.h:108