Paul Hampson wrote:
> New behaviour: (Replaces behaviour identical to <0 above)
> If the program returns 1 through RLM_MODULE_NUMCODES, return the
> appropriate code and attributes as expected.
> 1    RLM_MODULE_REJECT,  /* immediately reject the request */
> 2    RLM_MODULE_FAIL,    /* module failed, don't reply */
> 3    RLM_MODULE_OK,      /* the module is OK, continue */
> 4    RLM_MODULE_HANDLED, /* the module handled the request, so stop.
> */ 5    RLM_MODULE_INVALID, /* the module considers the request
> invalid. */ 6    RLM_MODULE_USERLOCK,    /* reject the request (user
> is locked out) */ 7    RLM_MODULE_NOTFOUND,    /* user not found */
> 8    RLM_MODULE_NOOP,    /* module succeeded without doing anything */
> 9    RLM_MODULE_UPDATED, /* OK (pairs modified) */

Looks ok.

> If it returns > RLM_MODULE_NUMCODES, return RLM_MODULE_OK. (as for 0)

Maybe it's better to return RLM_MODULE_FAIL in this case.

> This should work for everyone using 0 = success and -1 = failure, but
> I'll prolly catch people who're using >0 for failure, which is
> possible but (slightly) deranged. ^_^;

I guess they can easily change their programs if this is the case.
Otherwise a configuration option which activates this new behaviour might
solve this:
rlm_module_returncodes = yes
If this configuration item is "yes", then use the new return code
interpretation (maybe without the -1):
If this configuration item is absent or anything else than "yes", then use
the old return code interpretation (0=ok, !0=fail)

> Patch for discussion. I decided to try this route when I couldn't
> think what to use for a module call that failed but returned
> attributes.
>
> This then leads the question, what return code do we want for when the
> child process terminates abnormally? (!WIFEXITED or rad_waitpid
> returns something other than the child's pid)... If we leave it as it
> is, it's RLM_MODULE_REJECT with the below patch... Would
> RLM_MODULE_FAIL be better? (Changes return 1 at src/main/exec.c:390
> to return 2... This

I guess RLM_MODULE_FAIL would be better here.

-- 
Regards,

Thor Spruyt
E: [EMAIL PROTECTED]
W: www.thor-spruyt.com
M: +32 (0)475 67 22 65


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to