System Configuration Procedures

sys/add_account

Procedure Model

Type:    (  )Web Page              (  )CGI Script              (  )Shared Library      (X)System API

Name: sys/add_account

Assigned to:

Reference:

Description

This system configuration function runs with suid root permissions. It adds a new account to the system with the value of the username field passed in as a parameter, then sets the initial password on this account to the value of the password field passed in as a parameter. Finally, it uses the system edquota command to set the user quota on this new account to the value stored in the corresponding prototype account.

Implementation Skills

PERL, C

Parameter List

Username, password, and member_type.

Called By:

vol/listapps.cgi

Can Call:

/usr/bin/passwd
/usr/sbin/useradd
/usr/sbin/edquota -p

prototype-user (non-login account profile)
prototype-ind (non-login account profile)
prototype-inst (non-login account profile)
 

Function Description

  1. The script will be executed using suid root permissions.
  2. It will call the system useradd command passing it the username value contained in its parameters.
  3. It will call the system passwd command with parameters username and password.
  4. Call the system edquota -p command passing it the username value and, depending on the value of the Member_Type command, the "prototype-ind", "prototype-inst", or "prototype-user" account names.

Possible Exit Conditions and Return Values

  1. If the user or system is unsuccessful in executing its parts, it will return a –1 if it is unable to invoke the useradd command, -2 if it is unable to set the password, and –3 if it is unable to set the disk quotas.
  2. If the alias is successfully created or replaced, the function returns a 0.

Sign Off by:

Project Manager