Trusted Solaris Administrator's Procedures

To Save and Restore Privileges When Editing a File

  1. Assume the Security Administrator role and use the getfpriv command to list the privileges on the executable file and save the output.

    The following example directs the output into a temporary file.


    $ getfpriv executable_file > tempfile
    
  2. After editing the executable file, use the File Manager to make the file executable again (if needed) and then restore the privileges listed in the temporary file.

    The following example uses the setfpriv(1) command to set the privileges stored in the tempfile created in Step 1.


    $ setfpriv -s -f `cat tempfile` program_pathname