diff options
author | Christof Schmitt <cs@samba.org> | 2016-04-29 15:12:38 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2016-04-30 01:01:42 +0200 |
commit | e2642da130f96c542aa4962b76c1b9d1f677162d (patch) | |
tree | 7b56a6aa0c46738378001535d4b103250a36ca1f /source3/utils/smbcacls.c | |
parent | 8bb4fccd2758cba5907134621ef57186e70a7073 (diff) | |
download | samba-e2642da130f96c542aa4962b76c1b9d1f677162d.tar.gz |
smbcacls: Do not read old ACL for 'set' operation
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/utils/smbcacls.c')
-rw-r--r-- | source3/utils/smbcacls.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index d50219cf74a..5cb707d2d7d 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -505,10 +505,16 @@ static int cacl_set(struct cli_state *cli, const char *filename, if (!sd) return EXIT_PARSE_ERROR; if (test_args) return EXIT_OK; - old = get_secdesc(cli, filename); - - if (!old) { - return EXIT_FAILED; + if (mode != SMB_ACL_SET) { + /* + * Do not fetch old ACL when it will be overwritten + * completely with a new one. + */ + old = get_secdesc(cli, filename); + + if (!old) { + return EXIT_FAILED; + } } /* the logic here is rather more complex than I would like */ |