|
PQS: Post Quantum Shell Protocol 1.1.0.0a (A2)
A quantum secure secure shell protocol
|
PQS server-side shell profile database functions. More...
#include "pqs.h"Go to the source code of this file.
Data Structures | |
| struct | pqs_shell_profile |
| A PQS server shell profile record. More... | |
| struct | pqs_shell_store |
| The fixed-size PQS server shell profile database. More... | |
Macros | |
| #define | PQS_SHELL_DATABASE_MAGIC "PQSSHELLDB1" |
| The fixed text header written to PQS shell profile database files. | |
| #define | PQS_SHELL_PRIVILEGE_GUEST 0x01U |
| Shell profile privilege mask bit for guest users. | |
| #define | PQS_SHELL_PRIVILEGE_USER 0x02U |
| Shell profile privilege mask bit for standard users. | |
| #define | PQS_SHELL_PRIVILEGE_ADMIN 0x04U |
| Shell profile privilege mask bit for administrative users. | |
| #define | PQS_SHELL_PRIVILEGE_ALL (PQS_SHELL_PRIVILEGE_GUEST | PQS_SHELL_PRIVILEGE_USER | PQS_SHELL_PRIVILEGE_ADMIN) |
| Shell profile privilege mask for all defined privilege levels. | |
Typedefs | |
| typedef PQS_EXPORT_API struct pqs_shell_profile | pqs_shell_profile |
| typedef PQS_EXPORT_API struct pqs_shell_store | pqs_shell_store |
Functions | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| PQS_EXPORT_API bool | pqs_shell_store_save (const pqs_shell_store *store) |
| Save a PQS shell profile store to its persistent database file. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
PQS server-side shell profile database functions.
| 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.
| privilege | [enum] The PQS user privilege value. |
| 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.
| profile | [const struct] A pointer to the shell profile record. |
| privilege | [enum] The PQS user privilege value to test. |
| 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.
| store | [struct] A pointer to the initialized shell profile store. |
| name | [const] The shell profile name. |
| type | [const] The shell type identifier, such as cmd, powershell, sh, bash, zsh, or custom. |
| path | [const] The absolute or configured executable path for the shell profile. |
| privilege_mask | The privilege mask controlling which PQS user privilege levels may use this profile. |
| enabled | The profile enabled state. |
| 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.
| store | [const struct] A pointer to the initialized shell profile store. |
| 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.
| store | [struct] A pointer to the initialized shell profile store. |
| name | [const] The shell profile name. |
| enabled | The requested enabled state. |
| 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.
| store | [const struct] A pointer to the initialized shell profile store. |
| name | [const] The shell profile name. |
| 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.
| store | [struct] A pointer to the initialized shell profile store. |
| name | [const] The shell profile name. |
| 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.
| store | [struct] A pointer to the shell profile store to initialize. |
| path | [const] The persistent shell profile database file path. |
| 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.
| store | [struct] A pointer to the initialized shell profile store. |
| name | [const] The shell profile name. |
| PQS_EXPORT_API bool pqs_shell_store_save | ( | const pqs_shell_store * | store | ) |
Save a PQS shell profile store to its persistent database file.
| store | [const struct] A pointer to the initialized shell profile store. |
| 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.
| store | [struct] A pointer to the initialized shell profile store. |
| name | [const] The shell profile name to mark as the default profile. |
| 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.
| store | [struct] A pointer to the initialized shell profile store. |
| name | [const] The shell profile name. |
| privilege | [enum] The PQS user privilege level to allow or deny. |
| allowed | The requested access state for the privilege level. |