Move out ghost file to platformdata
Since /tmp is world writable this might cause privilege escalation https://forum.cloudron.io/topic/2222/impersonate-user-privilege-escalation
This commit is contained in:
@@ -36,8 +36,8 @@ while true; do
|
||||
--admin-login)
|
||||
admin_username=$(mysql -NB -uroot -ppassword -e "SELECT username FROM box.users WHERE role='owner' LIMIT 1" 2>/dev/null)
|
||||
admin_password=$(pwgen -1s 12)
|
||||
printf '{"%s":"%s"}\n' "${admin_username}" "${admin_password}" > /tmp/cloudron_ghost.json
|
||||
echo "Login as ${admin_username} / ${admin_password} . Remove /tmp/cloudron_ghost.json when done."
|
||||
printf '{"%s":"%s"}\n' "${admin_username}" "${admin_password}" > /home/yellowtent/platformdata/cloudron_ghost.json
|
||||
echo "Login as ${admin_username} / ${admin_password} . Remove /home/yellowtent/platformdata/cloudron_ghost.json when done."
|
||||
exit 0
|
||||
;;
|
||||
--) break;;
|
||||
|
||||
Reference in New Issue
Block a user