Manual Pages
Table of Contents
cifs chmod - change the permissions mode of a file
cifs chmod share mode path
This can be used to change the permissions mode of a file or
directory. This command was added since an administrator
using a DOS or Windows machine cannot change the UNIX-style
permissions of a file or directory. It will change the permissions
of the file or directory with the pathname path,
relative to the root directory of the share share, to modes
as specified by mode, which may be absolute or symbolic, as
follows.
Absolute Modes
An absolute mode is an octal number constructed by the following
values:
- 4000
- set-user-ID-on-execution
- 2000
- set-group-ID-on-execution
- 1000
- sticky bit
- 0400
- read by owner
- 0200
- write by owner
- 0100
- execute (or search for directories) by owner
- 0070
- read, write, execute/search by group
- 0007
- read, write, execute/search by others
The read, write, and execute/search values for group and
others are encoded as described for owner.
Symbolic Modes
A symbolic mode is a comma-separated list of operations of
the form
[ who ] op [ permission ]
who specifies which of the user, group, and other parts of
the mode bits are to be changed; it is a list that can contain
the letters ``u'', ``g'', and ``o'', specifying the
user, group, and other parts of the mode bits, respectively,
and the latter ``a'', which is equivalent to ``ugo''. If
who is omitted, it is equivalent to ``a''.
perm specifies the mode bit values, as follows:
- r
- The read bits.
- s
- The set-user-ID-on-execution and set-group-IDon-execution
bits.
- t
- The sticky bit.
- w
- The write bits.
- x
- The execute/search bits.
If perm is omitted, it specifies none of the mode bits.
op specifies the operation to be performed, as follows:
- +
- If no value is supplied for perm, the ``+''
operation has no effect. If no value is supplied
for who, each permission bit specified in
perm for which the corresponding bit in the
file mode creation mask is set. Otherwise, the
mode bits represented by the specified who and
perm values are set.
- -
- If no value is supplied for perm, the ``-''
operation has no effect. If no value is supplied
for who, each permission bit specified in
perm is cleared. Otherwise, the mode bits
represented by the specified who and perm
values are cleared.
- =
- The mode bits specified by the who value are
cleared, or, if no who value is specified, the
owner, group and other mode bits are cleared.
Then, if no value is supplied for who, each
permission bit specified in perm is set. Otherwise,
the mode bits represented by the specified
who and perm values are set.
Each entry in the comma-separated list specifies an operation
to be performed on the mode bits, and each operation is
applied to the mode bits in the order specified.
Operations upon the other permissions only (specified by the
symbol ``o'' by itself), in combination with the perm symbol
``s'', is ignored; operations upon the user or group permissions
only, in combination with the perm symbol ``t'', are
ignored.
644 make a file readable by anyone and writable by the
owner only.
go-w deny write permission to group and others.
755
u=rwx,go=rx
make a file readable/executable by everyone and writable
by the owner only.
go= clear all mode bits for group and others.
There's no perm option for the naughty bits.
Table of Contents