Uploaded image for project: 'bgpcep'
  1. bgpcep
  2. BGPCEP-109

BGP listener should fail to configure if we do not have privileges

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Resolution: Done
    • Bugzilla Migration
    • Bugzilla Migration
    • General
    • None
    • Operating System: All
      Platform: All

    Description

      Running ODL as non-root currently produces the following exception:

      2014-07-17 14:37:56.854 CEST [globalEventExecutor-1-5] WARN i.n.util.concurrent.DefaultPromise - An exception was thrown by org.opendaylight.controller.config.yang.bgp.rib.impl.BGPPeerAcceptorModule$1.operationComplete()
      java.lang.IllegalStateException: Unable to start bgp server on /0.0.0.0:179
      at org.opendaylight.controller.config.yang.bgp.rib.impl.BGPPeerAcceptorModule$1.operationComplete(BGPPeerAcceptorModule.java:44) ~[na:na]
      at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:679) ~[bundlefile:4.0.19.Final]
      at io.netty.util.concurrent.DefaultPromise$3.run(DefaultPromise.java:595) [bundlefile:4.0.19.Final]
      at io.netty.util.concurrent.GlobalEventExecutor$TaskRunner.run(GlobalEventExecutor.java:325) [bundlefile:4.0.19.Final]
      at java.lang.Thread.run(Thread.java:745) [na:1.7.0_60]
      Caused by: java.net.SocketException: Permission denied
      at sun.nio.ch.Net.$$YJP$$bind0(Native Method) ~[na:1.7.0_60]
      at sun.nio.ch.Net.bind0(Net.java) ~[na:1.7.0_60]
      at sun.nio.ch.Net.bind(Net.java:444) ~[na:1.7.0_60]
      at sun.nio.ch.Net.bind(Net.java:436) ~[na:1.7.0_60]
      at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214) ~[na:1.7.0_60]
      at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.7.0_60]
      at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:125) ~[na:na]
      at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:476) ~[na:na]
      at io.netty.channel.DefaultChannelPipeline$HeadHandler.bind(DefaultChannelPipeline.java:1000) ~[na:na]
      at io.netty.channel.DefaultChannelHandlerContext.invokeBind(DefaultChannelHandlerContext.java:463) ~[na:na]
      at io.netty.channel.DefaultChannelHandlerContext.bind(DefaultChannelHandlerContext.java:448) ~[na:na]
      at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:842) ~[na:na]
      at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:195) ~[na:na]
      at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:338) ~[na:na]
      at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:370) ~[na:na]
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) ~[na:na]
      at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) ~[na:na]
      ... 1 common frames omitted

      The problem is that we should not allow the validate step to complete. Use the following check:

      import io.netty.util.internal.PlatformDependent;
      if (!PlatformDependent.isWindows() && !PlatformDependent.isRoot()) {
      ... we are not root, yada, yada, yada
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            milos.fabian@pantheon.tech Milos Fabian
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: