3
0
Fork 0
forked from mirrors/nixpkgs

nixos/wpa_supplicant: prefer 'install' over 'touch/chmod/mkdir/chgrp'

Ref #121293.
This commit is contained in:
Bjørn Forsman 2021-05-01 15:34:04 +02:00
parent 6dab4db428
commit 5d47dc750f

View file

@ -44,19 +44,10 @@ let
preStart = '' preStart = ''
${optionalString (suppl.configFile.path!=null) '' ${optionalString (suppl.configFile.path!=null) ''
touch -a ${suppl.configFile.path} (umask 077 && touch -a "${suppl.configFile.path}")
chmod 600 ${suppl.configFile.path}
''} ''}
${optionalString suppl.userControlled.enable '' ${optionalString suppl.userControlled.enable ''
if ! test -e ${suppl.userControlled.socketDir}; then install -dm770 -g "${suppl.userControlled.group}" "${suppl.userControlled.socketDir}"
mkdir -m 0770 -p ${suppl.userControlled.socketDir}
chgrp ${suppl.userControlled.group} ${suppl.userControlled.socketDir}
fi
if test "$(stat --printf '%G' ${suppl.userControlled.socketDir})" != "${suppl.userControlled.group}"; then
echo "ERROR: bad ownership on ${suppl.userControlled.socketDir}" >&2
exit 1
fi
''} ''}
''; '';