| gumd API Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <gum/common/gum-validate.h> #define GUM_DB_ENTRY_PATTERN #define GUM_NAME_PATTERN gboolean gum_validate_db_secret_entry (const gchar *str,GError **error); gboolean gum_validate_db_string_entry (const gchar *str,GError **error); gboolean gum_validate_db_string_entry_regx (const gchar *str,GError **error); gchar * gum_validate_generate_username (const gchar *str,GError **error); gboolean gum_validate_name (const gchar *name,GError **error);
#define GUM_DB_ENTRY_PATTERN "^[^\x2C\x3A[:cntrl:]]*$"
A macro that defines the string pattern to be acceptable for entries in the user/group database.
#define GUM_NAME_PATTERN "^[A-Za-z_][A-Za-z0-9_.-]*[A-Za-z0-9_.$-]\\?$"
A macro that defines the string pattern to be acceptable for names.
gboolean gum_validate_db_secret_entry (const gchar *str,GError **error);
Validates the string str to be used as secret in the user/group database.
No control chars (0x00-0x1F,0x7F) or colon (':' 0x3A) is allowed.
|
the string to be validated. [transfer none] |
|
the GError to be set in case of error. [transfer none] |
Returns : |
TRUE if validation succeeds, FALSE otherwise. |
gboolean gum_validate_db_string_entry (const gchar *str,GError **error);
Validates the string str to be used in the user/group database. No control
chars (0x00-0x1F,0x7F), comma (',' 0x2c) or colon (':' 0x3A) is allowed.
|
the string to be validated. [transfer none] |
|
the GError to be set in case of error. [transfer none] |
Returns : |
TRUE if validation succeeds, FALSE otherwise. |
gboolean gum_validate_db_string_entry_regx (const gchar *str,GError **error);
Validates the string str against the GUM_DB_ENTRY_PATTERN pattern using
regular expressions.
|
the string to be validated. [transfer none] |
|
the GError to be set in case of error. [transfer none] |
Returns : |
TRUE if validation succeeds, FALSE otherwise. |
gchar * gum_validate_generate_username (const gchar *str,GError **error);
Generate username based on the string str and then validate the generated
user name against GUM_NAME_PATTERN pattern.
|
the string to be validated. [transfer none] |
|
the GError to be set in case of error. [transfer none] |
Returns : |
string if successful, NULL otherwise. [transfer full] |
gboolean gum_validate_name (const gchar *name,GError **error);
Validates the name against the GUM_NAME_PATTERN pattern.
|
the name string to be validated. [transfer none] |
|
the GError to be set in case of error. [transfer none] |
Returns : |
TRUE if validation succeeds, FALSE otherwise. |