Skip to content

Commit

Permalink
MT#58402 TT#160855 tt2-process: warn if there's no base file for cust…
Browse files Browse the repository at this point in the history
…omtt

* use default permissions for the built file in this case

Change-Id: I3f58269484ee3def943586fcbcfed17328807c1e
(cherry picked from commit 3c63137)
  • Loading branch information
linuxmaniac authored and mika committed Sep 29, 2023
1 parent 901bcd0 commit b49be3b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion helper/tt2-process
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,16 @@ sub process_template {
$input_for_perms =~ s/\.customtt\.tt2/.tt2/ig;
$input_for_perms =~ s/\.tt2.*/.tt2/ig;

if (! -e $input_for_perms) {
warn("base filename:${input_for_perms} for:${input} not found\n");
}

# Set permissions for generated config based on the ones of the
# template, plus dropping all write permissions.
my $old_umask = umask 0222;
my $mode = (stat $input_for_perms)[2];
# base file does not exist, default perms
## no critic (ValuesAndExpressions::ProhibitLeadingZeros)
my $mode = (stat $input_for_perms)[2] // 0644;

my $newfile = "$output.ngcpcfg-new";

Expand Down

0 comments on commit b49be3b

Please sign in to comment.