Gum User Types

Gum User Types — Utility functions for user types

Functions

Types and Values

Object Hierarchy


Includes

#include <gum/common/gum-user-types.h>

Description

User type conversion/validation functions

Functions

GUM_USERTYPE_MAX_VALUE

#define GUM_USERTYPE_MAX_VALUE   (0x1 << (GUM_USERTYPE_COUNT-1))

Defines the maximum value of the user type in GumUserType.


gum_user_type_to_string ()

const gchar *
gum_user_type_to_string (GumUserType type);

Converts the user type enum to string

Parameters

type

the user type enum to convert

 

Returns

usertype if conversion succeeds, NULL otherwise.

[transfer none]


gum_user_type_from_string ()

GumUserType
gum_user_type_from_string (const gchar *type);

Validates and then converts it to the correct user type

Parameters

type

the user type string to convert.

[transfer none]

Returns

GumUserType if conversion succeeds, GUM_USERTYPE_NONE otherwise.


gum_user_type_to_strv ()

gchar **
gum_user_type_to_strv (guint16 types);

Converts enumerated GumUserType types into an array of string of user type.

Parameters

types

the type(s) of the user OR'd as per defined as GumUserType e.g. GUM_USERTYPE_SYSTEM | GUM_USERTYPE_NORMAL

 

Returns

(transfer full) if successful returns a string, NULL otherwise.


gum_user_type_from_strv ()

guint16
gum_user_type_from_strv (const gchar *const *types);

Converts the string consisting of types to a single uint16 by ORing each type as GumUserType e.g. if string array contains guest and normal, then result would be GUM_USERTYPE_GUEST | GUM_USERTYPE_NORMAL

Parameters

types

an array of string of user types.

[transfer none]

Returns

if successful returns the converted types, GUM_USERTYPE_NONE otherwise.

Types and Values

GUM_USERTYPE_COUNT

#define GUM_USERTYPE_COUNT   5

Defines total number of types of the users.


enum GumUserType

This enumeration lists users types.

Members

GUM_USERTYPE_NONE

user type not defined/set/invalid

 

GUM_USERTYPE_SYSTEM

no home directory will be created for system user. System user is not able to use login/logout functionality as its primary usage is limited to system daemons. Uid will be chosen between GUM_CONFIG_GENERAL_SYS_UID_MIN and GUM_CONFIG_GENERAL_SYS_UID_MAX

 

GUM_USERTYPE_ADMIN

admin user is similar to normal user with the addition that it will be assigned to admin user groups at the time of account creation. Uid will be chosen between GUM_CONFIG_GENERAL_UID_MIN and GUM_CONFIG_GENERAL_UID_MAX

 

GUM_USERTYPE_GUEST

guest user does not need secret/password to login. Guest user home directory is created with login and cleaned up/destroyed when user logs out. Uid will be chosen between GUM_CONFIG_GENERAL_UID_MIN and GUM_CONFIG_GENERAL_UID_MAX

 

GUM_USERTYPE_NORMAL

normal user with home directory created based on prefix GUM_CONFIG_GENERAL_HOME_DIR_PREF. Contents of GUM_CONFIG_GENERAL_SKEL_DIR are copied to the home directory. Uid will be chosen between GUM_CONFIG_GENERAL_UID_MIN and GUM_CONFIG_GENERAL_UID_MAX