#841 mod_auth_external: script with arguments

Reporter Klaus
Owner Nobody
Created
Updated
Stars ★ (1)  
Tags
  • Status-New
  • Priority-Medium
  • Type-Defect
  1. Klaus on

    What steps will reproduce the problem? 1. Add e.g. `external_auth_command = "python /tmp/foo.py"` 2. Try to login What is the expected output? What do you see instead? I expect that `/tmp/foo.py` is passed as argument to `python`. Instead the complete string is called (execve[ "python /tmp/foo.py",...]). What version of the product are you using? On what operating system? Prosody 0.9.10 on Ubuntu 16.04.2 LTS Please provide any additional information below. A possible fix could be: 29a30,34 > local commands = {}; i = 1 > for c in string.gmatch(command, "%S+") do > commands[i] = c > i = i + 1 > end 61c66 < local ok, err = pty:startproc(command); --- > local ok, err = pty:startproc(unpack(commands)); 69c74,76 < pty:send(text); --- > sent = pty:send(text); > log("debug", "Sent %s bytes", sent or 0) >

  2. Klaus on

    Diff on github: https://github.com/jsxc/ejabberd-cloud-auth/commit/1c2748a5d7f9c58c3995ee7c89859797732b3c0f

New comment