File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818# Fixes and names just the root owned files. chown -R over the whole tree clears
1919# setuid bits, which stripped /usr/bin/sudo inside every image in the rootless
2020# container store under /home/jenkins.
21- function chown-root-owned-to-jenkins()
22- {
23- root_owned=$( find /home/jenkins -user root -print 2> /dev/null | head -n 20)
21+ #
22+ # chown -h: to avoid following symlinks
23+ # -path /home/jenkins/testmachine-chroot --prune: do not touch this directory
24+ function chown-root-owned-to-jenkins() {
25+ root_owned=$( find /home/jenkins -path /home/jenkins/testmachine-chroot -prune -o -user root -print 2> /dev/null | head -n 20)
2426 if [ -n " $root_owned " ]; then
2527 echo " Root owned files in /home/jenkins (first 20), chowning all to jenkins:"
2628 echo " $root_owned "
27- find /home/jenkins -user root -exec chown jenkins {} \;
29+ find /home/jenkins -path /home/jenkins/testmachine-chroot -prune -o - user root -exec chown -h jenkins {} \;
2830 fi
2931}
3032
You can’t perform that action at this time.
0 commit comments