~ubuntu-branches/ubuntu/jaunty/freeradius/jaunty-proposed

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2008-09-22 08:42:02 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20080922084202-eyjprg3z55481ha5
Tags: 2.1.0+dfsg-0ubuntu1
* New upstream release.
* Fixes FTBFS issue with new libtool.
* Fixes listen on random port. (LP: #261809)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *              accounting:     Functions to write radwtmp file.
4
4
 *              Also contains handler for "Group".
5
5
 *
6
 
 * Version:     $Id: rlm_unix.c,v 1.85 2007/12/10 16:07:30 aland Exp $
 
6
 * Version:     $Id$
7
7
 *
8
8
 *   This program is free software; you can redistribute it and/or modify
9
9
 *   it under the terms of the GNU General Public License as published by
25
25
 */
26
26
 
27
27
#include        <freeradius-devel/ident.h>
28
 
RCSID("$Id: rlm_unix.c,v 1.85 2007/12/10 16:07:30 aland Exp $")
 
28
RCSID("$Id$")
29
29
 
30
30
#include        <freeradius-devel/radiusd.h>
31
31
 
249
249
         *      Users with a particular shell are denied access
250
250
         */
251
251
        if (strcmp(pwd->pw_shell, DENY_SHELL) == 0) {
252
 
                radlog(L_AUTH, "rlm_unix: [%s]: invalid shell", name);
 
252
                radlog_request(L_AUTH, 0, request,
 
253
                               "rlm_unix: [%s]: invalid shell", name);
253
254
                return RLM_MODULE_REJECT;
254
255
        }
255
256
#endif
267
268
        }
268
269
        endusershell();
269
270
        if (shell == NULL) {
270
 
                radlog(L_AUTH, "rlm_unix: [%s]: invalid shell [%s]",
 
271
                radlog_request(L_AUTH, 0, request, "[%s]: invalid shell [%s]",
271
272
                       name, pwd->pw_shell);
272
273
                return RLM_MODULE_REJECT;
273
274
        }
280
281
         */
281
282
        if (spwd && spwd->sp_expire > 0 &&
282
283
            (request->timestamp / 86400) > spwd->sp_expire) {
283
 
                radlog(L_AUTH, "rlm_unix: [%s]: password has expired", name);
 
284
                radlog_request(L_AUTH, 0, request, "[%s]: password has expired", name);
284
285
                return RLM_MODULE_REJECT;
285
286
        }
286
287
#endif
291
292
         */
292
293
        if ((pwd->pw_expire > 0) &&
293
294
            (request->timestamp > pwd->pw_expire)) {
294
 
                radlog(L_AUTH, "rlm_unix: [%s]: password has expired", name);
 
295
                radlog_request(L_AUTH, 0, request, "[%s]: password has expired", name);
295
296
                return RLM_MODULE_REJECT;
296
297
        }
297
298
#endif
354
355
 
355
356
        if (!request->password ||
356
357
            (request->password->attribute != PW_USER_PASSWORD)) {
357
 
                radlog(L_AUTH, "rlm_unix: Attribute \"User-Password\" is required for authentication.");
 
358
                radlog_request(L_AUTH, 0, request, "Attribute \"User-Password\" is required for authentication.");
358
359
                return RLM_MODULE_INVALID;
359
360
        }
360
361
 
366
367
         */
367
368
        if (fr_crypt_check((char *) request->password->vp_strvalue,
368
369
                             (char *) vp->vp_strvalue) != 0) {
369
 
                radlog(L_AUTH, "rlm_unix: [%s]: invalid password",
370
 
                       request->username->vp_strvalue);
 
370
                radlog_request(L_AUTH, 0, request, "invalid password \"%s\"",
 
371
                               request->username->vp_strvalue);
371
372
                return RLM_MODULE_REJECT;
372
373
        }
373
374
#endif /* OSFFIA */
430
431
         *      No radwtmp.  Don't do anything.
431
432
         */
432
433
        if (!inst->radwtmp) {
433
 
                DEBUG2("rlm_unix: No radwtmp file configured.  Ignoring accounting request.");
 
434
                RDEBUG2("No radwtmp file configured.  Ignoring accounting request.");
434
435
                return RLM_MODULE_NOOP;
435
436
        }
436
437
 
437
438
        if (request->packet->src_ipaddr.af != AF_INET) {
438
 
                DEBUG2("rlm_unix: IPv6 is not supported!");
 
439
                RDEBUG2("IPv6 is not supported!");
439
440
                return RLM_MODULE_NOOP;
440
441
        }
441
442