Skip to content
Snippets Groups Projects
  1. Mar 31, 2020
  2. Mar 30, 2020
  3. Mar 29, 2020
    • rswindell's avatar
      Revert the last commit (mostly): don't treat array arguments to js.exec() · ac1a0004
      rswindell authored
      specially, just pass them on to the script as-is. Included a JSDOC note about
      the use of js.exec.apply() to pass a variable number of arguments (ala execv).
      
      Thanks Tracker1 for the pointer to 'spread' which led me to function.apply()
      and the JS-standard method of achieving the result I needed with this
      enhancement.
      
      I still think that a script that calls exit() is unlikely to expect non-string
      arguments in the first place, but if we don't need special case behavior, it's
      better not to add it and keep the behavior consistent with load() and
      require(). That was the decision of the executive board anyway. :-|
      ac1a0004
    • rswindell's avatar
      Fix typo: Zones are colon-separated, not dot-separated. · cea82922
      rswindell authored
      patch/bug-report by Mark Lewis.
      cea82922
    • rswindell's avatar
      Add system.get_node() method to read a single node record in one shot: · 46844bb7
      rswindell authored
      use this in place of system.node_list[] if you're going to be using a lot of
      the properties and passing them around to methods which are going to each
      possibly dereference the values, as *each* deference results in a read of the
      node record in the node.dab. On my system, a simple node list (e.g. /L
      command) would result in between 60 and 100 reads of the node.dab (for a 13
      node system), which was nuts.
      
      The system.get_node() method currently leaves the node record unlocked and
      there is currently no equivalent put_node() method, so you still need to use
      the system.node_list[] for modification of node records. But, I now see there
      are race conditions with the current methods of read-modify-writes of the
      node_list[] properties. We should be locking a node.dab record, reading it,
      modifying it, writing it, and then unlocking it - as is done in the C/C++
      code. So... that's a todo item.
      
      Also created system.stats.node_gets to track the number of node.dab reads
      from a single instance of the system object. May remove this any time.
      46844bb7
    • rswindell's avatar
      js.exec() enhancement: if any of the arguments to be passed to the executed · e5b2931a
      rswindell authored
      script are arrays, pass each element of the array as a separate argument to the
      child script. This allows one script to generate a variable-length list of
      arguments to be passed to another.
      e5b2931a
    • rswindell's avatar
      Fix double-free (of startup_dir) in js.exec() method. · f6e34d37
      rswindell authored
      Improve "script missing" error reporting in js.exec().
      f6e34d37
    • rswindell's avatar
  4. Mar 28, 2020
  5. Mar 25, 2020
  6. Mar 24, 2020
  7. Mar 23, 2020
    • rswindell's avatar
      Only do the whole Linux-capabilities dance when run as root (user-id 0). · f22757c4
      rswindell authored
      This eliminates the error messages that would be displayed/logged when
      attempting the SYS_capset SYSCALL, which fails when not root.
      
      So the capabilities dance enabled with USE_LINUX_CAPS (which is automatically
      enabled when /usr/include/sys/capabilites.h exists, which is installed with
      the libcap2-dev package) apparently is still useful if you need to start
      sbbs as root: the main thread will remain as root even when the child
      threads have their user-id's changed to the user specified in the [UNIX]
      section of sbbs.ini or on the command-line
      - so reducing the enabled privilege set for this root/main thread to the
      minimum needed, is a good security measure. It does this reduction (call to
      linux_minprivs() after the call to change_user()) so I'm not exactly sure how
      that works, but according to Deuce, this is what's happening. :-/
      f22757c4
    • rswindell's avatar
      Fix apparent typo. Not sure what affect it had on the operation fo this · eb996d8b
      rswindell authored
      thing or how to test the change. <shrug>
      eb996d8b
    • rswindell's avatar
      Clean-up some of this USE_LINUX_CAPS patch, but honestly, I think it's · a2b117c8
      rswindell authored
      time for it to go away. Using 'sudo setcap sbbs' during build seems like the
      better, more supported solution.
      a2b117c8
Loading