|
Aegis
4.25.D505
|
#include <user.h>
The user_ty class represents a user (usually, the operating system's idea of a user) an information about that user, and her preferences.
| typedef aegis_shared_ptr<user_ty> user_ty::pointer |
The destructor.
It is not virtual, thou shalt not derived from this class.
| user_ty::user_ty | ( | ) | [private] |
The default constructor.
| user_ty::user_ty | ( | int | uid | ) | [private] |
The constructor.
| uid | The user ID involved. |
| user_ty::user_ty | ( | int | uid, |
| int | gid | ||
| ) | [private] |
The constrctor.
| uid | system user id |
| gid | system group id |
| void user_ty::become_begin | ( | ) |
The become_begin method is used to set the effective uid and gid to be those of this user. In this way, the code can impersonate a variety of users, while still enforcing strict secure semantics.
| void user_ty::become_end | ( | ) |
The become_end method is used to reverse the effects of the become_begin method.
These two methods shall always be used in pairs. This is simplified further if you use the user_ty::become class.
| bool user_ty::check_gid | ( | ) | const |
The check_gid method is used to verify that this user has an acceptable level of privilege.
| bool user_ty::check_uid | ( | ) | const |
The check_uid method is used to verify that this user has an acceptable level of privilege.
| static user_ty::pointer user_ty::create | ( | ) | [static] |
The create class method is used to create new heap instances of users. The user in this case being the user who executeed this program.
| static user_ty::pointer user_ty::create | ( | int | uid | ) | [static] |
The create class method is used to create new heap instances of users. The default group is derived from the password file.
| uid | The user ID involved. |
| static user_ty::pointer user_ty::create | ( | int | uid, |
| int | gid | ||
| ) | [static] |
The create class method is used to create a user structure for the aegis/gonzo.cc file. It has a known uid and gid, and will succeed, even if there are no relvant entries in system tables.
| uid | system user id |
| gid | system group id |
| static user_ty::pointer user_ty::create | ( | const nstring & | login_name | ) | [static] |
The create class method is used to create a user instance from a login name.
The login name is mapped to a uid. The password file is searched from beginning to end, so the cannonical name is the first found in the password file. The cannonical name is used even for user structures created with this function.
| login_name | user's login name |
| static user_ty::pointer user_ty::create_by_directory | ( | const nstring & | path | ) | [static] |
The create_by_directory class method is used to create a user from the ownership of a directory.
| path | The absolute path pf the directory of interest. |
| long user_ty::default_change | ( | project * | pp | ) |
The default_change method is used to find the default change number. It is a fatal error if there isn't one.
| pp | The project of interest. |
The default_development_directory method is used to determine the absolute path of the user's default development directory.
If the user has not explicitly set one, and the project does not have one set, the user's home directory will be returned.
| pp | The project to consult for its default development directory, as wel. |
The default_project method is used to determine the default project of the specified user. It is a fatal error if there is no default project name for the user.
The default_project_directory method is used to determine the absolute path for where to place new projects.
if the user has not explicitly set one, the user's home directory will be returned.
| static void user_ty::delete_file_argument | ( | void(*)(void) | usage | ) | [static] |
The delete_file_argument class method is used to process --keep and --no-keep command line options.
| usage | Exit via this function on error. |
| bool user_ty::delete_file_query | ( | const nstring & | filename, |
| bool | isdir, | ||
| int | default_preference | ||
| ) |
The delete_file_query method is used to determine whether a file should be deleted or not.
| filename | The name of the file to be deleted |
| isdir | whether the file is a directory (true) or a regular file (false). |
| default_preference | If the user gave no preference on the command line, use this instead. 1 -> true, 0 -> false, -1 -> look in .aegisrc |
The diff_preference method is ised to obtain this user's aed preference.
The editor_command method is used to read the user's preferences for editor to use with aegis. Defaults to EDITOR environment variable, or else "ed".
| nstring user_ty::full_name | ( | ) | const |
The full_name method is used to obtain the human readable name of this user, as recorded in the password file.
| static nstring user_ty::full_name | ( | const nstring & | login | ) | [static] |
The full_name class method is used to obtain the full name of a user, given the login name.
| login | The login name of the user |
The get_email_address method is used to read the user's preferences for her email address. Defaults to full name from /etc/passwd, then login name at hostname (not generally useful).
| int user_ty::get_gid | ( | ) | const |
The get_gid method is used to obtain the operating system group ID associated with this user.
| nstring user_ty::get_group_name | ( | ) | const |
The get_group_name method is used to obtain the name of the operating system group attached to this user.
| nstring user_ty::get_home | ( | ) | const |
The get_home method is used to obtain the absolute path of this user's home directory.
| int user_ty::get_uid | ( | ) | const |
The get_uid method is used to obtain the operating system user ID associated with this user.
| void user_ty::lock_sync | ( | ) | [private] |
The lock_sync method is used to flush any out-of-date data caching associated with the user structure.
| bool user_ty::lock_wait | ( | ) |
The lock_wait method may be used if this user wants to wait for locks or not.
| static void user_ty::lock_wait_argument | ( | void(*)(void) | usage | ) | [static] |
The lock_wait_argument class method is used to process --wait and --no-wait command line arguments.
| usage | Exit via this function on error. |
The log_file_preference method may be used to obtain this user's log file preference.
| dflt | If the user has not specified one, this argument is the default to be returned (varies with command). |
| nstring user_ty::name | ( | ) | const |
The name method is used to obtain the login name of this user.
| void user_ty::own_add | ( | project * | pp, |
| long | chanum | ||
| ) |
The user_own_add function is used to add a change to the user's list of owned changes.
| pp | project of the change |
| chanum | the number of the change |
| bool user_ty::own_nth | ( | project * | pp, |
| long | n, | ||
| long & | chanum | ||
| ) |
The user_own_nth function is used to fetch the n'th change owned by a user. The project name is derived from the user structure.
| pp | project of the change |
| n | selector |
| chanum | reference to where to put number of the change |
| void user_ty::own_remove | ( | project * | pp, |
| long | chanum | ||
| ) |
The user_own_remove function is used to remove a change from the user's owned change list.
| pp | project of the change |
| chanum | number of the change. The change is assumed to be unique. |
The pager_command method is used to read the user's preferences for pager to use with aegis. Defaults to PAGER environment variable. If $PAGER is not set then "more" is used.
| bool user_ty::pager_preference | ( | ) |
The pager_preference method is used to obtain this user's pager preference.
| static void user_ty::persevere_argument | ( | void(*)(void) | usage | ) | [static] |
The persevere_argument class method is used to process --presevere and -no-persevere command line arguments.
| usage | Exit via this function on error. |
| bool user_ty::persevere_preference | ( | bool | dflt | ) |
The persevere_preference method is used to determine whether or not aet (and friends) should persevere in the face of errors.
| dflt | The default to use, should the not have set a preference. |
| static void user_ty::pool_add | ( | user_ty::pointer | up | ) | [static, private] |
The pool_add class method is used to add a new user_ty instance to the pool.
| static user_ty::pointer user_ty::pool_find | ( | int | uid | ) | [static, private] |
The pool_find class method is used to look into the pool of user_ty instances to determine wether or not the given UID corresponds to an existing user_ty instance.
This is an O(n) search. It is expected that there will be at most 4, so the slow search isn't a problem - a faster search would have a larger k - making it moot.
| uid | The UID to search for |
| bool user_ty::progress_get | ( | ) |
The progress_get method is used to determine whether or not progress messages should be displayed. It consults the command line settings and also the user's progress attribute. Being in the background is not considered. The --verbose option is not considered. The default is to return false.
Example: attribute = [ { name = "progress-preference"; value = "true"; } ];
| static void user_ty::progress_option_clear | ( | void(*)(void) | usage | ) | [static] |
The progress_option_clear class method is called by command line processing to indicate that a --no-progress command line option has been seen.
| usage | The function to call if a fail via a usage message is required. |
| static void user_ty::progress_option_set | ( | void(*)(void) | usage | ) | [static] |
The progress_option_set class method is called by command line processing to indicate that a --progress command line option has been seen.
| usage | The function to call if a fail via a usage message is required. |
| uconf_relative_filename_preference_ty user_ty::relative_filename_preference | ( | uconf_relative_filename_preference_ty | dflt | ) |
The relative_filename_preference method may be used to obtain this user's preference for whethger or not relative file names on the command line are relative to the development diorectory root, or relative to the current directory.
| dflt | The default to use if the user has not selected on (varies with command). |
| static void user_ty::relative_filename_preference_argument | ( | void(*)(void) | usage | ) | [static] |
The relative_filename_preference_argument class method is used to process --base-relative and --not-base-relative command line options.
| usage | Exit via this function on error. |
| void user_ty::set_gid | ( | int | gid, |
| bool | weak = false |
||
| ) |
The set_gid method is used to set the group ID of this user.
| gid | The group ID to use. |
| weak | true if it is OK that the group doesn't exists, false (default) if it is an error if the group desn't exist. |
| bool user_ty::symlink_pref | ( | bool | proj_files_changed | ) |
The symlink_pref method may be used to obtain this user's symbolic link maintenance preference. Some development directory styles do not have to be maintained.
If your development directory style uses hard links or copies, this method also controls them.
| proj_files_changed | true if any project files have changed recently |
| static void user_ty::symlink_pref_argument | ( | void(*)(void) | usage | ) | [static] |
The symlink_pref_argument is used to process the --symbolic-links and --no-symbolic-links command line options.
| usage | Exit via this function on error. |
The uconf_get method is used to get the uconf data corresponding to the specified user. It is cached. This should be used sparingly, if at all. It is preferable to use one of the above methods if at all possible.
| void user_ty::uconf_write_xml | ( | output::pointer | op | ) |
The uconf_write_xml method may be used to write this user's uconf data out as XML.
| op | Where to write the XML. |
| int user_ty::umask_get | ( | ) | const |
The umask_get method is used to obtain the new file creation permissions mode mask for this user.
| void user_ty::umask_set | ( | int | um | ) |
The umask_set method is used to set the file creation mode mosk.
| um | The new mask. |
| ustate_ty* user_ty::ustate_get | ( | project * | pp | ) | [private] |
The user_ustate_get function is used to fetch the "ustate" file for this user, caching for future reference.
| pp | The project of interest |
| void user_ty::ustate_lock_prepare | ( | ) |
The ustate_lock_prepare method is used to notify the lock manager that a ustate lock will be required.
| void user_ty::ustate_write | ( | ) |
The ustate_write method is used to write any modified ustate file contents back to disk.
The visual_command method is used to read the user's preferences for a visual editor to use with aegis. Defaults to VISUAL environment variable, or else the EDITOR environment variable, or else "vi".
| void user_ty::waiting_for_lock | ( | ) | [private] |
The waiting_for_lock method is used to print a message to inform the user of the progress acquiring the lock.
| static void user_ty::waiting_for_lock | ( | void * | ) | [static, private] |
The waiting_for_lock class method is used to call the waiting_for_lock method.
| bool user_ty::whiteout | ( | int | dflt = -1 | ) |
The whiteout mwthod may be used to determine this user's whiteout file preference.
| dflt | The default the comman wants (true (0) or false (1)) or -1 if the user's .aegisrc file is to be consulted. |
| static void user_ty::whiteout_argument | ( | void(*)(void) | usage | ) | [static] |
The symlink_pref_argument is used to process the --whiteout and --no-whiteout command line options.
| usage | Exit via this function on error. |
int user_ty::group_id [private] |
nstring user_ty::group_name [private] |
nstring user_ty::home [private] |
long user_ty::lock_magic [private] |
nstring user_ty::login_full_name [private] |
nstring user_ty::login_name [private] |
size_t user_ty::pool_nusers [static, private] |
size_t user_ty::pool_nusers_max [static, private] |
pointer* user_ty::pool_user [static, private] |
uconf_ty* user_ty::uconf_data [private] |
nstring user_ty::uconf_path [private] |
int user_ty::umask [private] |
int user_ty::user_id [private] |
ustate_ty* user_ty::ustate_data [private] |
bool user_ty::ustate_is_new [private] |
bool user_ty::ustate_modified [private] |
nstring user_ty::ustate_path [private] |
1.7.6.1