#803515 ppp: chap-secrets permissions reset to 600 every upgrade

Package:
ppp
Source:
ppp
Description:
Point-to-Point Protocol (PPP) - daemon
Submitter:
Philippe Cloutier
Date:
2015-10-30 20:54:10 UTC
Severity:
normal
#803515#5
Date:
2015-10-30 20:40:50 UTC
From:
To:
postinst modifies the permissions of 2 configuration files, pap-secrets and chap-secrets:

# install /etc/ppp/pap-secrets and /etc/ppp/chap-secrets from templates,
# if necessary
for file in pap-secrets chap-secrets; do
  if [ -f /etc/ppp/$file ]; then
    TAG=$(head --lines=1 /etc/ppp/$file)
    if [ "$TAG" = "#GENERATED-BY-DEBIAN-INSTALLER#" ]; then
      (sed -e "s/-HOSTNAME-/$HOST/g" /usr/share/ppp/$file; \
        cat /etc/ppp/$file) > /etc/ppp/$file.tmp
      mv /etc/ppp/$file.tmp /etc/ppp/$file
    fi
  else
    sed -e "s/-HOSTNAME-/$HOST/g" < /usr/share/ppp/$file > /etc/ppp/$file
  fi
  chmod 600 /etc/ppp/$file
done

The permission change at the last line is always performed, even on upgrade. This causes /etc/ppp/chap-secrets to go back to 0600 even if the administrator has set different permissions.