Skip to content

Commit

Permalink
refactor: reduced use of posix native API
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Sep 12, 2023
1 parent dc11eca commit 1b24334
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -560,4 +560,8 @@ public long blockSize(String path) {
return 4096;
}
}

public boolean isOsRoot() {
return OIOUtils.isOsLinux() && posix.getegid() == 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import com.orientechnologies.orient.core.storage.fs.OFile;
import java.util.ArrayList;
import java.util.List;
import jnr.posix.POSIXFactory;

/**
* @author Andrey Lomakin (a.lomakin-at-orientdb.com)
Expand Down Expand Up @@ -77,7 +76,7 @@ public void startup() {
final String userName = System.getProperty("user.name", "unknown");
OLogManager.instance()
.infoNoDb(this, "System is started under an effective user : `%s`", userName);
if (OIOUtils.isOsLinux() && POSIXFactory.getPOSIX().getegid() == 0) {
if (ONative.instance().isOsRoot()) {
OLogManager.instance()
.warnNoDb(
this,
Expand Down

0 comments on commit 1b24334

Please sign in to comment.