1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* set-acl.c - set access control list equivalent to a mode
5 Copyright (C) 2002-2003, 2005-2014 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 Written by Paul Eggert and Andreas Gruenbacher, and Bruno Haible. */
31 #define _(msgid) gettext (msgid)
34 /* Set the access control lists of a file. If DESC is a valid file
35 descriptor, use file descriptor operations where available, else use
36 filename based operations on NAME. If access control lists are not
37 available, fchmod the target file to MODE. Also sets the
38 non-permission bits of the destination file (S_ISUID, S_ISGID, S_ISVTX)
39 to those from MODE if any are set.
40 Return 0 if successful. On failure, output a diagnostic, set errno and
44 set_acl (char const *name, int desc, mode_t mode)
46 int ret = qset_acl (name, desc, mode);
48 error (0, errno, _("setting permissions for %s"), quote (name));