8214545: sun/management/jmxremote/bootstrap tests hang in revokeall.exe on Windows
Reviewed-by: dholmes, amenkov, bulasevich, dfuchs, erikj
This commit is contained in:
parent
ff2fa1e422
commit
dc9f6b3991
@ -62,9 +62,11 @@ ifeq ($(call isTargetOs, windows), true)
|
|||||||
WIN_LIB_JLI := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
|
WIN_LIB_JLI := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
|
||||||
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJliLaunchTest := $(WIN_LIB_JLI)
|
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJliLaunchTest := $(WIN_LIB_JLI)
|
||||||
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeCallerAccessTest := jvm.lib
|
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeCallerAccessTest := jvm.lib
|
||||||
|
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exerevokeall := advapi32.lib
|
||||||
else
|
else
|
||||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := -ljava
|
BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := -ljava
|
||||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libDirectIO := -ljava
|
BUILD_JDK_JTREG_LIBRARIES_LIBS_libDirectIO := -ljava
|
||||||
|
BUILD_JDK_JTREG_EXCLUDE += exerevokeall.c
|
||||||
ifeq ($(call isTargetOs, linux), true)
|
ifeq ($(call isTargetOs, linux), true)
|
||||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava
|
BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava
|
||||||
else ifeq ($(call isTargetOs, solaris), true)
|
else ifeq ($(call isTargetOs, solaris), true)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
#
|
#
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
@ -70,13 +70,11 @@ EOF
|
|||||||
if [ "$OS" = "Windows_NT" ]; then
|
if [ "$OS" = "Windows_NT" ]; then
|
||||||
USER=`id -u -n`
|
USER=`id -u -n`
|
||||||
CACLS="$SystemRoot/system32/cacls.exe"
|
CACLS="$SystemRoot/system32/cacls.exe"
|
||||||
TEST_SRC=`cygpath ${TESTSRC}`
|
REVOKEALL="$TESTNATIVEPATH/revokeall.exe"
|
||||||
REVOKEALL="$TEST_SRC/../../windows/revokeall.exe"
|
if [ ! -x "$REVOKEALL" ] ; then
|
||||||
if [ ! -f "$REVOKEALL" ] ; then
|
echo "$REVOKEALL doesn't exist or is not executable"
|
||||||
echo "$REVOKEALL missing"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
chmod ug+x $REVOKEALL
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -1,6 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004, 2019, 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.
|
||||||
|
*/
|
||||||
|
|
||||||
This directory contains the source and the binary version of a Windows
|
|
||||||
utility to remove all non-owner Access Control Entries from a given file.
|
This directory contains the source of a Windows utility to remove all
|
||||||
|
non-owner Access Control Entries from a given file.
|
||||||
|
|
||||||
The tool is used by regression tests in the following directories :-
|
The tool is used by regression tests in the following directories :-
|
||||||
|
|
||||||
@ -10,18 +33,3 @@ The tests in these directories create password or ACL files that need to
|
|||||||
be "secured" (meaning that only the owner should have access to the
|
be "secured" (meaning that only the owner should have access to the
|
||||||
files).
|
files).
|
||||||
|
|
||||||
Both the source and the binary version are checked into SCCS. If
|
|
||||||
you require to make changes to the tool then you need to Visual
|
|
||||||
C++ to rebuild revokeall.exe after changing the source.
|
|
||||||
|
|
||||||
To rebuild the tool you need to setup your environment (by
|
|
||||||
calling the VC++ VCVARS32.BAT script), and then executing the
|
|
||||||
following command :-
|
|
||||||
|
|
||||||
cl /mt revokeall.c advapi32.lib
|
|
||||||
|
|
||||||
This will generate revokeall.exe.
|
|
||||||
|
|
||||||
Note that a 32-bit version of revokeall.exe is checked into SCCS
|
|
||||||
- this 32-bit application is also used when running on 64-bit
|
|
||||||
versions of Windows (AMD64 and IA64).
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -27,8 +27,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Simple Windows utility to remove all non-owner access to a given
|
* Simple Windows utility to remove all non-owner access to a given file.
|
||||||
* file - suitable for NT/2000/XP only.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -151,7 +150,7 @@ static char *getSIDString(SID* sid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (LookupAccountSid(NULL, sid, name, &nameLen, domain, &domainLen, &use)) {
|
if (LookupAccountSid(NULL, sid, name, &nameLen, domain, &domainLen, &use)) {
|
||||||
int len = strlen(name) + strlen(domain) + 3;
|
size_t len = strlen(name) + strlen(domain) + 3;
|
||||||
char* s = (char*)malloc(len);
|
char* s = (char*)malloc(len);
|
||||||
if (s != NULL) {
|
if (s != NULL) {
|
||||||
strcpy(s, domain);
|
strcpy(s, domain);
|
||||||
@ -352,6 +351,8 @@ static int revokeAll(const char* path) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (((ACCESS_ALLOWED_ACE *)ace)->Header.AceType != ACCESS_ALLOWED_ACE_TYPE) {
|
if (((ACCESS_ALLOWED_ACE *)ace)->Header.AceType != ACCESS_ALLOWED_ACE_TYPE) {
|
||||||
|
i++;
|
||||||
|
count--;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
access = (ACCESS_ALLOWED_ACE *)ace;
|
access = (ACCESS_ALLOWED_ACE *)ace;
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user