Sorry to send yet more emails with issues. I've moved to FR3 to test SQL stuff and am having some problems with getting exec modules I previously used to work. I know I could rewrite these in perl, but they worked before in FR2.2.1 and I want to solve why they won't work now. I have an exec module thus : exec mactodelimitedmac { wait = yes input_pairs = config output_pairs = config shell_escape = yes program = "/usr/local/etc/raddb/mactodelimitedmac.sh %{User-Name} :" } It just takes a mac address and adds a delimited to each component of the address, updating the control value "DelimitedMac" via the standard echo Variable := \"value\"" I used to instantiate it in radiusd.conf and then call it directly from, say, the post-auth section Mactodelimitedmac Which updated that value. If I do it that way now it gives : (0) WARNING: mactodelimitedmac : List "<INVALID>" is not available LITERAL: %{User-Name} LITERAL: %{User-Name} --> %{User-Name} EXPANSION: %{User-Name} Looking for attribute name in User-Name xlat aprint 3 expand attr User-Name --> '0023ae604b02' (0) mactodelimitedmac : expand: '%{User-Name}' -> '0023ae604b02' (0) mactodelimitedmac : Program output is (0) ERROR: mactodelimitedmac : Abnormal child exit: Success (0) [mactodelimitedmac] = reject (0) Using Post-Auth-Type Reject If I instead do Update control { DelimitedMac := "%{mactodelimitedmac:/etc/freeradius/mactodelimitedmac.sh %{user-name} :}" } And change the script so that it just returns the bare variable it says : expand mod mactodelimitedmac --> '/usr/local/etc/raddb/mactodelimitedmac.sh 0023ae604b02 :' (0) Executing /usr/local/etc/raddb/mactodelimitedmac.sh 0023ae604b02 : (0) Program output is ?[1m?[33m(0) WARNING: Failed to execute /usr/local/etc/raddb/mactodelimitedmac.sh: Bad address?[0m (0) ERROR: Child returned error 1 (0) result 1 --> '?[1m?[33m(0) WARNING: Failed to execute /usr/local/etc/raddb/mactodelimitedmac.sh: Bad address?[0m ' Again, I'm struggling. Sorry to be a pain. Andy
On 13/06/13 16:24, Franks Andy (RLZ) IT Systems Engineer wrote:
Sorry to send yet more emails with issues. I’ve moved to FR3 to test SQL stuff and am having some problems with getting exec modules I previously used to work. I know I could rewrite these in perl, but they worked before in FR2.2.1 and Iwant to solve why they won’t work now.
Confirmed. Looks like a bug has crept into the exec code in HEAD: 28619 execve(0x6461202e2e2e2000, [0x6461202e2e2e2000, 0x77656e20676e6964, 0x2074656b636f7320, 0x7325, 0x612064656c696146, 0x727020676e696464, 0x6b636f732079786f, 0x7325203a7465, 0x612064656c696146, 0x766520676e696464, 0x646e616820746e65, 0x20726f662072656c, 0x2174656b636f73, 0x7265206c61746146, 0x6565726620726f72, 0x636f 7320676e697a, ...], [/* 2 vars */]) = -1 EFAULT (Bad address) 28619 write(1, "\33[1m\33[33m(0) WARNING: myexec : F"..., 91) = 91 Will investigate.
Phil Mayers wrote:
Confirmed. Looks like a bug has crept into the exec code in HEAD:
28619 execve(0x6461202e2e2e2000, [0x6461202e2e2e2000, 0x77656e20676e6964, 0x2074656b636f7320, 0x7325, 0x612064656c696146, 0x727020676e696464, 0x6b636f732079786f, 0x7325203a7465, 0x612064656c696146, 0x766520676e696464, 0x646e616820746e65, 0x20726f662072656c, 0x2174656b636f73, 0x7265206c61746146, 0x6565726620726f72, 0x636f 7320676e697a, ...], [/* 2 vars */]) = -1 EFAULT (Bad address) 28619 write(1, "\33[1m\33[33m(0) WARNING: myexec : F"..., 91) = 91
Will investigate.
It may be related to the use of argv in exec.c. Coverity says: 107 CID 1020962 (#1 of 1): Uninitialized scalar variable (UNINIT) 2. uninit_use_in_call: Using uninitialized element of array "argv" when calling "memcpy(void * restrict, void const * restrict, size_t)". 108 memcpy(&argv_p, &argv, sizeof(argv_p)); 109 So that's probably it. I haven't had a chance to look into it yet. Alan DeKok.
participants (3)
-
Alan DeKok -
Franks Andy (RLZ) IT Systems Engineer -
Phil Mayers