Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Oct 2016 03:48:33 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-amd64@FreeBSD.org
Subject:   [Bug 213714] getcwd(3) returns EACCES on ZFS when normalization is not none and any parent dir does not have read permission
Message-ID:  <bug-213714-6@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213714

            Bug ID: 213714
           Summary: getcwd(3) returns EACCES on ZFS when normalization is
                    not none and any parent dir does not have read
                    permission
           Product: Base System
           Version: 11.0-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: cynix@me.com
                CC: freebsd-amd64@FreeBSD.org
                CC: freebsd-amd64@FreeBSD.org

On 11.0-RELEASE-p1, getcwd(3) returns EACCES under the following conditions:

* Current directory is under a ZFS filesystem (seems to also affect other
filesystems mounted under ZFS root).
* The ZFS dataset's "normalization" property is not "none" (can be any of
formC/formD/formKC/formKD).
* Any parent directory in the path does not have read permission for the us=
er.

Whereas on 10.3 (I have tested 10.3-RELEASE-p5 and earlier) it would succeed
and populate the correct full path.

For example:

# zfs create -o normalization=3DformD z/test1
# mkdir -m711 /test1/foo
# mkdir /test1/foo/bar
# chown nobody /test1/foo/bar
# cd /test1/foo/bar
# su -m nobody
% /bin/pwd
pwd: .: Permission denied

The problem does not occur if normoalization is none:

# zfs create -o normalization=3Dnone z/test2
# mkdir -m711 /test2/foo
# mkdir /test2/foo/bar
# chown nobody /test2/foo/bar
# cd /test2/foo/bar
# su -m nobody
% /bin/pwd
/test2/foo/bar

It seems that zfs_acl_next_ace() for the parent dir returns an access_mask =
of
0x1200af when normalization is none, and 0x1200a8 otherwise, all else being
equal.

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-213714-6>