Previous Topic

Next Topic

FILE OPTIONS

The following options, all beginning with -of, allow changes to file information. Additional user and group options are described elsewhere.

Option File Password

-ofp filename password
  • filename: File name is mandatory.
  • password: File password is mandatory,

Option File Security (permissions)

-ofs <filename> <permission> ...
-ofs +|-<permission> ...
  • filename: File name is mandatory.
  • permission: File permission mask.
    To set a permission, set the byte at the corresponding offset to a value of ‘+’.
    To reset a specified permission, set the corresponding byte to ‘-’.
    For example, the string “+++++-----+++++” sets all OWNER and WORLD permissions, and clears all GROUP permissions.
    This field is interpreted as a 15-byte permission mask containing owner, group, and world permissions:
      (offset)
      0  1  2  3  4  5  6  7  8  9  10 11 12 13 14
      ----OWNER----  ----GROUP----  -----WORLD----
      r  w  f  d  p  r  w  f  d  p   r  w  f  d  p
     
      r = Read  w = Write  f = define  d = Delete  p = noPass
  • permission can also be one of the following:
	ownerall, ownerread, ownerwrite, ownerdefine, ownerdelete, ownernopass,
	groupall, groupread, groupwrite, groupdefine, groupdelete, groupnopass,
	worldall, worldread, worldwrite, worlddefine, worlddelete, worldnopass

Options are evaluated left to right. For example, specifying -groupwrite +groupwrite has the effect of adding the groupwrite permission, and specifying +worldall -worldread turns on all world permissions except read permission.

Option File Group

-ofg filename groupid
  • filename: File name is mandatory.
  • groupid: File group id is mandatory.

Option File Owner

-ofo filename owner
  • filename: File name is mandatory.
  • owner: File owner is mandatory.

Examples of -ofs usage:

-ofs <filename> <permmask> is the same as current usage:

-ofs test.dat ++++++++++-----

-ofs <filename> <permission> ... sets the file permissions to the specified permissions. The following command sets all owner and group permissions and resets all world permissions:

-ofs test.dat ownerall groupall

-ofs <filename> +|- <permission> ... adds/removes specified permissions to/from current file permissions. The following command adds the worldread permission to the current file permissions and removes the groupwrite permission from the current file permissions:

-ofs test.dat +worldread -groupwrite