Procedure Model

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

Name: sys/change_user

Assigned to:



This function renames the user’s home directory from old_username to new_username, effecting this change in the system password and shadow files and adding a system alias mapping the old_username to new_username. Because of the permissions involved, this command must be set to suid root.

Implementation Skills


Parameter List

old_username, new_username

Called By:


Can Call:


Function Description

  1. Use the system’s usermod command to move the user’s home directory to the new location and move the login name to the new login name.
  2. Enter an entry in the log/csuite directory noting these changes.
  3. Call the add_alias command to add a new alias mapping from the old_username to the new_username.
  4. Return 0.

Possible Exit Conditions and Return Values

This function should always return 0.

Sign Off by:

Project Manager