.\" Man page generated from reStructuredText
.\" by the Docutils 0.22.4 manpage writer.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "setcifsacl" "1" "" ""
.SH Name
setcifsacl \- Userspace helper to alter components of a security descriptor for Common Internet File System (CIFS)
.SH SYNOPSIS
.INDENT 0.0
.INDENT 3.5
setcifsacl [\-v|\-U|\-a|\-A|\-D|\-M|\-S|\-o|\-g] \(dq{one or more ACEs or a SID}\(dq {file system object}
.UNINDENT
.UNINDENT
.SH DESCRIPTION
.sp
This tool is part of the cifs\-utils suite.
.sp
\fBsetcifsacl\fP is a userspace helper program for the Linux CIFS client
file system. It is intended to alter an ACL or set owner/group SID of a security descriptor
for a file system object. Whether a security descriptor to be set is
applied or not is determined by the CIFS/SMB server.
.sp
This program uses a plugin to handle the mapping of user and group
names to SIDs. \fI/etc/cifs\-utils/idmap\-plugin\fP should be a symlink that points to the
correct plugin to use.
.SH OPTIONS
.INDENT 0.0
.TP
.B  \-h
Print usage message and exit.
.TP
.B  \-v
Print version number and exit.
.TP
.B  \-U
Apply ACE editing actions (\-a, \-D, \-M, \-S) to SACL (aUdit ACL). The actions are
appliend to DACL if \-U is not specified.
.TP
.B  \-a
Add one or more ACEs to an ACL of a security descriptor.  An ACE is
added even if the same ACE exists in the ACL.
.TP
.B  \-A
Add one or more ACEs to the ACL of a security descriptor, while maintaining
the preferred order of the ACEs.
The preferred order of ACEs are described in the following documentation:
\%<https://\:docs\:.microsoft\:.com/\:en-us/\:windows/\:win32/\:secauthz/\:order-of-aces-in-a-dacl>
.TP
.B  \-D
Delete one or more ACEs from an ACL of a security descriptor.  Entire
ACE has to match in an existing ACL for the listed ACEs to be deleted.
.TP
.B  \-M
Modify one or more ACEs from an ACL of a security descriptor.  SID and
type are used to match for existing ACEs to be modified with the list
of ACEs specified.
.TP
.B  \-S
Set an ACL of security descriptor with the list of ACEs Existing ACL
is replaced entirely with the specified ACEs.
.TP
.B  \-o
Set owner SID to one specified as a command line argument.
.TP
.B  \-g
Set group SID to one specified as a command line argument.
.sp
The owner/group SID can be specified as a name or a raw SID value.
Every ACE entry starts with \(dqACL:\(dq One or more ACEs are specified
within double quotes.  Multiple ACEs are separated by a comma.
.sp
Following fields of a DACL ACE can be modified with possible values:
.INDENT 7.0
.IP \(bu 2
\fBSID\fP \- Either a name or a raw SID value.
.IP \(bu 2
\fBtype\fP \- ALLOWED (0x0), DENIED (0x1), OBJECT_ALLOWED (0x5), OBJECT_DENIED (0x6)
.IP \(bu 2
\fBflags\fP \- OBJECT_INHERIT_FLAG (OI or 0x1),
CONTAINER_INHERIT_FLAG (CI or 0x2), NO_PROPAGATE_INHERIT_FLAG (NI
or 0x4), INHERIT_ONLY_FLAG (IO or 0x8), INHERITED_ACE_FLAG (IA or
0x10) or a combination/OR of these values.
.IP \(bu 2
\fBmask\fP  \- Either one of FULL, CHANGE, READ, a combination of R W X D P O, or a hex value.
.UNINDENT
.sp
Following fields of a SACL ACE can be modified with possible values:
.INDENT 7.0
.IP \(bu 2
\fBSID\fP \- Either a name or a raw SID value.
.IP \(bu 2
\fBtype\fP \- AUDIT (0x2), AUDIT_OBJECT (0x7), AUDIT_CALLBACK (0xD), AUDIT_CALLBACK_OBJECT (0xF),
MANDATORY_LABEL (0x11), RESOURCE_ATTRIBUTE (0x12), SCOPED_POLICY_ID (0x13)
.IP \(bu 2
\fBflags\fP \- SUCCESSFULL_ACCESS (SA or 0x40), FAILED_ACCESS (FA or 0x80)
.IP \(bu 2
\fBmask\fP  \- Either one of FULL, CHANGE, READ, a combination of R W X D P O, or a hex value.
.UNINDENT
.UNINDENT
.SH EXAMPLES
.SS Add an ACE
.INDENT 0.0
.INDENT 3.5
setcifsacl \-a \(dqACL:CIFSTESTDOM\euser2:DENIED/0x1/D\(dq <file_name>
.sp
setcifsacl \-a \(dqACL:CIFSTESTDOM\euser1:ALLOWED/OI|CI|NI/D\(dq <file_name>
.sp
setcifsacl \-U \-a \(dqACL:CIFSTESTDOM\euser1:AUDIT/SA/D\(dq <file_name>
.UNINDENT
.UNINDENT
.SS Add an ACE and reorder ACL
.INDENT 0.0
.INDENT 3.5
setcifsacl \-A \(dqACL:CIFSTESTDOMuser3:ALLOWED/OI/FULL\(dq <file_name>
setcifsacl \-A \(dqACL:CIFSTESTDOMuser2:DENIED/0x1/D\(dq <file_name>
setcifsacl \-A \(dqACL:CIFSTESTDOMuser1:ALLOWED/OI|CI|NI/D\(dq <file_name>
.sp
After setting above mentioned ACEs, below is output of getcifsacl:
ACL:CIFSTESTDOMuser2:DENIED/0x1/D
ACL:CIFSTESTDOMuser3:ALLOWED/OI/FULL
ACL:CIFSTESTDOMuser1:ALLOWED/OI|CI|NI/D
.UNINDENT
.UNINDENT
.SS Delete an ACE
.INDENT 0.0
.INDENT 3.5
setcifsacl \-D \(dqACL:S\-1\-1\-0:0x1/OI/0x1201ff\(dq <file_name>
.sp
setcifsacl \-U \-D \(dqACL:S\-1\-1\-0:0x2/FA/0xf01ff\(dq <file_name>
.UNINDENT
.UNINDENT
.SS Modify an ACE
.INDENT 0.0
.INDENT 3.5
setcifsacl \-M \(dqACL:CIFSTESTDOM\euser1:ALLOWED/0x1f/CHANGE\(dq <file_name>
.sp
setcifsacl \-U \-M \(dqACL:CIFSTESTDOM\euser1:AUDIT_OBJECT/SA/CHANGE\(dq <file_name>
.UNINDENT
.UNINDENT
.SS Set an ACL
.INDENT 0.0
.INDENT 3.5
setcifsacl \-S \(dqACL:CIFSTESTDOM\eAdministrator:0x0/0x0/FULL,ACL:CIFSTESTDOM\euser2:0x0/0x0/FULL\(dq <file_name>
.sp
setcifsacl \-U \-S \(dqACL:CIFSTESTDOM\eAdministrator:AUDIT/SA/FULL,ACL:CIFSTESTDOM\euser2:0x7/0x80/FULL\(dq <file_name>
.UNINDENT
.UNINDENT
.SS Set owner SID
.INDENT 0.0
.INDENT 3.5
setcifsacl \-o \(dqS\-1\-5\-21\-3338130290\-3403600371\-1423429424\-2102\(dq <file_name>
.UNINDENT
.UNINDENT
.SS Set group SID
.INDENT 0.0
.INDENT 3.5
setcifsacl \-g \(dq\%<Administrators@\:BUILTIN>\(dq <file_name>
.UNINDENT
.UNINDENT
.SH NOTES
.sp
Kernel support for getcifsacl/setcifsacl utilities was initially
introduced in the 2.6.37 kernel.
.SH SEE ALSO
.sp
mount.cifs(8), getcifsacl(1)
.SH AUTHOR
.sp
Shirish Pargaonkar wrote the setcifsacl program.
.sp
The Linux CIFS Mailing list is the preferred place to ask questions
regarding these programs.
.\" End of generated man page.
