~ubuntu-branches/ubuntu/natty/freeradius/natty-updates

« back to all changes in this revision

Viewing changes to src/modules/rlm_exec/rlm_exec.c

  • Committer: Bazaar Package Importer
  • Author(s): Josip Rodin
  • Date: 2009-11-23 03:57:37 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20091123035737-zsgtzhfych8hir68
Tags: 2.1.7+dfsg-1
* Adopting the package, closes: #536623.
* New upstream version, closes: #513484.
  + Fixes the blooper in unlang evaluation logic, closes: #526175.
* Used quilt (and added README.source), and moved upstream file patching
  into debian/patches/. The source is no longer in collab-maint git
  (to make it simpler for me to finally get this out the door), but
  kept the .gitignore should we need that again.
* Dropped the dialup_admin/bin/backup_radacct patch (integrated upstream).
* Dropped the raddb/Makefile patch (problem no longer exists upstream).
* Dropped the lib/packet.c lib/radius.c main/listen.c patches (was from
  upstream 2.0.5 anyway).
* Dropped references to otp.conf, it no longer exists upstream.
  Keep removing the conffile statoverride in prerm.
* Dropped references to snmp.conf, it no longer exists upstream.
  Keep removing the conffile statoverride in prerm.
* Ship /etc/freeradius/modules/* in the freeradius package.
* Stop shipping sites-enabled symlinks in the package and instead create
  them only on initial install, thanks to Matej Vela, closes: #533396.
* Add export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" to the init script
  at the request of John Morrissey, closes: #550143.
* Stop installing /var/run/freeradius in the package to silence Lintian.
  The init script already recreates it at will.
* Remove executable bit from example.pl to silence Lintian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * rlm_exec.c
3
3
 *
4
 
 * Version:     $Id: rlm_exec.c,v 1.30 2007/11/25 14:02:10 aland Exp $
 
4
 * Version:     $Id$
5
5
 *
6
6
 *   This program is free software; you can redistribute it and/or modify
7
7
 *   it under the terms of the GNU General Public License as published by
22
22
 */
23
23
 
24
24
#include <freeradius-devel/ident.h>
25
 
RCSID("$Id: rlm_exec.c,v 1.30 2007/11/25 14:02:10 aland Exp $")
 
25
RCSID("$Id$")
26
26
 
27
27
#include <freeradius-devel/radiusd.h>
28
28
#include <freeradius-devel/modules.h>
134
134
        /*
135
135
         *      FIXME: Do xlat of program name?
136
136
         */
137
 
        DEBUG2("rlm_exec (%s): Executing %s", inst->xlat_name, fmt);
 
137
        RDEBUG2("Executing %s", fmt);
138
138
        result = radius_exec_program(fmt, request, inst->wait,
139
139
                                     out, outlen, *input_pairs, NULL, inst->shell_escape);
140
 
        DEBUG2("rlm_exec (%s): result %d", inst->xlat_name, result);
 
140
        RDEBUG2("result %d", result);
141
141
        if (result != 0) {
142
142
                out[0] = '\0';
143
143
                return 0;
282
282
               (request->proxy->code == inst->packet_code)) ||
283
283
              (request->proxy_reply &&
284
284
               (request->proxy_reply->code == inst->packet_code)))) {
285
 
                DEBUG2("  rlm_exec (%s): Packet type is not %s.  Not executing.",
286
 
                       inst->xlat_name, inst->packet_type);
 
285
                RDEBUG2("Packet type is not %s.  Not executing.",
 
286
                       inst->packet_type);
287
287
                return RLM_MODULE_NOOP;
288
288
        }
289
289
 
293
293
        input_pairs = decode_string(request, inst->input);
294
294
        output_pairs = decode_string(request, inst->output);
295
295
 
 
296
        if (!input_pairs) {
 
297
                RDEBUG2("WARNING: Possible parse error in %s",
 
298
                        inst->input);
 
299
                return RLM_MODULE_NOOP;
 
300
        }
 
301
 
296
302
        /*
297
303
         *      It points to the attribute list, but the attribute
298
304
         *      list is empty.
299
305
         */
300
 
        if (input_pairs && !*input_pairs) {
301
 
                DEBUG2("rlm_exec (%s): WARNING! Input pairs are empty.  No attributes will be passed to the script", inst->xlat_name);
 
306
        if (!*input_pairs) {
 
307
                RDEBUG2("WARNING! Input pairs are empty.  No attributes will be passed to the script");
302
308
        }
303
309
 
304
310
        /*
380
386
                tmp = pairmake("Reply-Message", "Access denied (external check failed)", T_OP_SET);
381
387
                pairadd(&request->reply->vps, tmp);
382
388
 
383
 
                DEBUG2("Login incorrect (external check failed)");
 
389
                RDEBUG2("Login incorrect (external check failed)");
384
390
 
385
391
                request->reply->code = PW_AUTHENTICATION_REJECT;
386
392
                return RLM_MODULE_REJECT;
392
398
                 *      exit status.
393
399
                 */
394
400
                request->reply->code = PW_AUTHENTICATION_REJECT;
395
 
                DEBUG2("Login incorrect (external check said so)");
 
401
                RDEBUG2("Login incorrect (external check said so)");
396
402
                return RLM_MODULE_REJECT;
397
403
        }
398
404