提交 68fae39f 编写于 作者: A asaha

Merge

......@@ -719,6 +719,7 @@ bd40efd56b4544ff9048d2f7be4cf108b281a6f3 jdk8u151-b02
27273bbb711a402efe5fcd332003ba419102f662 jdk8u151-b04
0efdf2c7a21464e5f3d89474ffdfe81db61031fd jdk8u151-b05
c6c870e267de694bc85dc4af23a648824063f95b jdk8u151-b06
84b0fbbfb8d664031a9f5283f79b13b98714cc7f jdk8u151-b07
1442bc728814af451e2dd1a6719a64485d27e3a0 jdk8u122-b00
f6030acfa5aec0e64d45adfac69b9e7e5c12bc74 jdk8u122-b01
6b072c3a6db7ab06804c91aab77431799dfb5d47 jdk8u122-b02
......
......@@ -116,8 +116,8 @@ public class FtpClient extends sun.net.ftp.FtpClient {
new PrivilegedAction<Object>() {
public Object run() {
vals[0] = Integer.getInteger("sun.net.client.defaultReadTimeout", 0).intValue();
vals[1] = Integer.getInteger("sun.net.client.defaultConnectTimeout", 0).intValue();
vals[0] = Integer.getInteger("sun.net.client.defaultReadTimeout", 300_000).intValue();
vals[1] = Integer.getInteger("sun.net.client.defaultConnectTimeout", 300_000).intValue();
encs[0] = System.getProperty("file.encoding", "ISO8859_1");
return null;
}
......
/*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -31,6 +31,7 @@ import java.rmi.server.ObjID;
import java.rmi.server.Unreferenced;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.*;
import sun.rmi.runtime.Log;
import sun.rmi.runtime.NewThreadAction;
......@@ -322,27 +323,15 @@ public final class Target {
Remote obj = getImpl();
if (obj instanceof Unreferenced) {
final Unreferenced unrefObj = (Unreferenced) obj;
final Thread t =
java.security.AccessController.doPrivileged(
new NewThreadAction(new Runnable() {
public void run() {
unrefObj.unreferenced();
}
}, "Unreferenced-" + nextThreadNum++, false, true));
// REMIND: access to nextThreadNum not synchronized; you care?
/*
* We must manually set the context class loader appropriately
* for threads that may invoke user code (see bugid 4171278).
*/
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Void>() {
public Void run() {
t.setContextClassLoader(ccl);
return null;
}
});
t.start();
AccessController.doPrivileged(
new NewThreadAction(() -> {
Thread.currentThread().setContextClassLoader(ccl);
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
unrefObj.unreferenced();
return null;
}, acc);
}, "Unreferenced-" + nextThreadNum++, false, true)).start();
// REMIND: access to nextThreadNum not synchronized; you care?
}
unpinImpl();
......
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -160,7 +160,7 @@ class KrbAsRep extends KrbKdcRep {
creds = new Credentials(
rep.ticket,
req.reqBody.cname,
rep.ticket.sname,
enc_part.sname,
enc_part.key,
enc_part.flags,
enc_part.authtime,
......
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -88,7 +88,7 @@ public class KrbTgsRep extends KrbKdcRep {
this.creds = new Credentials(rep.ticket,
rep.cname,
rep.ticket.sname,
enc_part.sname,
enc_part.key,
enc_part.flags,
enc_part.authtime,
......
/*
* Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......
/*
* Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......
/*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -808,7 +808,9 @@ public class KDC {
throw new KrbException(Krb5.KDC_ERR_SUMTYPE_NOSUPP); // TODO
}
Ticket t = new Ticket(
service,
System.getProperty("test.kdc.diff.sname") != null ?
new PrincipalName("xx" + service.toString()) :
service,
new EncryptedData(skey, enc.asn1Encode(), KeyUsage.KU_TICKET)
);
EncTGSRepPart enc_part = new EncTGSRepPart(
......
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8178794
* @summary krb5 client should ignore sname in incoming tickets
* @compile -XDignore.symbol.file TicketSName.java
* @run main/othervm -Dtest.kdc.diff.sname TicketSName
*/
import sun.security.jgss.GSSUtil;
import javax.security.auth.kerberos.KerberosTicket;
public class TicketSName {
public static void main(String[] args) throws Exception {
new OneKDC(null).writeJAASConf();
Context c, s;
c = Context.fromJAAS("client");
s = Context.fromJAAS("server");
c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
Context.handshake(c, s);
String expected = OneKDC.SERVER + "@" + OneKDC.REALM;
if (!c.s().getPrivateCredentials(KerberosTicket.class)
.stream()
.anyMatch(t -> t.getServer().toString().equals(expected))) {
c.status();
throw new Exception("no " + expected);
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册