Skip to content

Commit

Permalink
Merge pull request #8352 from inverse-inc/fix/8351
Browse files Browse the repository at this point in the history
Fix #8351 Chown warning with fingerbank-collector post-install
  • Loading branch information
fdurand authored Nov 13, 2024
2 parents 8e95139 + df99f9d commit c8e5098
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion addons/AD/migrate.pl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ BEGIN
print "Please re-run the script again or configure the domain directly through the admin UI in 'Configuration->Domain' \n";
}

pf_run("chown pf.pf $domain_config_file");
pf_run("chown pf:pf $domain_config_file");

=head1 AUTHOR
Expand Down
4 changes: 2 additions & 2 deletions addons/monit/monitoring-scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ id -u pf-monitoring || execute_and_check "useradd pf-monitoring -s /bin/bash"
execute_and_check "usermod -a -G pf pf-monitoring"

execute_and_check "mkdir -p $script_dir"
execute_and_check "chown root.pf-monitoring $script_dir"
execute_and_check "chown root:pf-monitoring $script_dir"
execute_and_check "chmod 0750 $script_dir"

download_and_check $script_registry_url $script_registry_file
Expand All @@ -76,7 +76,7 @@ while read u; do
echo "Placing $u in $fname"
execute_and_check "mv $tmp $script_dir/$fname" "Cannot place file in script directory"
execute_and_check "chmod ug+rx $script_dir/$fname" "Cannot set executable bit on script"
execute_and_check "chown pf-monitoring.pf-monitoring $script_dir/$fname" "Cannot set executable bit on script"
execute_and_check "chown pf-monitoring:pf-monitoring $script_dir/$fname" "Cannot set executable bit on script"
done <$script_registry_file

if [ $ERROR -ne 0 ]; then
Expand Down
4 changes: 2 additions & 2 deletions addons/perl-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ FBGROUP=fingerbank

init-db-local:
@db/upgrade.pl --database db/fingerbank_Local.db; \
chown fingerbank.fingerbank /usr/local/fingerbank/db/fingerbank_Local.db; \
chown fingerbank:fingerbank /usr/local/fingerbank/db/fingerbank_Local.db; \
chmod 664 /usr/local/fingerbank/db/fingerbank_Local.db; \

init-db-upstream:
@read -p "API key (ENTER if none): " api_key; \
perl -I/usr/local/fingerbank/lib -Mfingerbank::DB -Mfingerbank::Util -Mfingerbank::Log -e "fingerbank::Log::init_logger; fingerbank::DB::update_upstream( (api_key => \"$$api_key\") )"; \
chown fingerbank.fingerbank /usr/local/fingerbank/db/fingerbank_Upstream.db; \
chown fingerbank:fingerbank /usr/local/fingerbank/db/fingerbank_Upstream.db; \
chmod 664 /usr/local/fingerbank/db/fingerbank_Upstream.db; \

package-files:
Expand Down
2 changes: 1 addition & 1 deletion addons/perl-client/debian/fingerbank.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ case "$1" in
make init-db-local
make fixpermissions
/usr/local/fingerbank/conf/upgrade/*
chown fingerbank.fingerbank /usr/local/fingerbank/conf/fingerbank.conf
chown fingerbank:fingerbank /usr/local/fingerbank/conf/fingerbank.conf
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
2 changes: 1 addition & 1 deletion addons/pfconfig/pfconfig.init
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ start() {
fi
# create directory, fix rights and remove previous socket
mkdir -p $control_files_dir
chown -R $User.$User $control_files_dir
chown -R $User:$User $control_files_dir
chmod 0775 $control_files_dir
rm -f $socket_path
daemon --user=$User ${prog} -d
Expand Down
2 changes: 1 addition & 1 deletion bin/cluster/sync
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ if($master_server){
open(my $fh, '>', $file);
print $fh $result;
close($fh);
`chown pf.pf $file`;
`chown pf:pf $file`;
};
if($@){
get_logger->error("Failed to sync file : $file . $@");
Expand Down
3 changes: 3 additions & 0 deletions ci/packer/zen/build-and-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ then
PF_VERSION+=${BASH_REMATCH[1]};
PF_VERSION+=.0;
echo "Maintenance Branch detected, try to match tag version with PF version = $PF_VERSION"
elif [[ "$PF_VERSION" =~ ^.*\/.*$ ]];
then
PF_VERSION="`echo $PF_VERSION | sed -r 's/\//-/g'`"
fi

VM_NAME=${VM_NAME:-vm}
Expand Down
2 changes: 1 addition & 1 deletion debian/packetfence-config.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ case "$1" in
if [ ! -f /usr/local/pf/conf/pfconfig.conf ]; then
echo "pfconfig.conf doesnt exits"
touch /usr/local/pf/conf/pfconfig.conf
chown pf.pf /usr/local/pf/conf/pfconfig.conf
chown pf:pf /usr/local/pf/conf/pfconfig.conf
else
echo "pfconfig.conf already exists, won't touch it!"
fi
Expand Down
4 changes: 2 additions & 2 deletions rpm/packetfence.spec
Original file line number Diff line number Diff line change
Expand Up @@ -715,15 +715,15 @@ fi
if [ ! -f /usr/local/pf/conf/pf.conf ]; then
echo "Touch pf.conf because it doesnt exist"
touch /usr/local/pf/conf/pf.conf
chown pf.pf /usr/local/pf/conf/pf.conf
chown pf:pf /usr/local/pf/conf/pf.conf
else
echo "pf.conf already exists, won't touch it!"
fi

if [ ! -f /usr/local/pf/conf/pfconfig.conf ]; then
echo "Touch pfconfig.conf because it doesnt exist"
touch /usr/local/pf/conf/pfconfig.conf
chown pf.pf /usr/local/pf/conf/pfconfig.conf
chown pf:pf /usr/local/pf/conf/pfconfig.conf
else
echo "pfconfig.conf already exists, won't touch it!"
fi
Expand Down

0 comments on commit c8e5098

Please sign in to comment.