public void customValidation() {
JmxAttributeValidationException.checkNotNull(getBindingPort(), bindingPortJmxAttribute);
// check if unix root user
- if (!PlatformDependent.isWindows() && !PlatformDependent.isRoot() && getBindingPort().getValue() < PRIVILEGED_PORTS) {
+ if (!PlatformDependent.isWindows() && !PlatformDependent.maybeSuperUser() && getBindingPort().getValue() < PRIVILEGED_PORTS) {
throw new AccessControlException("Unable to bind port " + getBindingPort().getValue() + " while running as non-root user.");
}
}
@Override
public void customValidation() {
// check if unix root user
- if (!PlatformDependent.isWindows() && !PlatformDependent.isRoot() && getBindingPort().getValue() < PRIVILEGED_PORTS) {
+ if (!PlatformDependent.isWindows() && !PlatformDependent.maybeSuperUser() && getBindingPort().getValue() < PRIVILEGED_PORTS) {
throw new AccessControlException("Unable to bind port " + getBindingPort().getValue() + " while running as non-root user.");
}
// Try to parse address
assertStatus(status, 3, 0, 0);
verify(dispatcher).createServer(any(BGPPeerRegistry.class), any(InetSocketAddress.class));
} catch (final ValidationException e) {
- if(!PlatformDependent.isWindows() && !PlatformDependent.isRoot()) {
+ if(!PlatformDependent.isWindows() && !PlatformDependent.maybeSuperUser()) {
Assert.assertTrue(e.getMessage().contains("Unable to bind port"));
} else {
fail();