Next Previous Contents

10. List of function not covered

CRONTAB::CRONTAB()

        PUBLIC CRONTAB::CRONTAB(
                const char *_user)
        

CRONTAB::addcmd()

        PUBLIC int CRONTAB::addcmd(
                const char *cmd,
                const char *minutes,
                const char *hours,
                const char *dmonths,
                const char *dweeks,
                const char *months)
        

CRONTAB::delcmd()

        PUBLIC int CRONTAB::delcmd(
                const char *cmd)
        

CRONTAB::edit()

        PUBLIC int CRONTAB::edit(
                const char *suggest[][2])
        

CRONTAB::getitem()

        PUBLIC CRON_ENTRY *CRONTAB::getitem(
                int no)
        

CRONTAB::write()

        PUBLIC int CRONTAB::write(
                void)
        

CRON_ENTRY::CRON_ENTRY()

        PUBLIC CRON_ENTRY::CRON_ENTRY(
                void)
        

CRON_ENTRY::edit()

Edit one entry Return -1 if abort, 0 if accept, 1 if delete

        PUBLIC int CRON_ENTRY::edit(
                const char *suggest[][2])
        

CRON_ENTRY::is_comment()

Return != 0 if this entry is only a comment

        PUBLIC int CRON_ENTRY::is_comment(
                void)
        

CRON_ENTRY::parse()

        PRIVATE void CRON_ENTRY::parse(
                const char *buf)
        

CRON_ENTRY::write()

        PUBLIC void CRON_ENTRY::write(
                FILE *fout)
        

GROUP::GROUP()

        PUBLIC GROUP::GROUP(
                const char *_name,
                const char *_passwd,
                int _gid,
                char **members)
        

GROUP::addmember()

Add one user as a member of a group

        PUBLIC void GROUP::addmember(
                const char *user)
        

GROUP::check()

Check if a group is correctly configured. Return -1 if not.

        PRIVATE int GROUP::check(
                USERS&users,
                GROUPS&groups,
                GROUP *realone)
        

GROUP::delmember()

Remove one user as a member of a group (if there) Return != 0 if the user was a member of that group.

        PUBLIC int GROUP::delmember(
                const char *user)
        

GROUP::edit()

Edit the specification of a user. Return -1 if the user escape without accepting the changes. Return 0 if the record was changed Return 1 if the record must be deleted

        PUBLIC int GROUP::edit(
                USERS&users,
                GROUPS&groups)
        

GROUP::getgid()

        PUBLIC int GROUP::getgid(
                void)
        

GROUP::getname()

        PUBLIC const char *GROUP::getname(
                void)
        

GROUP::init()

        PRIVATE void GROUP::init(
                const char *_name,
                const char *_passwd,
                int _gid)
        

GROUP::is_member()

Return true is a user is a member of this group (alternate group)

        PUBLIC bool GROUP::is_member(
                const char *user)

GROUP::settbmem()

        PRIVATE void GROUP::settbmem(
                const SSTRINGS&members)
        

GROUP::write()

Write one record of /etc/passwd

        PUBLIC void GROUP::write(
                FILE_CFG *fout)
        

GROUP:: GROUP()

        PUBLIC GROUP::~GROUP(
                void)
        

GROUPS::GROUPS()

This object will contain a copy (only pointers). It is used as a temporary holder for the normal object, allowing doing some sort.

        PRIVATE GROUPS::GROUPS(
                GROUPS *groups)
        

GROUPS::create()

        PUBLIC int GROUPS::create(
                const char *name,
                int hint)       // Try to create the group using this GID
                // Allocate another one if this fail
        

GROUPS::delmember()

Remove one user as a member of a all groups (if there) This is called when a user account is deleted. Return != 0 if one group was modified (The user was member of at least one group).

        PUBLIC int GROUPS::delmember(
                const char *user)
        

GROUPS::edit()

General edition (addition/deletion/correction) of /etc/group

        PUBLIC int GROUPS::edit(
                void)
        

GROUPS::getalt()

Collect the alternate group for a user account They are simply append to alt with a space between them

        PUBLIC void GROUPS::getalt(
                const char *user,
                SSTRING&alt)
        

GROUPS::getdefault()

Return the name of the group to use when creating new user (default)

        PUBLIC const char *GROUPS::getdefault(
                void) const
        
        

GROUPS::getfromgid()

Get one GROUP specification of the table or NULL from his GID

        PUBLIC GROUP *GROUPS::getfromgid(
                int gid) const
        
        

GROUPS::getgid()

Return the gid of a group from its name. Return -1 if there is no group with this name.

        PUBLIC int GROUPS::getgid(
                const char *name) const
        
        

GROUPS::getitem()

Return the GROUP specification from its name. Return NULL if not found.

        PUBLIC GROUP *GROUPS::getitem(
                const char *name) const
        
        

GROUPS::getnew()

Allocate an unused group ID over 500

        PUBLIC int GROUPS::getnew(
                void)
        

GROUPS::load_special()

        PUBLIC void GROUPS::load_special(
                void)
        

GROUPS::remove_del()

        PUBLIC void GROUPS::remove_del(
                GROUP *grp)
        

GROUPS::setalt()

Register a user in several groups Return -1 if one group does not exist

        PUBLIC int GROUPS::setalt(
                const char *user,
                const char *groups,
                char delim,     // Separator in groups, either comma or a space
                bool test)      // Only check if all groups exist
        

GROUPS::setcombo()

Sets the help list of a FIELD_COMBO with all the groups

        PUBLIC void GROUPS::setcombo(
                FIELD_COMBO *grpl)
        

GROUPS::sortbyid()

Sort the array of group by name

        PUBLIC void GROUPS::sortbyid(
                void)
        

GROUPS::sortbyname()

Sort the array of group by name

        PUBLIC void GROUPS::sortbyname(
                void)
        

GROUPS::write()

Write the /etc/group file with proper locking

        PUBLIC int GROUPS::write(
                PRIVILEGE *priv)
        

GROUPS:: GROUPS()

        PUBLIC GROUPS::~GROUPS(
                void)
        

PASSWD_VALID::PASSWD_VALID()

        PUBLIC PASSWD_VALID::PASSWD_VALID(
                void)
        

PASSWD_VALID::edit()

Edit the password setting policies

        PUBLIC void PASSWD_VALID::edit(
                void)

PASSWD_VALID::write()

        PUBLIC void PASSWD_VALID::write(
                void)
        

PRIVILEGE::PRIVILEGE()

        PUBLIC PRIVILEGE::PRIVILEGE(
                const char *_id,        // Key to store the privilege
                TRANS_NOTLOAD *_title,  // Title shown in the user account dialog
                TRANS_NOTLOAD *_section)        // Title of the section. All PRIVILEGE with
                // the same section title will be shown
                // together and the section title will be used
                // as a section separator in the dialog
        

PRIVILEGE::getdata()

A PRIVILEGE_DATA object to edit and control that kind of privilege. line contain raw info used to initialise the new object.

        PUBLIC VIRTUAL PRIVILEGE_DATA *PRIVILEGE::getdata(
                const char *user)
        

PRIVILEGE::getsection()

Return the section title of the privilege

        PUBLIC const char *PRIVILEGE::getsection(
                void)
        

PRIVILEGE::gettitle()

Return the title of the privilege

        PUBLIC const char *PRIVILEGE::gettitle(
                void)
        

PRIVILEGE::savedata()

Save a PRIVILEGE_DATA object. Return -1 if any error

        PUBLIC VIRTUAL int PRIVILEGE::savedata(
                const char *user,
                PRIVILEGE_DATA *data)
        

PRIVILEGE:: PRIVILEGE()

        PUBLIC PRIVILEGE::~PRIVILEGE(
                void)
        

PRIVILEGES::PRIVILEGES()

        PUBLIC PRIVILEGES::PRIVILEGES(
                void)
        

PRIVILEGES::getitem()

        PUBLIC PRIVILEGE *PRIVILEGES::getitem(
                int no)
        

PRIVILEGE_DATA::has_priv()

Return != 0 if this user has the privilege

        PUBLIC int PRIVILEGE_DATA::has_priv(
                void)
        

PRIVILEGE_DATA::mustident()

Return != 0 if the user must identify itself (provide a password)

        PUBLIC int PRIVILEGE_DATA::mustident(
                void)
        

PRIVILEGE_DATAS::getitem()

        PUBLIC PRIVILEGE_DATA *PRIVILEGE_DATAS::getitem(
                int no)
        

PRIVILEGE_DATA_FEATURE::PRIVILEGE_DATA_FEATURE()

        PUBLIC PRIVILEGE_DATA_FEATURE::PRIVILEGE_DATA_FEATURE(
                const char *line)
        

PRIVILEGE_DATA_FEATURE::setdialog()

        PUBLIC void PRIVILEGE_DATA_FEATURE::setdialog(
                const char *title,
                DIALOG&dia)
        

PRIVILEGE_DATA_SIMPLE::PRIVILEGE_DATA_SIMPLE()

        PUBLIC PRIVILEGE_DATA_SIMPLE::PRIVILEGE_DATA_SIMPLE(
                void)
        

PRIVILEGE_DATA_SIMPLE::format_ascii()

format in ascii so the information may be stored in /etc/conf.linuxconf

        PUBLIC int PRIVILEGE_DATA_SIMPLE::format_ascii(
                char *line)
        

PRIVILEGE_DATA_SIMPLE::setdialog()

        PUBLIC void PRIVILEGE_DATA_SIMPLE::setdialog(
                const char *title,
                DIALOG&dia)
        

PRIVILEGE_DATA_SIMPLE::validate()

Return 0 if the privilege is not granted to this users. Return 1 if the privilege is granted, but user must authenticate Return 2 if the privilege is granted, no question ask!

        PUBLIC int PRIVILEGE_DATA_SIMPLE::validate(
                void)
        

PRIVILEGE_DECLARATOR::PRIVILEGE_DECLARATOR()

        PUBLIC PRIVILEGE_DECLARATOR::PRIVILEGE_DECLARATOR(
                void(*_fct)())
        

PRIVI_FEATURE::PRIVI_FEATURE()

        PUBLIC PRIVI_FEATURE::PRIVI_FEATURE(
                const char *_id,        // Key to store the privilege
                TRANS_NOTLOAD *_title,  // Title shows in the user account dialog
                TRANS_NOTLOAD *_section)
        

PRIVI_FEATURE::getdata()

A PRIVILEGE_DATA object to edit and control that kind of privilege. line contain raw info used to initialise the new object.

        PUBLIC PRIVILEGE_DATA *PRIVI_FEATURE::getdata(
                const char *user)
        

REGISTER_PRIVI_HELP::REGISTER_PRIVI_HELP()

The purpose of this object is to associate a help file and a title to the user account dialog. The help file is generally related to privileges. The idea is that the various parts which define privilege do not participate directly in the user account dialog yet, the privilege they define end up there. Using this mecanism, they can document the privileges in a help file and make it visible in the user account dialog. This is done simply by declaring a static object of type REGISTER_PRIVI_HELP like this: # static HELP_FILE help ("module","subject"); static REGISTER_PRIVI_HELP p(help,P_MSG_U(T_THISHELP,"bla bla bla")); #

        PUBLIC REGISTER_PRIVI_HELP::REGISTER_PRIVI_HELP(
                HELP_FILE&_help,
                TRANS_NOTLOAD *_title)
        

SHADOW::SHADOW()

Used when reading the /etc/shadow file

        PUBLIC SHADOW::SHADOW(
                const char *line)
        

SHADOW::getdisable()

Return the expiration date of the account in days since 1970

        PUBLIC int SHADOW::getdisable(
                void) const
        
        

SHADOW::getexpire()

Return the number of days an account may be used after the password has expired.

        PUBLIC int SHADOW::getexpire(
                void) const
        
        

SHADOW::getmaychange()

Get the minimum number of days before a password may be changed (again)

        PUBLIC int SHADOW::getmaychange(
                void) const
        
        

SHADOW::getmustchange()

Get the maximum number of days after which a password must be changed

        PUBLIC int SHADOW::getmustchange(
                void) const
        
        

SHADOW::getpwd()

Return the crypt password field

        PUBLIC const char *SHADOW::getpwd(
                void) const
        
        

SHADOW::getwarn()

Get the number of days before a password must be change, a warning should be issued

        PUBLIC int SHADOW::getwarn(
                void) const
        
        

SHADOW::initdef()

        PRIVATE void SHADOW::initdef(
                void)
        

SHADOW::setdialog()

Setup the part of the dialog for shadow default policies.

        PUBLIC void SHADOW::setdialog(
                DIALOG&dia)
        

SHADOW::setname()

        PUBLIC void SHADOW::setname(
                const char *_name)
        

SHADOW::setpasswd()

        PUBLIC void SHADOW::setpasswd(
                const char *_pass)
        

SHADOW::write()

Write one record of /etc/passwd

        PUBLIC void SHADOW::write(
                FILE_CFG *fout)
        

SHADOW::writedef()

Save the default setting for shadow policies.

        PUBLIC int SHADOW::writedef(
                void)
        

SHADOWS::SHADOWS()

        PUBLIC SHADOWS::SHADOWS(
                void)
        

SHADOWS::getitem()

Get one SHADOW specification of the table or NULL from his login name

        PUBLIC SHADOW *SHADOWS::getitem(
                const char *name)
        

SHADOWS::readusers()

        PRIVATE void SHADOWS::readusers(
                void)
        

SHADOWS::reload()

Forget and reload the shadow information from the shadow file

        PUBLIC void SHADOWS::reload(
                void)
        

SHADOWS::write()

        PUBLIC int SHADOWS::write(
                PRIVILEGE *priv)
        

USER::USER()

        PUBLIC USER::USER(
                struct passwd *p)
        

USER::check()

Check if a user is correctly configured. Return -1 if not.

        PRIVATE int USER::check(
                USERS&users,
                GROUPS&groups)
        

USER::checkhome()

Check if the home of the user do exist Return -1 : No home directory specified ENOENT : path does not exist. ENOTDIR : path do exist, but is not a directory. EPERM : path do exist but permissions are wrong 0 : all is ok.

        PUBLIC int USER::checkhome(
                SSTRING *status,        // Will contain an explanation of the problem
                // if any (may be NULL)
                const char *group)      // Main group of the user
        

USER::deldialog()

Get confirmation about the delete operation

        PRIVATE bool USER::deldialog(
                USER_DELOPER&deloper)
        

USER::edit()

Edit the specification of a user. Return -1 if the user escape without accepting the changes. Return 0 if the user accepted the change Return 1 if the user wish to delete this record.

        PUBLIC int USER::edit(
                USERS&users,
                GROUPS&groups,
                bool is_new,
                PRIVILEGE *priv,        // Privilege required to manage those accounts
                // or NULL if only root can do this
                unsigned may_edit,      // Control which field may be edited (USRACCT_EDIT____
                // it is a bitmap
                QUOTA_EDIT&qedit,
                USERACCT_COMNGS&comngs,
                USER_DELOPER&deloper,       // Operation to do on delete
                const char *domain)
        

USER::edithispass()

Edit the password of the current user. Ask for his current password to allow him to continue.

        PUBLIC int USER::edithispass(
                SHADOW *shadow,
                bool may_override,
                const char *domain)
        

USER::edithispass_notty()

non tty oriented passwd changing facility copy the functionnality of the old passwd program.

        PUBLIC int USER::edithispass_notty(
                SHADOW *shadow,
                const char *domain)

USER::editpass()

Edit(set) the password of a user. Return -1 if the user escape without accepting the changes. If the user enter the password correctly and accept it, the object USER is updated with the crypted version.

        PUBLIC int USER::editpass(
                SHADOW *shadow,
                bool confirm,
                bool may_override,      // May use the override function for the
                // password handling (for main domain generally)
                const char *domain)
        

USER::getaltgrs()

Return the list of supplemental groups (in ASCII) This is only valid after an edit

        PUBLIC const char *USER::getaltgrs(
                void) const
        
        

USER::getcateg()

Return a TUSER_xxx value to identify the type of users

        PUBLIC int USER::getcateg(
                void) const
        
        

USER::getgecos()

Return the long informative name of the user.

        PUBLIC const char *USER::getgecos(
                void) const
        
        

USER::getgecos_esc()

Put in buf a fully escaped gecos field usable as an argument to a shell script

        PUBLIC void USER::getgecos_esc(
                char *buf,
                int size)
        

USER::getgid()

Return the User GID of the user.

        PUBLIC int USER::getgid(
                void) const
        
        

USER::gethome()

Return the home directory field

        PUBLIC const char *USER::gethome(
                void) const
        
        

USER::getname()

Return the login name of the user.

        PUBLIC const char *USER::getname(
                void) const
        
        

USER::getoldname()

Return the original login name of the user.

        PUBLIC const char *USER::getoldname(
                void) const
        
        

USER::getpwd()

Return the crypt password field

        PUBLIC const char *USER::getpwd(
                void) const
        
        

USER::getshell()

Return the shell (path) of the user. If the user has no explicit shell, return the default.

        PUBLIC const char *USER::getshell(
                void) const
        
        

USER::getuid()

Return the User ID of the user.

        PUBLIC int USER::getuid(
                void) const
        
        

USER::init()

        PRIVATE void USER::init(
                const char *_name,
                const char *_passwd,
                int _uid,
                int _gid,
                const char *_gecos,
                const char *_dir,
                const char *_shell)
        

USER::is_admin()

Return true if this user account is a special admin account unrelated to any user.

        PUBLIC bool USER::is_admin(
                void) const
        
        

USER::is_like()

Find out if a user account is of the same category than another one. If other == NULL, it is assumed to be a normal ordinary user.

        PUBLIC bool USER::is_like(
                const USER *other) const
        
        

USER::is_locked()

Return true if the user account is locked (or has expired)

        PUBLIC bool USER::is_locked(
                SHADOW *shadow)
        

USER::is_logged()

Tell if the user is currently logged

        PUBLIC bool USER::is_logged(
                void)

USER::is_special()

Return != 0 if this user account is a special non user account generally intended for machine to machine connection like uucp.

        PUBLIC bool USER::is_special(
                void) const
        
        

USER::pass_maychange()

Return != 0 if the password may be changed by the user. Produce several error message if it can't.

        PUBLIC int USER::pass_maychange(
                SHADOW *shadow)
        

USER::passwd_locked()

Return 0 if the user is allowed to change his password. Return -1 if the password is locked (only the admin is allowed to change it). Return the number of days before the user will be allowed to change his password.

        PUBLIC int USER::passwd_locked(
                SHADOW *shadow)
        

USER::setdefhome()

Set the home of the user to the default

        PUBLIC void USER::setdefhome(
                USERS&users,
                const char *group)
        

USER::setgecos()

Set the gecos field of the new user

        PUBLIC void USER::setgecos(
                const char *_gecos)
        

USER::sethome()

Create/update the user home directory. Return -1 if any error.

        PUBLIC int USER::sethome(
                PRIVILEGE *priv,
                const char *group,
                bool do_recur,
                USERS&users)
        

USER::setlike()

Set the default information of an account from another.

        PUBLIC void USER::setlike(
                const USER *other)
        

USER::setname()

Set the name of the new user

        PUBLIC void USER::setname(
                const char *_name)
        

USER::statuschanged()

Return true is the status of the user have changed during the edit active will contains the status of the user (enabled or not).

        PUBLIC bool USER::statuschanged(
                bool&active)
        

USER::update_passwd()

Update the passwd field with a new password and manage SHADOW

        PUBLIC void USER::update_passwd(
                const char *newp,       // Maybe NULL if we only want to lock the account
                SHADOW *shadow,
                bool is_lock,
                const char *domain)     // In which domain are we working
        

USER::write()

Write one record of /etc/passwd

        PUBLIC void USER::write(
                FILE_CFG *fout)
        

USER:: USER()

        PUBLIC USER::~USER(
                void)
        

USERACCT_COMNG::USERACCT_COMNG()

        PUBLIC USERACCT_COMNG::USERACCT_COMNG(
                DICTIONARY&_dict)
        

USERACCT_COMNG::deluser()

The user account has been deleted, so we may want to do some cleanup in out own structures. Return -1 if this account can't be deleted

        PUBLIC VIRTUAL int USERACCT_COMNG::deluser(
                PRIVILEGE *)
        

USERACCT_COMNG::save()

Save the content of the dialog since the user has commited the changes.

        PUBLIC VIRTUAL int USERACCT_COMNG::save(
                PRIVILEGE *)
        

USERACCT_COMNG::setupdia()

Define new field in the dialog

        PUBLIC VIRTUAL void USERACCT_COMNG::setupdia(
                DIALOG&dia)
        

USERACCT_COMNG::validate()

Validate the various fields. Return -1 if any error.

        PUBLIC VIRTUAL int USERACCT_COMNG::validate(
                M_DIALOG&,  // dia
                int &)      // nof: Will point to the line with the error
        

USERACCT_COMNGS::deluser()

        PUBLIC void USERACCT_COMNGS::deluser(
                PRIVILEGE *priv)
        

USERACCT_COMNGS::get_bool()

        PUBLIC bool USERACCT_COMNGS::get_bool(
                const char *var) const
        

USERACCT_COMNGS::get_int()

        PUBLIC int USERACCT_COMNGS::get_int(
                const char *var) const
        
        

USERACCT_COMNGS::get_obj()

        PUBLIC void *USERACCT_COMNGS::get_obj(
                const char *var) const
        
        

USERACCT_COMNGS::get_str()

        PUBLIC const char *USERACCT_COMNGS::get_str(
                const char *var) const
        
        

USERACCT_COMNGS::getall()

Get all the USER account co-manager from the modules. They are placed in the table cos

        PUBLIC void USERACCT_COMNGS::getall(
                const char *key)
        

USERACCT_COMNGS::getitem()

        PUBLIC USERACCT_COMNG *USERACCT_COMNGS::getitem(
                int no) const
        
        

USERACCT_COMNGS::save()

        PUBLIC void USERACCT_COMNGS::save(
                PRIVILEGE *priv)
        

USERACCT_COMNGS::set_bool()

Add/redefine a boolean value in the dictionary get_bool() must be used to retrieve it.

        PUBLIC void USERACCT_COMNGS::set_bool(
                const char *var,
                bool val)
        

USERACCT_COMNGS::set_int()

Add/redefine a numerical value in the dictionary get_int() must be used to retrieve it.

        PUBLIC void USERACCT_COMNGS::set_int(
                const char *var,
                int val)
        

USERACCT_COMNGS::set_obj()

Add/redefine a pointer to an object get_obj() must be used to retrieve it.

        PUBLIC void USERACCT_COMNGS::set_obj(
                const char *var,
                void *obj)
        

USERACCT_COMNGS::set_str()

Add/redefine a string value in the dictionary get_str() must be used to retrieve it.

        PUBLIC void USERACCT_COMNGS::set_str(
                const char *var,
                const char *val)
        

USERACCT_COMNGS::setupdia()

        PUBLIC void USERACCT_COMNGS::setupdia(
                M_DIALOG&dia)
        

USERACCT_COMNGS::validate()

        PUBLIC int USERACCT_COMNGS::validate(
                M_DIALOG&dia,
                int &nof)
        

USERCONF_HELP_FILE::USERCONF_HELP_FILE()

        PUBLIC USERCONF_HELP_FILE::USERCONF_HELP_FILE(
                const char *fname)

USERPRIVI_COMNG::USERPRIVI_COMNG()

        PUBLIC USERPRIVI_COMNG::USERPRIVI_COMNG(
                DICTIONARY&_dict)
        

USERPRIVI_COMNG::deluser()

        PUBLIC int USERPRIVI_COMNG::deluser(
                PRIVILEGE *)
        

USERPRIVI_COMNG::save()

        PUBLIC int USERPRIVI_COMNG::save(
                PRIVILEGE *)
        

USERPRIVI_COMNG::setupdia()

        PUBLIC void USERPRIVI_COMNG::setupdia(
                DIALOG&dia)
        

USERPRIVI_COMNG::validate()

        PUBLIC int USERPRIVI_COMNG::validate(
                DIALOG&,
                int &)
        

USERS::USERS()

        PUBLIC USERS::USERS(
                void)
        

USERS::addbatch()

Add a user account, no question asked

        PUBLIC int USERS::addbatch(
                const char *id,
                const char *group,
                const char *name,
                const char *shell,
                bool locked)    // This account will be created locked
        

USERS::addone()

Add one new user Return -1 if the user was not added.

        PUBLIC int USERS::addone(
                USER *special,
                const char *name,       // Proposed login name
                const char *fullname,   // gecos field suggested
                PRIVILEGE *priv,        // Privilege required to manage those accounts
                // or NULL if only root can do this
                unsigned may_edit)      // Which field may be edited
        

USERS::addshadow()

        PUBLIC void USERS::addshadow(
                SHADOW *shadow)
        

USERS::delbatch()

Delete a user account, no question asked

        PUBLIC int USERS::delbatch(
                const char *id,
                USER_DELOPER oper)
        

USERS::docreate()

        PRIVATE int USERS::docreate(
                USER *usr,
                PRIVILEGE *priv,
                const char *group)
        

USERS::dodel()

        PUBLIC int USERS::dodel(
                USER *usr,
                USER_DELOPER oper,
                GROUPS&groups,
                PRIVILEGE *priv)
        

USERS::edit()

General edition (addition/deletion/correction) of /etc/passwd

        PUBLIC int USERS::edit(
                USER *special,  // Template for user creation
                // and selection.
                PRIVILEGE *priv,        // Privilege required to manage those accounts
                // or NULL if only root can do this
                unsigned may_edit)
        

USERS::editone()

Edit/Commit a single account This is where we will call the modules one day so that they create the various objects (like the QUOTA_EDIT) which participate to the user account dialog

        PUBLIC int USERS::editone(
                USER *usr,
                bool is_new,
                PRIVILEGE *priv,        // Privilege required to manage those accounts
                // or NULL if only root can do this
                unsigned may_edit)      // Which field may be edited
        

USERS::editone_precut()

Edit/Commit a single account This is where we will call the modules one day so that they create the various objects (like the QUOTA_EDIT) which participate to the user account dialog

        PRIVATE int USERS::editone_precut(
                USER *usr,
                bool is_new,
                PRIVILEGE *priv,        // Privilege required to manage those accounts
                // or NULL if only root can do this
                unsigned may_edit)      // Which fields may be edited
        

USERS::getdomain()

The the domain we are editing (/ for the main domain)

        PUBLIC const char *USERS::getdomain(
                void) const
        
        

USERS::getfromuid()

Get one USER specification of the table or NULL from his UID

        PUBLIC USER *USERS::getfromuid(
                int uid)
        

USERS::getitem()

Get one USER specification of the table or NULL

        PUBLIC USER *USERS::getitem(
                int no)
        

USERS::getnewuid()

Get one unused User ID.

        PUBLIC int USERS::getnewuid(
                void)
        

USERS::getroot()

Return the root of the user base (root of the domain)

        PUBLIC const char *USERS::getroot(
                void) const
        
        

USERS::getshadow()

Get one SHADOW specification of the table or NULL from his login name

        PUBLIC SHADOW *USERS::getshadow(
                USER *usr)
        

USERS::getstdhome()

Return the recommend standard HOME base directory for users.

        PUBLIC const char *USERS::getstdhome(
                void) const
        
        

USERS::has_add_override()

Return true if the distribution dependant mechanism is used to create user accounts

        PUBLIC bool USERS::has_add_override(
                void)
        

USERS::has_shadow()

Does this USERS list has shadow password support

        PUBLIC int USERS::has_shadow(
                void) const
        
        

USERS::may_override()

Check if distribution dependant methode may be used. They can't be used on virtual email domain and they can't be used in administration trees. Once these "linuxconf specifics" become widespread, this may change

        PUBLIC bool USERS::may_override(
                void)
        

USERS::override()

Use a distribution dependant method to update the user account database if available

        PRIVATE int USERS::override(
                PRIVILEGE *priv,
                USER *usr,
                int(*fct)(USER *, SHADOW *))
        

USERS::override_add()

Use a distribution dependant method to create a user account database if available

        PRIVATE int USERS::override_add(
                PRIVILEGE *priv,
                USER *usr,
                const char *group)
        

USERS::readusers()

        PRIVATE void USERS::readusers(
                void)
        

USERS::reload()

Forget the current users and reload from file This is used after an override function has been called since it probably have modified the configuration files

        PRIVATE void USERS::reload(
                void)
        

USERS::remove_del()

        PUBLIC void USERS::remove_del(
                USER *usr)
        

USERS::runcmd()

        PRIVATE int USERS::runcmd(
                const char *cmd,
                USER *usr,
                const char *group)
        

USERS::runcreatecmd()

Run a user supplied post creation command

        PROTECTED int USERS::runcreatecmd(
                USER *usr,
                const char *group)
        

USERS::rundeletecmd()

Run a user supplied pre deletion command

        PROTECTED int USERS::rundeletecmd(
                USER *usr,
                const char *group)
        

USERS::select()

Select one user from the list. May return NULL if no valid selection was done (escape). See code.

        PUBLIC USER *USERS::select(
                USER *like,     // Used to select which user to pick.
                // the function USER::islike() is called for
                // each.
                int may_add,    // Set the delete and add button
                MENU_STATUS&code,
                DIALOG_RECORDS&dia,
                int &choice,        // Will contain the selection. Not so useful
                // but help for the reentrancy of the list
                // (It reedit on the last item selected).
                struct USRACC_FILTER&filter)
        

USERS::select_sorted()

Select one user from the list. May return NULL if no valid selection was done (escape). See code.

        PRIVATE USER *USERS::select_sorted(
                USER *like,     // Used to select which user to pick.
                // the function USER::islike() is called for
                // each.
                int may_add,    // Set the delete and add button
                MENU_STATUS&code,
                DIALOG_RECORDS&dia,
                int &choice,        // Will contain the selection. Not so useful
                // but help for the reentrancy of the list
                // (It reedit on the last item selected).
                struct USRACC_FILTER&filter)
        

USERS::setmaxusers()

Set the maximum users in this domain. 0 means no limit.

        PUBLIC void USERS::setmaxusers(
                int mx)
        

USERS::setselectprefix()

        PRIVATE MENU_STATUS USERS::setselectprefix(
                struct USRACC_FILTER&filter,
                const USER *like,
                bool may_add)
        

USERS::sortbygid()

Sort the array of group by gid, and name

        PUBLIC void USERS::sortbygid(
                void)
        

USERS::sortbyname()

Sort the array of group by name

        PUBLIC void USERS::sortbyname(
                void)
        

USERS::write()

Write the /etc/passwd file with proper locking

        PUBLIC int USERS::write(
                PRIVILEGE *priv)
        

USERS::writeif()

Write the user accounts only if override maintenance function are not in place, since these function do the modification themselves.

        PUBLIC int USERS::writeif(
                PRIVILEGE *priv)
        

USERS:: USERS()

        PUBLIC USERS::~USERS(
                void)
        

cron_addcmd()

Add one command to the cron of a user If the command is already there, it is kept unchanged. This means that the provided schedule is only a hint used when the command is missing from this user cron.

        int cron_addcmd(
                const char *user,
                const char *cmd,
                const char *minutes,
                const char *hour,
                const char *dmonths,
                const char *dweeks,
                const char *months)
        

cron_delcmd()

        int cron_delcmd(
                const char *user,
                const char *cmd)

cron_edit()

Edit the crontab of one user

        void cron_edit(
                const char *user,
                const char *suggest[][2])       // Suggest command and explanation
                // terminate by NULL entry
        

cron_install()

Execute the crontab command for a specific user

        int cron_install(
                const char *user,
                const char *options)
        

cron_isempty()

Return != 0 if this user has no crontab

        int cron_isempty(
                const char *user)
        

group_getcreate()

Get the ID of a group. Create it if it does not exist. Return -1 if it was not created.

        int group_getcreate(
                const char *name,
                const char *reason)
        

group_getcreateperm()

Return the creation permission bits for the home directory of members of this group

        int group_getcreateperm(
                const char *gname)
        

group_gethomebase()

Return the base directory where home must be created for a group member. Return NULL if not defined for this group

        const char *group_gethomebase(
                const char *gname)
        

group_homeneeded()

Return true if a home directory is needed for members of this group

        bool group_homeneeded(
                const char *gname)
        

groups_add()

Add one group, no questions asked. Calls getnew( ) to get an empty gid over 500. Added 3/98, Scimitar.

        int groups_add(
                const char *name)
        

groups_del()

Del one group, no questions asked. Added 3/98, Scimitar.

        int groups_del(
                const char *name)

groups_edit()

        void groups_edit(
                void)
        

groups_getpop()

Return the group ID of POP accounts or -1 if this group does not exist

        int groups_getpop(
                void)
        

groups_getppp()

Return the group ID of PPP accounts or -1 if this group does not exist

        int groups_getppp(
                void)
        

groups_getslip()

Return the group ID of SLIP accounts or -1 if this group does not exist

        int groups_getslip(
                void)
        

groups_getuucp()

Return the group ID of UUCP accounts or -1 if this group does not exist

        int groups_getuucp(
                void)
        

pass_isweak()

Check if a password is weak

        int pass_isweak(
                const char *pass)
        

passwd_sethook()

Register override function for authentication and password management This is normally called by distribution specific module (only one can call this function in a given linuxconf session). It was created to allow linuxconf to support PAM and still operate normally on non-PAM system.

        void passwd_sethook(
                int(*_fct_check)(const char *user),
                int(*_fct_change)(const char *user, bool pre_authenticated),
                int(*_fct_check_pair)(const char *user, const char *passwd))
        

perm_access()

Check if the user is really root or has the privilege to do a task If it is not, but the effective ID is root, then ask for the root password or his own password. Return != 0 if the real UID is root or the user knows the root password or has enough privilege. It prints an informative message about the action which will occur.

        int perm_access(
                PRIVILEGE *priv,
                const char *ctl,
                ...)
        

perm_checkpass()

Verify if there is password for root. If so ask the user to enter it and validate it. So askrunlevel is "safe". No one will be allowed to reconfigured the network if he don't know the root password. Return != 0 if user if allowed to get in.

        int perm_checkpass(
                void)
        

perm_checkpriv()

Check if the user has a privilege. If the user has supplied the root password once, it has the privilege Return != 0 if so.

        int perm_checkpriv(
                PRIVILEGE *priv)
        

perm_forceok()

Force a one minute "no question asked" root autorization for one minute. Normally linuxconf does nothing priviledged unless the user has provided some password (generally root). Some operation are indeed priviledge but are accepted, for example, changing his/her password.

        void perm_forceok(
                void)
        

perm_getdefprivi()

Return the current default privilege (usually NULL)

        PRIVILEGE *perm_getdefprivi(
                void)
        

perm_getuid()

get the authenticated user ID

        int perm_getuid(
                void)
        

perm_rootaccess()

Check if the user is really root. If it is not, but the effective ID is root, then ask for the root password. Return != 0 if the real UID is root or the user knows the root password. It prints an informative message about the action which will occur.

        int perm_rootaccess(
                const char *ctl,
                ...)
        

perm_setaccess()

Sent by the html mode to identify the user.

        void perm_setaccess(
                const char *username,
                const char *password)
        

perm_setbypass()

Disconnect privilege management. Everything is allowed if b is true

        void perm_setbypass(
                bool b)
        

perm_setdefprivi()

Record the current default privilege. Return the current one (which is normally NULL).

        PRIVILEGE *perm_setdefprivi(
                PRIVILEGE *priv)
        

perm_sethtml()

Set the html mode for granting priviledge. In html mode we are executing as root all the time. Normally no question is asked to root. Now we must ask for password before going through.

        void perm_sethtml(
                bool _mode)

perm_validpass()

Verify if a user/password combination is valid

        int perm_validpass(
                const char *username,
                const char *pass)
        

policies_getarchivecmd()

Return the command to run to archive user account data. Return NULL if none

        const char *policies_getarchivecmd(
                void)
        

policies_getcreatecmd()

Return the command to run after a user account has been created Return NULL is none.

        const char *policies_getcreatecmd(
                void)
        

policies_getcreateperm()

Return the default create mode the HOME directories

        int policies_getcreateperm(
                void)
        

policies_getdefhome()

Return the default base path for the HOME directories By default, it is /home.

        const char *policies_getdefhome(
                void)
        

policies_getdeletecmd()

Return the command to run to delete user account data. Return NULL if none

        const char *policies_getdeletecmd(
                void)
        

policies_getpostdeletecmd()

Return the command to run after a user account has been deleted Return NULL is none.

        const char *policies_getpostdeletecmd(
                void)
        

policies_mayedithome()

Return true if the HOME directory is editable/visible in the user accounts

        bool policies_mayedithome(
                void)
        

policies_mayeditquota()

Return true if the quota is editable/visible in the user accounts

        bool policies_mayeditquota(
                void)
        

policies_mayeditshell()

Return true if the shell is editable/visible in the user accounts

        bool policies_mayeditshell(
                void)
        

policies_mayedittasks()

Return true if the tasks (crontab) is editable/visible in the user accounts

        bool policies_mayedittasks(
                void)
        

policies_mayshowexpire()

Return true if the expiration date is visible in the user accounts

        bool policies_mayshowexpire(
                void)
        

policies_mayshowshadow()

Return true if the shadow parameters are visible in the user accounts

        bool policies_mayshowshadow(
                void)
        

policies_privgroup()

Do we create a private group for each user (redhat default)

        bool policies_privgroup(
                void)
        

privi_newcomng()

#Specbeg: USERACCT_COMNG / registration / sample This function defines a co-manager only for a user account dialog (key == "user"). Further, using the DICTIONARY object, it gets more information about the dialog. It creates the co-manager only for normal user account in the main domain.

        USERACCT_COMNG *privi_newcomng(
                const char *key,
                DICTIONARY&dict)

privilege_lookup()

Locate a PRIVILEGE object using its ID name Return NULL if not found.

        PRIVILEGE *privilege_lookup(
                const char *id)
        

privilege_save()

        int privilege_save(
                const char *user,
                PRIVILEGE_DATAS&tb,
                PRIVILEGE *priv)
        

privilege_setdialog()

        void privilege_setdialog(
                DIALOG&dia,
                const char *user,
                PRIVILEGE_DATAS&tb)
        

privilege_validate()

Validate the different field in the dialog. Generate an error message. nof will contain the offending field return -1 if any error.

        int privilege_validate(
                PRIVILEGE_DATAS&,
                int &nof)
        

shadow_exist()

Return != 0 if the /etc/shadow file exist

        int shadow_exist(
                void)

shells_editppp()

        void shells_editppp(
                void)
        

shells_editslip()

        void shells_editslip(
                void)
        

shells_edituser()

        void shells_edituser(
                void)
        

shells_exist()

Return true is path exist and is executable If path is empty, this imply the default shell, which is ok.

        bool shells_exist(
                const char *path)
        

shells_getdefault()

Return the path of the default shell for normal user.

        const char *shells_getdefault(
                void)
        

shells_getpppdefault()

Return the path of the default shell for ppp users.

        const char *shells_getpppdefault(
                void)
        

shells_getppplist()

Get the list of available shells for PPP accounts

        const SSTRINGS *shells_getppplist(
                void)
        

shells_getslipdefault()

Return the path of the default shell for slip users.

        const char *shells_getslipdefault(
                void)

shells_getsliplist()

Get the list of available shells for SLIP accounts

        const SSTRINGS *shells_getsliplist(
                void)
        

shells_getuserlist()

Get the list of available shells for normal users

        const SSTRINGS *shells_getuserlist(
                void)
        

shells_getuucpdefault()

        const char *shells_getuucpdefault(
                void)
        

shells_getuucplist()

Get the list of available shells for UUCP accounts

        const SSTRINGS *shells_getuucplist(
                void)
        

shells_isok()

Return != 0 if a path is an accepted shell

        bool shells_isok(
                const char *path)
        

shells_isppp()

Return != 0 if path is an accepted login shell for PPP account

        int shells_isppp(
                const char *path)
        

shells_isslip()

Return != 0 if path is an accepted login shell for SLIP account

        int shells_isslip(
                const char *path)
        

special_getpriv()

Return the PRIVILEGE associate with the management of user of this group Return NULL if there no special privilege (Only root can do it).

        PRIVILEGE *special_getpriv(
                const char *group)

special_init()

Initialise a template object for a specific group. The caller must delete the object. special may hold NULL if the group is not special.

        int special_init(
                const char *group,
                USER *&special)
        

upass_setend()

        void upass_setend(
                DIALOG&dia,
                const char *server)
        

upass_setintro()

        void upass_setintro(
                DIALOG&dia,
                const char *server)
        

user_exist()

Return != 0 if a user account exist.

        int user_exist(
                const char *name)
        

user_isadmin()

Return true if this loginid correspond to a administrative user account not shown by linuxconf

        bool user_isadmin(
                const char *loginid)
        

user_splitline()

Decompose a /etc/passwd style line into words

        int user_splitline(
                const char *line,
                char words[9][100])
        

userconf_edit()

        void userconf_edit(
                void)
        

userconf_editupass()

Let a user change its own password This will generally be used by PPP or POP users who can't do it otherwise. This is only usable with the html mode.

        void userconf_editupass(
                USERS&users,
                const char *server)
        

userconf_getprivsection()

Return the section title for user account co-admin privileges

        const char *userconf_getprivsection(
                void)
        

userconf_getusage()

        const char *userconf_getusage(
                void)
        

userconf_listspc()

        void userconf_listspc(
                void)

userconf_main()

        int userconf_main(
                int argc,
                char *argv[])
        

userconf_passwd()

Edit the password of the current user or one specific user

        int userconf_passwd(
                int argc,
                char *argv[])
        

users_add()

Add one user account

        int users_add(
                const char *id,
                const char *group,
                const char *name,
                const char *shell)
        

users_addone()

Add one new special user. Return -1 if the user was not created

        int users_addone(
                const char *name,
                const char *group,      // Which group to use or NULL.
                const char *fullname)   // gecos field suggested
        

users_del()

Delete one user account

        int users_del(
                const char *id,
                USER_DELOPER oper)

users_edit()

General edition of users account and special account See USERS::edit()

        void users_edit(
                USER *special,  // Template for a special account.
                // Or NULL.
                PRIVILEGE *priv,        // Privilege required to manage those accounts
                // or NULL if only root can do this
                unsigned may_edit)      // Which field may be edited (USRACCT_EDIT____
        

users_editone()

Edit one user spec. If the user does not exist, ask if we want to create it. Return -1 if the account was not created

        int users_editone(
                const char *name,
                const char *group,      // Group to use (or NULL) if the user
                // is created
                const char *fullname)   // gecos field suggested when creating a new
                // account
        

users_sethook()

record some hooks for distribution dependant account management methods

        void users_sethook(
                int(*_user_fct_del)(USER *, SHADOW *),
                int(*_user_fct_add)(USER *, SHADOW *, bool),
                int(*_user_fct_mod)(USER *, SHADOW *))
        

Next Previous Contents