RFR (S): 8241568: (fs) UserPrincipalLookupService.lookupXXX failure with IOE "Operation not permitted"

Langer, Christoph christoph.langer at sap.com
Fri Mar 27 08:40:15 UTC 2020


Hi Alan,

thanks for the review. Of course I'll split the long lines to have 80 chars max.

Do you see a point in having an #ifdef linux section for the additional errnos to guard other operating systems? I couldn't spot a regression in our nightly cross platform testing, though.

Best regards
Christoph


From: Alan Bateman <Alan.Bateman at oracle.com>
Sent: Freitag, 27. März 2020 09:36
To: Langer, Christoph <christoph.langer at sap.com>; nio-dev at openjdk.java.net
Subject: Re: RFR (S): 8241568: (fs) UserPrincipalLookupService.lookupXXX failure with IOE "Operation not permitted"

On 27/03/2020 08:23, Langer, Christoph wrote:

Hi,

please review a change to UnixNativeDispatcher.c for doing uid/gid lookup via getpwnam_r/getgrnam_r.

As per the man pages [0], [1], the errno values EBADF or EPERM also mean "The given name or uid/gid was not found." (As well as rc=0 or errno values ENOENT or ESRCH). In the JDK this should translate into a UserPrincipalNotFoundException rather than an IOException. We encountered a system configuration (Ubuntu 18.04 with sssd with services "nss,pam,sudo,ssh", domain against a global active directory) where this would manifest and make test java/nio/file/attribute/PosixFileAttributeView/Basic.java fail.

I propose to fix this the following way: http://cr.openjdk.java.net/~clanger/webrevs/8241568.0/
Bug: https://bugs.openjdk.java.net/browse/JDK-8241568

Please let me know what you think?

I suspect we used the Solaris man page in the original implementation and I don't think its backends define as many error codes. So I think this change is okay but I'm surprised it hasn't come up before (maybe this configuration wasn't common before).  Do you mind splitting the really long lines? That will avoid horizontal scrolling of the side-by-side diffs when this file is changed in the future.

-Alan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20200327/61e6b90f/attachment-0001.htm>


More information about the nio-dev mailing list