mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	Merge pull request #1724 from mattaezell/xdie_rootimgdir
Protect umount_chroot from running with rootimage_dir undefined
This commit is contained in:
		| @@ -112,6 +112,10 @@ sub mount_chroot { | ||||
|  | ||||
| sub umount_chroot { | ||||
|     my $rootimage_dir = shift; | ||||
|     if ($rootimage_dir eq "") { | ||||
|         print "\n\n\n\nWARNING: /proc and /sys may still be mounted in the rootimgdir\n\n\n\n"; | ||||
|         return 1; | ||||
|     } | ||||
|  | ||||
|     if (majversion($osver) > 6) { | ||||
|         system("umount -l $rootimage_dir/proc"); | ||||
|   | ||||
| @@ -2110,6 +2110,11 @@ sub mount_chroot { | ||||
|  | ||||
| sub umount_chroot { | ||||
|     my $rootimage_dir = shift; | ||||
|     if ($rootimage_dir eq "") { | ||||
|         print "\n\n\n\nWARNING: /proc and /sys may still be mounted in the rootimgdir\n\n\n\n"; | ||||
|         return 1; | ||||
|     } | ||||
|  | ||||
|  | ||||
|     system("umount -l $rootimage_dir/proc"); | ||||
|     system("umount -l $rootimage_dir/sys"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user