Skip to content

Commit

Permalink
Modifying UserManagerProxy causes hugegraph data cleanup issues
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliguov5 committed Feb 23, 2021
1 parent 7f63b57 commit a34ba24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -679,14 +679,14 @@ public void clearBackend() {
@Override
public void truncateBackend() {
verifyAdminPermission();
HugeUser admin = this.hugegraph.userManager()
.findUser(HugeAuthenticator.USER_ADMIN);
UserManager userManager = this.hugegraph.userManager();
HugeUser admin = userManager.findUser(HugeAuthenticator.USER_ADMIN);
try {
this.hugegraph.truncateBackend();
} finally {
if (admin != null) {
if (admin != null && userManager instanceof StandardUserManager) {
// Restore admin user to continue to do any operation
this.hugegraph.userManager().createUser(admin);
userManager.createUser(admin);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class HugeSecurityManager extends SecurityManager {
private static final Set<String> WHITE_SYSTEM_PROPERTYS = ImmutableSet.of(
"line.separator",
"file.separator",
"java.specification.version", // Sofa
"socksProxyHost", // MySQL
"file.encoding" // PostgreSQL
);
Expand Down Expand Up @@ -306,6 +307,7 @@ public void checkSetFactory() {

@Override
public void checkPropertiesAccess() {
System.getProperties();
if (callFromGremlin()) {
throw newSecurityException(
"Not allowed to access system properties via Gremlin");
Expand Down

0 comments on commit a34ba24

Please sign in to comment.