Skip to content

Commit cad2292

Browse files
committed
Added missing record changes/failures to when flipping the immutable bit
Ticket: ENT-13179 Changelog: Title Signed-off-by: Lars Erik Wik <[email protected]>
1 parent 66c2917 commit cad2292

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cf-agent/verify_files.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ static PromiseResult VerifyFilePromise(EvalContext *ctx, char *path, const Promi
373373
break;
374374
case FS_ATTRS_FAILURE:
375375
RecordFailure(ctx, pp, &a,
376-
"Failed to clear the immutable bit on file '%s'",
377-
changes_path);
376+
"Failed to clear the immutable bit on file '%s': %s",
377+
changes_path, FSAttrsErrorCodeToString(res));
378378
result = PromiseResultUpdate(result, PROMISE_RESULT_FAIL);
379379
break;
380380
case FS_ATTRS_NOT_SUPPORTED:
@@ -663,14 +663,15 @@ static PromiseResult VerifyFilePromise(EvalContext *ctx, char *path, const Promi
663663
switch (res)
664664
{
665665
case FS_ATTRS_SUCCESS:
666-
Log(LOG_LEVEL_VERBOSE, "Set the immutable bit on file '%s'",
667-
changes_path);
666+
RecordChange(ctx, pp, &a,
667+
"Set the immutable bit on file '%s'",
668+
changes_path);
668669
break;
669670
case FS_ATTRS_FAILURE:
670671
/* Things still may be fine as long as the agent does not try to mutate the file */
671-
Log(LOG_LEVEL_VERBOSE,
672-
"Failed to set the immutable bit on file '%s': %s",
673-
changes_path, FSAttrsErrorCodeToString(res));
672+
RecordFailure(ctx, pp, &a,
673+
"Failed to set the immutable bit on file '%s': %s",
674+
changes_path, FSAttrsErrorCodeToString(res));
674675
break;
675676
case FS_ATTRS_NOT_SUPPORTED:
676677
/* We will not treat this as a promise failure because this

0 commit comments

Comments
 (0)