![]() |
![]() |
![]() |
Liboobs (System configuration management) Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
OobsUsersConfig; OobsObject* oobs_users_config_get (void); OobsList* oobs_users_config_get_users (OobsUsersConfig *config); OobsResult oobs_users_config_add_user (OobsUsersConfig *config, OobsUser *user); OobsResult oobs_users_config_delete_user (OobsUsersConfig *config, OobsUser *user); uid_t oobs_users_config_get_minimum_users_uid (OobsUsersConfig *config); void oobs_users_config_set_minimum_users_uid (OobsUsersConfig *config, uid_t uid); uid_t oobs_users_config_get_maximum_users_uid (OobsUsersConfig *config); void oobs_users_config_set_maximum_users_uid (OobsUsersConfig *config, uid_t uid); const gchar* oobs_users_config_get_default_shell (OobsUsersConfig *config); void oobs_users_config_set_default_shell (OobsUsersConfig *config, const gchar *shell); const gchar* oobs_users_config_get_default_home_dir (OobsUsersConfig *config); void oobs_users_config_set_default_home_dir (OobsUsersConfig *config, const gchar *home_dir); OobsGroup* oobs_users_config_get_default_group (OobsUsersConfig *config); GList* oobs_users_config_get_available_shells (OobsUsersConfig *config); gboolean oobs_users_config_get_encrypted_home_support (OobsUsersConfig *config); GList* oobs_users_config_get_available_locales (OobsUsersConfig *config); OobsUser* oobs_users_config_get_from_login (OobsUsersConfig *config, const gchar *login); OobsUser* oobs_users_config_get_from_uid (OobsUsersConfig *config, uid_t uid); gboolean oobs_users_config_is_login_used (OobsUsersConfig *config, const gchar *login); gboolean oobs_users_config_is_uid_used (OobsUsersConfig *config, uid_t uid); uid_t oobs_users_config_find_free_uid (OobsUsersConfig *config, uid_t uid_min, uid_t uid_max);
"default-group" OobsGroup* : Read "default-home" gchar* : Read / Write "default-shell" gchar* : Read / Write "encrypted-home" gboolean : Read "maximum-uid" guint : Read / Write "minimum-uid" guint : Read / Write
OobsObject* oobs_users_config_get (void);
Returns the OobsUsersConfig singleton, which represents the system users and their configuration.
Returns : |
the singleton OobsUsersConfig object. |
OobsList* oobs_users_config_get_users (OobsUsersConfig *config);
Returns an OobsList containing objects of type OobsUser.
|
An OobsUsersConfig. |
Returns : |
an OobsList containing the system users. |
OobsResult oobs_users_config_add_user (OobsUsersConfig *config, OobsUser *user);
Add an user to the configuration, immediately committing changes to the system.
On success, user
will be appended to the users list.
|
An OobsUsersConfig. |
|
An OobsUser. |
Returns : |
an OobsResult enum with the error code. |
OobsResult oobs_users_config_delete_user (OobsUsersConfig *config, OobsUser *user);
Delete an user from the configuration, immediately committing changes to the system.
On success, user
will be removed from the users list.
|
An OobsUsersConfig. |
|
An OobsUser. |
Returns : |
an OobsResult enum with the error code. |
uid_t oobs_users_config_get_minimum_users_uid (OobsUsersConfig *config);
Returns the default minimum UID for non-system users.
|
An OobsUsersConfig. |
Returns : |
minimum UID for non-system users. |
void oobs_users_config_set_minimum_users_uid (OobsUsersConfig *config, uid_t uid);
Sets the minimum UID for non-system users.
|
An OobsUsersConfig. |
|
new minimum UID for non-system users. |
uid_t oobs_users_config_get_maximum_users_uid (OobsUsersConfig *config);
Returns the default maximum UID for non-system users.
|
An OobsUsersConfig. |
Returns : |
maximum UID for non-system users. |
void oobs_users_config_set_maximum_users_uid (OobsUsersConfig *config, uid_t uid);
Sets the maximum UID for non-system users.
|
An OobsUsersConfig. |
|
a new maximum UID for non-system users. |
const gchar* oobs_users_config_get_default_shell (OobsUsersConfig *config);
Returns the default shell that will be used for new users.
|
An OobsUsersConfig |
Returns : |
A pointer to the default shell as a string. This string must not be freed, modified or stored. |
void oobs_users_config_set_default_shell (OobsUsersConfig *config, const gchar *shell);
Sets a new default shell for new users, replacing the old one.
|
An OobsUsersConfig |
|
new default shell for new users. |
const gchar* oobs_users_config_get_default_home_dir (OobsUsersConfig *config);
Returns the default home directory prefix for new users. when new users are created a directory with the user login name is created in that prefix.
|
An OobsUsersConfig. |
Returns : |
A pointer to the default home directory prefix as a string. This string must not be freed, modified or stored. |
void oobs_users_config_set_default_home_dir (OobsUsersConfig *config, const gchar *home_dir);
Sets a new home directory prefix used for newly created users, replacing the old one.
|
An OobsUsersConfig. |
|
new default home directory prefix. |
OobsGroup* oobs_users_config_get_default_group (OobsUsersConfig *config);
Returns an OobsGroup defining the default group used for new users.
|
An OobsUsersConfig. |
Returns : |
An OobsGroup, you must not unref this object. |
GList* oobs_users_config_get_available_shells (OobsUsersConfig *config);
Returns a GList containing strings with paths to the available shells.
|
An OobsUsersConfig |
Returns : |
a GList containing strings, you must not free neither this list or its elements. |
gboolean oobs_users_config_get_encrypted_home_support (OobsUsersConfig *config);
Returns whether encrypted home directories are supported by the platform (e.g. using eCryptfs).
|
An OobsUsersConfig |
Returns : |
TRUE if encrypted home dirs are supported, FALSE otherwise.
|
GList* oobs_users_config_get_available_locales (OobsUsersConfig *config);
|
|
Returns : |
OobsUser* oobs_users_config_get_from_login (OobsUsersConfig *config, const gchar *login);
Gets the (first) user whose login is login
. This is a convenience function
to avoid walking manually over the users list.
|
An OobsUsersConfig. |
|
the login name of the wanted user. |
Returns : |
an OobsUser corresponding to the passed login,
or NULL if no such user exists. Don't forget to unref user when you're done.
|
OobsUser* oobs_users_config_get_from_uid (OobsUsersConfig *config, uid_t uid);
Gets the (first) user whose UID is uid
. This is a convenience function
to avoid walking manually over the users list.
|
An OobsUsersConfig. |
|
the UID of the wanted user. |
Returns : |
an OobsUser corresponding to the passed UID,
or NULL if no such user exists. Don't forget to unref user when you're done.
|
gboolean oobs_users_config_is_login_used (OobsUsersConfig *config, const gchar *login);
Check whether login
is already used by an existing user or not. This is
a convenience function to avoid walking manually over the users list.
|
An OobsUsersConfig. |
|
the login name to check. |
Returns : |
TRUE if an user named login already exists, FALSE otherwise.
|
gboolean oobs_users_config_is_uid_used (OobsUsersConfig *config, uid_t uid);
Check whether uid
is already used by an existing user or not. This is
a convenience function to avoid walking manually over the users list.
|
An OobsUsersConfig. |
|
the UID to check. |
Returns : |
TRUE if an user with such an UID already exists, FALSE otherwise.
|
uid_t oobs_users_config_find_free_uid (OobsUsersConfig *config, uid_t uid_min, uid_t uid_max);
Finds an UID that is not used by any user in the list. The returned UID is
the highest used UID in the range plus one if uid_max
is not used.
Else, the first free UID in the range is returned.
If both uid_min
and uid_max
are equal to 0, the default range is used.
|
An OobsUsersConfig. |
|
the minimum wanted UID. |
|
the maximum wanted UID. |
Returns : |
a free UID in the requested range,
or uid_max to indicate wrong use or failure to find a free UID.
|
"default-home"
property "default-home" gchar* : Read / Write
Default home directory for new users.
Default value: NULL
"default-shell"
property "default-shell" gchar* : Read / Write
Default shell for new users.
Default value: NULL
"encrypted-home"
property "encrypted-home" gboolean : Read
Whether encrypted home dirs are supported.
Default value: FALSE
"maximum-uid"
property "maximum-uid" guint : Read / Write
Maximum UID for non-system users.
Allowed values: <= G_MAXLONG
Default value: 2147483647