Skip to content
Snippets Groups Projects
Commit 0ae42247 authored by Erik Alexandre Pucci's avatar Erik Alexandre Pucci
Browse files

bootstrap-install: Changed installer to remove old seed_mec sudoers(1) rule


Instead of doing nothing, remove the old rule and add the new one to
sudoers(1) file.

This modification corrects an error which the previous agent version caused
in outdated systems (e.g. LE 3, Ubuntu 8), making the sudoers(1) file
unreadable.

Signed-off-by: default avatarErik Alexandre Pucci <eap08@c3sl.ufpr.br>
Acked-by: default avatarAdriano da Luz <al08@c3sl.ufpr.br>
Acked-by: default avatarBruno Ribas <ribas@c3sl.ufpr.br>
parent aef97ab9
No related branches found
No related tags found
No related merge requests found
......@@ -193,8 +193,13 @@ crontab -u seed_mec -r
if ! test -n "${PROJECTOR}" -o -f "/usr/sbin/projetor" -o \
-f "/etc/cmpc-release" -o -n "${UCA_SERVER}" -o \
-n "${UCA_CLASSMATE}"; then
# Remove any possible line containing a rule for seed_mec user before adding
# root permissions in the sudoers file
TMPFILE=$(mktemp)
sed '/^seed_mec[\t ]*ALL=(ALL/d' /etc/sudoers > "${TMPFILE}"
mv "${TMPFILE}" /etc/sudoers
chmod 440 /etc/sudoers
# Add root permissions to seed_mec user, without the need of password
if ! grep -q "seed_mec" /etc/sudoers; then
if ! $(echo -e "seed_mec\tALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers)
then
printf "ERRO: Falha ao adicionar permissões de super-usuário %b" \
......@@ -202,7 +207,6 @@ if ! test -n "${PROJECTOR}" -o -f "/usr/sbin/projetor" -o \
exit 3
fi
fi
fi
# Uncompress tar package and check its integrity
tail -n +${BOOTSTRAP_LINES} $0 > "${SEED_MEC_HOME}/${FILE}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment