2 Copyright (C) 2009 Andreas Gruenbacher <agruen@suse.de>
4 This program is free software: you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 int main(int argc, char *argv[])
31 progname = basename(argv[0]);
34 printf("%s -- set access control list of files\n"
35 "Usage: %s acl file ...\n",
40 acl = acl_from_text(argv[1]);
42 fprintf(stderr, "%s: `%s': %s\n",
43 progname, argv[1], strerror(errno));
46 if (acl_valid(acl) != 0) {
47 fprintf(stderr, "%s: `%s': invalid/incomplete acl\n",
53 for (n = 2; n < argc; n++) {
54 if (acl_set_file(argv[n], ACL_TYPE_ACCESS, acl) != 0) {
55 fprintf(stderr, "%s: setting acl of %s: %s\n",
56 progname, argv[n], strerror(errno));