For #24681 update to work with sudo_as