Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Call getpwuid only after chroot is set
While starting a cmd from the container rootfs, initrd script tries to chroot to the rootfs and executes the cmd. The eve specific chroot (chroot2.c) tries to set root to the container rootfs and execute the command. /chroot2 /mnt/rootfs $ug $pidfile $cmd The issue here is that chroot2.c is calling getpwuid() on the userid even before setting chroot. That makes getpwuid to process the user id in eve context than the user container context. This works fine with userid root, but for non-root users it fails since that user may (will not) be present in eve context. This fix moves the getpwuid() call after chroot(). Signed-off-by: Pramodh Pallapothu <pramodh@zededa.com>
- Loading branch information