mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-15 22:08:47 +00:00
runtime: fix two bugs in rootless hypervisor
Update the sandbox dir clean up logic to be more appropriate Add different seeds for randInt() method Fixes #2770 Signed-off-by: Feng Wang <feng.wang@databricks.com>
This commit is contained in:
@@ -1016,12 +1016,6 @@ func (q *qemu) cleanupVM() error {
|
||||
}
|
||||
|
||||
if rootless.IsRootless() {
|
||||
rootlessDir := os.Getenv("XDG_RUNTIME_DIR")
|
||||
if err := os.RemoveAll(rootlessDir); err != nil {
|
||||
q.Logger().WithError(err).WithField("root-path", rootlessDir).
|
||||
Warnf("failed to remove vm run-as-user root path")
|
||||
}
|
||||
|
||||
u, err := user.LookupId(strconv.Itoa(int(q.config.Uid)))
|
||||
if err != nil {
|
||||
q.Logger().WithError(err).WithField("uid", q.config.Uid).Warn("failed to find the user")
|
||||
|
Reference in New Issue
Block a user