7115070: (fs) lookupPrincipalByName/lookupPrincipalByGroupName should treat ESRCH as not found
authorngmr
Thu, 24 Nov 2011 11:34:31 +0000
changeset 11109 f93eafffdf23
parent 11108 6561c702c8a7
child 11110 aeb0408b2d4b
7115070: (fs) lookupPrincipalByName/lookupPrincipalByGroupName should treat ESRCH as not found Reviewed-by: alanb Contributed-by: Jonathan Lu <luchsh@linux.vnet.ibm.com>
jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c
--- a/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c	Mon Nov 28 02:35:19 2011 -0800
+++ b/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c	Thu Nov 24 11:34:31 2011 +0000
@@ -996,7 +996,7 @@
 
         if (res != 0 || p == NULL || p->pw_name == NULL || *(p->pw_name) == '\0') {
             /* not found or error */
-            if (errno != 0 && errno != ENOENT)
+            if (errno != 0 && errno != ENOENT && errno != ESRCH)
                 throwUnixException(env, errno);
         } else {
             uid = p->pw_uid;
@@ -1042,7 +1042,7 @@
         retry = 0;
         if (res != 0 || g == NULL || g->gr_name == NULL || *(g->gr_name) == '\0') {
             /* not found or error */
-            if (errno != 0 && errno != ENOENT) {
+            if (errno != 0 && errno != ENOENT && errno != ESRCH) {
                 if (errno == ERANGE) {
                     /* insufficient buffer size so need larger buffer */
                     buflen += ENT_BUF_SIZE;