Astra Linux Directory Client Core API
1.7.0
|
Функции | |
void | RegisterLdapSchema (IALDCore &Core, const string &schema) |
IALDCore * | AllocateCore () |
void | FreeCore (IALDCore *&ICore) |
bool | LoginAdmin (IALDCore &Core, const string &admin="") |
bool | LoginAdmin (IALDCore &Core, const string &admin, const string &pwd) |
void | Logout (IALDCore &Core, bool keep_cred=false) |
void | InitCore (IALDCore &Core) |
void | RegisterBaseValidators (IALDCore &Core) |
bool | UnparseHostName (IALDCore &Core, const string &host, const string &domain, string &fullname, string *perror) |
bool | ParseHostName (IALDCore &Core, const string &fullname, string &host, string &domain, string *perror) |
void | UpdatePrincipalInKeytab (CALDKadm5ConnPtr krb5, const string &keytab, const string &name, bool create) |
string | HostPrincipal (const string &name) |
string | UserToDN (const string &user, const string &base) |
string | DNToUser (const string &dn) |
void | CheckValidExits (const string &command, const int exitcode, ald_int_list &validlist) |
void | RestartNSCD () |
void | InvalidateNSCD () |
void | SetAllowTix (CALDKadm5ConnPtr &krb5, bool AllowTix) |
void | UpdateLifetimes (IALDCore &Core, CALDKadm5ConnPtr &krb5) |
void | FilterUserPrincipals (IALDCore &Core, ald_string_list &list) |
void | CheckConfigured (IALDCore &Core) |
void | CheckCompatibility (IALDCore &Core, const string &version) |
string | CannonicalizePrincipalName (IALDCore &Core, const string &name, const string &domain) |
string | SvcPrincipal (IALDCore &Core, const string &svc, const string &host="", const string &realm="") |
string | LifetimeToStr (unsigned int ltime) |
void | UseCommonCommand (IALDCore &Core, const string &cmd) |
bool | GetActiveALDServerName (IALDCore &Core, const string &domain, string &dc) |
void | SetCounter (string &name, int value) |
int | GetCounter (string &name) |
int | IncrementCounter (string &name, int increment) |
bool | ReConfigureSSSD (IALDCore *pCore, CALDConnectionPtr conn) |
void | UnConfigureSSSD (IALDCore *pCore) |
string | ModHostFlags (const string &flags, char flag, bool op) |
CALDHostPtr | GetServer (CALDConnectionPtr Conn) |
CALDHostPtr | GetHost (CALDConnectionPtr Conn) |
bool | UpdateServiceInKeytab (CALDConnectionPtr Conn, const string &keytab, const string &service, bool create) |
void | ShowLdapOperInfo (CALDObject &object, ostream &out) |
void | SetALDTimestamp (CALDObject &object, const string &tsname, time_t ts=0) |
string | GetALDTimestamp (CALDObject &object, const string &tsname) |
bool | ofl (const string &mnt, unsigned int signum, ald_string_map &occupants) |
void | KillOccupants (const string &mnt, bool hup, bool term, bool kill, unsigned int wait, bool quiet) |
void | send_str (ostream &o, const string &s, bool checklen=true) |
void | read_str (istream &i, string &s, bool checklen=true) |
void | send_size (ostream &o, size_t s) |
void | read_size (istream &i, size_t &s) |
const char * | rpcmsgtype2str (unsigned short message) |
bool | SendBroadcastMessage (IALDCore &Core, const string &msg, ald_string_list *responses=NULL, int timeout=3) |
void | UseTermColors (bool colored) |
bool | IsTermColored () |
string | t_cmd (const char *cmd) |
string | t_dflt () |
const char * | ExtractFileName (const char *pszFileName) |
const char * | ExtractFuncName (const char *pszFuncName) |
bool | ParsePair (const string &line, string &name, string &value) |
string | CurrentUser () |
string | DefaultCodeset () |
string | HostName (const string &host) |
string | TildeSubst (const string &file) |
string | HostDomain (const string &host) |
string | PFM2Name (const string &PFM) |
Функции получения интерфейсов | |
CALDLdapConnPtr | GetLdapConnection (IALDCore &Core, ALDAuthType at, unsigned int ci_flags) |
CALDKadm5ConnPtr | GetKadm5Connection (IALDCore &Core, ALDAuthType at, unsigned int ci_flags) |
CALDRpcConnPtr | GetRpcConnection (IALDCore &Core, ALDAuthType at, unsigned int ci_flags) |
CALDConfigPtr | GetConfig (IALDCore &Core) |
Исполнение внешних команд | |
int | ExecCommand (const string &command, bool infinite=false) |
int | ExecCommandOut (const string &command, ald_string_list &outlist, bool infinite=false) |
int | ExecCommandInOut (const string &command, ald_string_list &outlist, const ald_string_list &inlist, bool infinite=false) |
Работа с клиентской точкой монтирования домашних каталогов | |
void | CreateClientMountPoint (IALDCore &Core) |
void | UmountClientMountPoint (IALDCore &Core, const string &mode) |
void | MountClientMountPoint (IALDCore &Core, const string &mode) |
Функции сериализации объектов Kerberos | |
string | princ2str (const CALDKrbPrincipalPtr &princ) |
CALDKrbPrincipalPtr | str2princ (const string &name, const string &body) |
string | policy2str (const CALDKrbPolicyPtr &policy) |
CALDKrbPolicyPtr | str2policy (const string &name, const string &body) |
Группа макросов нотификации операций с объектом | |
bool | IfAdminCanManageHost (CALDConnectionPtr conn, const string &admin, const string &host) |
bool | IfAdminCanManageHostGroup (CALDConnectionPtr conn, const string &admin, const string &hostgroup) |
Функции преобразования строк и целых | |
bool | str2i (const string &str, int &val) |
string | i2str (int val) |
bool | str2u (const string &str, unsigned int &val) |
string | u2str (unsigned int val) |
bool | hex2u (const string &str, unsigned int &val) |
string | u2hex (unsigned int val) |
bool | oct2u (const string &str, unsigned int &val) |
string | u2oct (unsigned int val) |
bool | strTou64 (const string &str, uint64_t &val) |
string | u64Tostr (uint64_t val) |
Функции преобразования строк и типов времени | |
string | TimeToStr (time_t t, bool rfc2822) |
time_t | StrToTime (const string &strdt, bool rfc2822) |
time_t | GeneralizedTimeToTime (const string >) |
string | GeneralizedTimeToStr (const string >, bool rfc2822) |
string | TimeToGeneralizedTime (time_t t) |
Функции работы со строками | |
string | TrimLeft (const string &str) |
string | TrimRight (const string &str) |
string | Trim (const string &str) |
string | Unquote (const string &str) |
string | Quote (const string &str, bool force=false) |
string | Capitallize (const string &str) |
string | string2upper (const string &str) |
string | string2lower (const string &str) |
string & | StrAppend (string &str1, const string &str2) |
char * | strdup (const char *str) |
char * | strdup (const string &str) |
Функции преобразования имен доменов | |
string | DomainToDn (const string &domain) |
string | DomainToRealm (const string &domain) |
string | RemoveRealm (const string &str) |
string | DnToDomain (const string &dn) |
string | RealmToDomain (const string &realm) |
string | RemoveDomain (const string &str, const string &domain) |
Функции запроса ответа у пользователя | |
string | AskPassword (const string &prompt, size_t size, char star) |
string | AskText (const string &prompt, size_t size) |
string | AskTextDef (const string &prompt, const string &defText, size_t size) |
bool | AskYesNo (const string &prompt, bool defYes) |
unsigned int | AskNumber (const string &prompt, unsigned int defVal) |
Функции работы со списками строк | |
void | list_merge (ald_string_list &al1, const ald_string_list &al2) |
void | list_subtract (ald_string_list &al1, const ald_string_list &al2) |
void | list_intersect (ald_string_list &al1, const ald_string_list &al2) |
bool | IsMemberOfList (const ald_string_list &list, const string &str) |
string | listToStr (const ald_string_list &list) |
void | StrTolist (const string &str, ald_string_list &list, char delim=',') |
Функции работы с путями и файлами | |
bool | IsFileExist (const string &path) |
bool | IsDirExist (const string &path) |
bool | IsPathExist (const string &path) |
void | RemoveDir (const string &path, bool force) |
void | RemoveFile (const string &path) |
void | RemovePath (const string &path, bool force) |
void | RemoveFiles (const string &path, const string &pattern) |
void | CreateDir (const string &path, mode_t mode) |
void | EnsureDir (const string &path, mode_t mode) |
void | Chown (const string &path, uid_t uid, gid_t gid, bool rec=false) |
void | Chown (const string &path, const string &ouser, const string &ogroup, bool rec=false) |
void | Chmod (const string &path, mode_t mode, bool rec=false) |
bool | IsDirectory (const string &path) |
bool | IsFile (const string &path) |
void | RenameFile (const string &file, const string &targetFile) |
void | CopyFile (const string &file, const string &targetFile) |
void | CopyPath (const string &path, const string &targetPath, mode_t mode) |
void | CreateFile (const string &file) |
string | GetFileName (const string &file) |
string | GetFilePath (const string &file) |
string | GetFileExt (const string &file) |
Функции работы со сжатием файлов | |
void | GZipFile (const string &file, const string &targetFile) |
void | GunZipFile (const string &file, const string &targetFile) |
void | TarCreate (const ald_string_list &files, const string &targetFile, int mode) |
void | TarExtract (const string &file, const string &targetPath, int mode) |
void | Pack (const ald_string_list &files, const string &targetFile, int mode) |
void | Unpack (const string &file, const string &targetPath, int mode) |
Функции поддержки форматирования тестов целостности | |
void | TestIntegrityItem (const string &info) |
void | TestIntegritySection (const string &info, bool verb) |
void | TestIntegrityOK () |
void | TestIntegrityERROR () |
void | TestIntegrityWARNING () |
void | TestIntegrityFIXED () |
Переменные | |
const size_t | ALDRPCHDRSIZE = sizeof(ald_rpc_header) |
const string | ALD_HISTORY_FILE = ".history" |
Управление службами | |
enum | ALDServiceOperation { asoStop, asoStart, asoRestart, asoInstall, asoRemove, asoReload } |
int | ManageService (const string &service, ALDServiceOperation op, bool ignore=false) |
Работа с привилегиями Linux | |
enum | aldCapFlag { acfEffective = 1, acfPermitted = 2, acfInheritable = 4 } |
typedef uint32_t | ald_linux_caps |
typedef unsigned | ald_cap_flags |
void | EnumerateLinuxCaps (ald_string_list &caps) |
ald_linux_caps | LinuxCapByName (const string &capname) |
void | LinuxCapMod (cap_value_t cap, ald_cap_flags flags, cap_flag_value_t val) |
void | LinuxCapsClear (ald_cap_flags flags) |
Пространство имен основного интерфейса Astra Linux Directory.
int ALD::GetCounter | ( | string & | name | ) |
Получение значения именованного счётчика
int ALD::IncrementCounter | ( | string & | name, |
int | increment | ||
) |
Атомарное изменение значения именованного счётчика
void ALD::KillOccupants | ( | const string & | mnt, |
bool | hup, | ||
bool | term, | ||
bool | kill, | ||
unsigned int | wait, | ||
bool | quiet | ||
) |
Поиск и заврешение процессов, использующих указанную точку монтирования
[in] | mnt | Точка монтирования |
[in] | hup | Посылка SIGHUP |
[in] | term | Посылка SIGTERM |
[in] | kill | Посылка SIGKILL |
[in] | wait | Время ожидания ms |
[in] | quiet | Признак тихого режима |
bool ALD::ofl | ( | const string & | mnt, |
unsigned int | signum, | ||
ald_string_map & | occupants | ||
) |
Поиск и посылка сигналов процессам, использующих указанную точку монтирования
[in] | mnt | Точка монтирования |
[in] | signum | Сигнал |
[out] | occupants | Карта процессов |
void ALD::SetCounter | ( | string & | name, |
int | value | ||
) |
Установка значения именованного счётчика