summaryrefslogtreecommitdiff
path: root/usr/src/man/man3sec/acl_strip.3sec
blob: a4f390af033a16be7e332142e6a8ba00d3c54d6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
'\" te
.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH ACL_STRIP 3SEC "Oct 6, 2005"
.SH NAME
acl_strip \- remove all ACLs from a file
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lsec\fR [ \fIlibrary\fR\&.\|.\|. ]
#include <sys/acl.h>

\fBint\fR \fBacl_strip\fR(\fBconst char *\fR\fIpath\fR, \fBuid_t\fR \fIuid\fR, \fBgid_t\fR \fIgid\fR, \fBmode_t\fR \fImode\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The \fBacl_strip()\fR function removes all ACLs from a file and replaces them
with a trivial ACL based on the \fImode\fR argument. After replacing the ACL,
the owner and group of the file are set to the values specified by the
\fIuid\fR and \fIgid\fR arguments.
.SH RETURN VALUES
.sp
.LP
Upon successful completion, \fBacl_strip()\fR returns 0. Otherwise it returns
-1 and sets \fBerrno\fR to indicate the error.
.SH ERRORS
.sp
.LP
The \fBacl_strip()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBEACCES\fR\fR
.ad
.RS 16n
Search permission is denied on a component of the path prefix of \fIpath\fR.
.RE

.sp
.ne 2
.na
\fB\fBEFAULT\fR\fR
.ad
.RS 16n
The \fIpath\fR argument points to an illegal address.
.RE

.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 16n
The \fIuid\fR or \fIgid\fR argument is out of range.
.RE

.sp
.ne 2
.na
\fB\fBEIO\fR\fR
.ad
.RS 16n
A disk I/O error has occurred while storing or retrieving the ACL.
.RE

.sp
.ne 2
.na
\fB\fBELOOP\fR\fR
.ad
.RS 16n
A loop exists in symbolic links encountered during the resolution of the
\fIpath\fR argument.
.RE

.sp
.ne 2
.na
\fB\fBENAMETOOLONG\fR\fR
.ad
.RS 16n
The length of  the \fIpath\fR argument  exceeds {\fBPATH_MAX\fR},  or the
length of a path component exceeds {\fBNAME_MAX\fR} while \fB_POSIX_NO_TRUNC\fR
is in effect.
.RE

.sp
.ne 2
.na
\fB\fBENOENT\fR\fR
.ad
.RS 16n
A component of \fIpath\fR does not exist.
.RE

.sp
.ne 2
.na
\fB\fBENOTDIR\fR\fR
.ad
.RS 16n
A component of the prefix of \fIpath\fR is not a directory.
.RE

.sp
.ne 2
.na
\fB\fBEPERM\fR\fR
.ad
.RS 16n
The effective user ID does not match the owner of the file and the process does
not have appropriate privileges.
.RE

.sp
.ne 2
.na
\fB\fBEROFS\fR\fR
.ad
.RS 16n
The file system is mounted read-only.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Evolving
_
MT-Level	MT-Safe
.TE

.SH SEE ALSO
.sp
.LP
.BR acl_get (3SEC),
.BR acl_trivial (3SEC),
.BR acl (7),
.BR attributes (7)