Skip to content

Commit

Permalink
#1836 all groups above 100
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Nov 17, 2023
1 parent 7ba750f commit e726ce4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/resources/com/rultor/agents/req/_head.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ else
cat <<EOT >> entry.sh
shopt -s dotglob
useradd -m -G sudo r
for g in \$(cat /etc/group | awk -F ':' '\$3 > 100 { print \$1 }'); do useradd -m -G "\${g}" r; done
usermod -s /bin/bash r
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
cp -R /root/* /home/r
Expand All @@ -62,20 +63,19 @@ else
chmod a+x /home/r/script.sh
su --login r --command /home/r/script.sh
mv /home/r/repo .
chown -R \$(whoami) repo
chown -R "\$(whoami)" repo
EOT
fi
chmod a+x entry.sh
cat <<EOT > script.sh
#!/bin/bash
set -x
set -e
set -o pipefail
if [ -e /home/r/.profile ]; then source /home/r/.profile; fi
shopt -s expand_aliases
alias 'sudo=sudo -i'
export HOME=/home/r
cd \$HOME/repo
cd "\${HOME}/repo"
EOT
echo "${scripts[@]}" >> script.sh

Expand Down

1 comment on commit e726ce4

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on e726ce4 Nov 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 1633-f29541d1 discovered in src/main/java/com/rultor/web/RsPage.java) and submitted as #1837. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

Please sign in to comment.