]> git.proxmox.com Git - pve-container.git/commitdiff
also expect ENOTDIR when opening dirs with O_NOFOLLOW
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 7 Feb 2017 14:03:24 +0000 (15:03 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 8 Feb 2017 08:40:18 +0000 (09:40 +0100)
open with O_DIRECTORY on newer kernel uses ENOTDIR instead
of ELOOP for symlinks

src/PVE/LXC.pm

index 6ebc89628e288f11daaf768dc4982af5ec9bfc9d..b2f2c13804236462ef68292cab0f7a411c002510 100644 (file)
@@ -11,7 +11,7 @@ use File::Path;
 use File::Spec;
 use Cwd qw();
 use Fcntl qw(O_RDONLY O_NOFOLLOW O_DIRECTORY);
-use Errno qw(ELOOP EROFS);
+use Errno qw(ELOOP ENOTDIR EROFS);
 
 use PVE::Exception qw(raise_perm_exc);
 use PVE::Storage;
@@ -1052,7 +1052,7 @@ sub walk_tree_nofollow($$$) {
 
        if (!$next) {
            # failed, check for symlinks and try to create the path
-           die "symlink encountered at: $dir\n" if $! == ELOOP;
+           die "symlink encountered at: $dir\n" if $! == ELOOP || $! == ENOTDIR;
            die "cannot open directory $dir: $!\n" if !$mkdir;
 
            # We don't check for errors on mkdirat() here and just try to