7043788: (fs) PosixFileAttributes.owner() or group() throws NPE if not group in passwd/group database
Alan Bateman
Alan.Bateman at oracle.com
Wed May 11 04:33:53 PDT 2011
This is another little embarrassing one. A test that reads the
PosixFileAttributes and prints out the owner and group-owner fails with
NPE if the the lookup of the uid or gid fails because it's not in the
passwd or group database. It turns out that the "not found" handling in
the native code isn't correct with the result that it returns null for
these cases instead of failing. The webrev with the changes is here:
http://cr.openjdk.java.net/~alanb/7043788/webrev/
I've decided not to include a test for this because it requires
privileges to chown or chgrp a file to some unknown uid/gid.
Thanks,
-Alan
More information about the nio-dev
mailing list