Skip to content
Snippets Groups Projects
Select Git revision
  • eda3aa3333fffd8f1b5f22326d8897d85ef9c0f8
  • experimental
  • master
  • v2021.1.2-ffs
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • v2020.2.3-ffs
  • nrbffs/fastd-remove-delay
  • v2020.2.2-ffs
  • v2020.2.1-ffs
  • v2020.2-ffs
  • v2020.2.x
  • v2020.1.3-ffs
  • v2020.1.1-ffs
  • v2020.1-ffs
  • v2019.1.2-ffs
  • v2019.1.1-ffs
  • nrb/test-radv-filter
  • v2019.1-ffs
  • nrbffs/netgear-ex6120
  • v2021.1.2-ffs0.2
  • v2021.1.2-ffs0.1
  • v2021.1.1-ffs0.4
  • v2021.1.1-ffs0.3
  • v2021.1.1-ffs0.2
  • v2021.1.1-ffs0.1
  • v2021.1-ffs0.1
  • v2020.2.3-ffs0.3
  • v2020.2.3-ffs0.2
  • v2020.2.3-ffs0.1
  • v2020.2.2-ffs0.1
  • v2020.2.1-ffs0.1
  • v2020.2-ffs0.1
  • v2020.2
  • v2020.2.x-ffs0.1
  • v2020.1.3-ffs0.1
  • v2020.1.1-ffs0.1
  • v2020.1-ffs0.1
  • v2019.1.2-ffs0.1
  • v2019.1.1-ffs0.1
41 results

gluon-wan

Blame
  • Forked from firmware / FFS Gluon
    Source project has a limited visibility.
    • Matthias Schiffer's avatar
      eda3aa33
      gluon-mesh-vpn-core: add gluon-wan exec wrapper · eda3aa33
      Matthias Schiffer authored
      gluon-wan is a sudo-like exec wrapper that switches the process group to
      gluon-mesh-vpn, making it use the WAN dnsmasq rather than resolving over
      the mesh.
      
      Note that this only affects DNS at the moment. Processes running under
      gluon-wan will still use the regular mesh IPv6 routing table, and not the
      WAN routing table. This is not a problem for IPv4, as there is only one
      IPv4 routing table.
      
      Fixes #1575
      gluon-mesh-vpn-core: add gluon-wan exec wrapper
      Matthias Schiffer authored
      gluon-wan is a sudo-like exec wrapper that switches the process group to
      gluon-mesh-vpn, making it use the WAN dnsmasq rather than resolving over
      the mesh.
      
      Note that this only affects DNS at the moment. Processes running under
      gluon-wan will still use the regular mesh IPv6 routing table, and not the
      WAN routing table. This is not a problem for IPv4, as there is only one
      IPv4 routing table.
      
      Fixes #1575
    gluon-wan 690 B
    #!/usr/bin/lua
    
    local GROUP = 'gluon-mesh-vpn'
    
    local grp = require 'posix.grp'
    local unistd = require 'posix.unistd'
    
    if #arg < 1 then
    	io.stderr:write('Usage: gluon-wan <command> ...\n')
    	os.exit(1)
    end
    
    local g = grp.getgrnam(GROUP)
    if not g then
    	io.stderr:write(string.format("gluon-wan: unable to find group '%s'\n", GROUP))
    	os.exit(1)
    end
    
    local ok, err = unistd.setpid('g', g.gr_gid)
    if ok ~= 0 then
    	io.stderr:write(string.format("gluon-wan: unable to change to group: %s\n", err))
    	os.exit(1)
    end
    
    arg[0] = arg[1]
    table.remove(arg, 1)
    print(arg[0], unpack(arg))
    
    ok, err = unistd.execp(arg[0], arg)
    
    io.stderr:write(string.format("gluon-wan: exec failed: %s\n", err))
    os.exit(1)