/*
* setcifsacl utility
*
* Copyright (C) Shirish Pargaonkar (shirishp@us.ibm.com) 2011
*
* Used to alter entries of an ACL or replace an entire ACL in a
* security descriptor of a file system object that belongs to a
* share mounted using option cifsacl.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* This utility modifies various components of the security descriptor. These
* actions require different permissions and different SMB protocol-level flags.
* The user needs to make sure the share is mounted using the user credentials
* for the user who has appropriate permissions and privileges. The kernel
* CIFS client knows which flags to use based on the extended attribute name:
* - system.cifs_acl - set dacl only
* - system.cifs_ndst - set dacl and owner info
* - system.cifs_ntsd_full - set dacl, owner, and sacl
*
* For simplicity, the utility modifies one component of the descriptor:
* owner sid, group sid, DACL, or SACL. The rest of the descriptor is unchanged.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
#include <string.h>
#include <getopt.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include <stdio.h><