1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

smbcacls: Do not read old ACL for 'set' operation

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Christof Schmitt 2016-04-29 15:12:38 -07:00 committed by Jeremy Allison
parent 8bb4fccd27
commit e2642da130

View File

@ -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 (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;
if (!old) {
return EXIT_FAILED;
}
}
/* the logic here is rather more complex than I would like */