hotspot/src/os/aix/vm/attachListener_aix.cpp
changeset 40103 3c3569845229
parent 36197 40b356f0cdf5
child 40625 6b45fb9188f9
equal deleted inserted replaced
40102:23ff468d69b4 40103:3c3569845229
   381     // get the credentials of the peer and check the effective uid/guid
   381     // get the credentials of the peer and check the effective uid/guid
   382     // - check with jeff on this.
   382     // - check with jeff on this.
   383     struct peercred_struct cred_info;
   383     struct peercred_struct cred_info;
   384     socklen_t optlen = sizeof(cred_info);
   384     socklen_t optlen = sizeof(cred_info);
   385     if (::getsockopt(s, SOL_SOCKET, SO_PEERID, (void*)&cred_info, &optlen) == -1) {
   385     if (::getsockopt(s, SOL_SOCKET, SO_PEERID, (void*)&cred_info, &optlen) == -1) {
   386       int res;
   386       ::close(s);
   387       RESTARTABLE(::close(s), res);
       
   388       continue;
   387       continue;
   389     }
   388     }
   390     uid_t euid = geteuid();
   389     uid_t euid = geteuid();
   391     gid_t egid = getegid();
   390     gid_t egid = getegid();
   392 
   391 
   393     if (cred_info.euid != euid || cred_info.egid != egid) {
   392     if (cred_info.euid != euid || cred_info.egid != egid) {
   394       int res;
   393       ::close(s);
   395       RESTARTABLE(::close(s), res);
       
   396       continue;
   394       continue;
   397     }
   395     }
   398 
   396 
   399     // peer credential look okay so we read the request
   397     // peer credential look okay so we read the request
   400     AixAttachOperation* op = read_request(s);
   398     AixAttachOperation* op = read_request(s);
   401     if (op == NULL) {
   399     if (op == NULL) {
   402       int res;
       
   403       ::close(s);
   400       ::close(s);
   404       continue;
   401       continue;
   405     } else {
   402     } else {
   406       return op;
   403       return op;
   407     }
   404     }