Skip to content

Commit 2abbb50

Browse files
committed
delete attribute can now override immutable bit
The delete attribute of the files promise can now override the immutable bit. Ticket: ENT-10961, CFE-1840 Changelog: Commit Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent b46f991 commit 2abbb50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cf-agent/verify_files_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,8 +2419,8 @@ static PromiseResult VerifyDelete(EvalContext *ctx,
24192419
{
24202420
if (!S_ISDIR(sb->st_mode)) /* file,symlink */
24212421
{
2422-
int ret = unlink(lastnode);
2423-
if (ret == -1)
2422+
bool override_immutable = EvalContextOverrideImmutableGet(ctx);
2423+
if (!OverrideImmutableDelete(lastnode, override_immutable))
24242424
{
24252425
RecordFailure(ctx, pp, attr, "Couldn't unlink '%s' tidying. (unlink: %s)",
24262426
path, GetErrorStr());

0 commit comments

Comments
 (0)