~ubuntu-branches/ubuntu/hardy/freeradius/hardy-proposed

« back to all changes in this revision

Viewing changes to src/main/valuepair.c

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2006-12-16 20:45:11 UTC
  • mfrom: (3.1.10 feisty)
  • Revision ID: james.westby@ubuntu.com-20061216204511-3pbbsu4s8jtehsor
Tags: 1.1.3-3
Fix POSIX compliance problem in init script.  Closes: #403384. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * valuepair.c  Valuepair functions that are radiusd-specific
3
3
 *              and as such do not belong in the library.
4
4
 *
5
 
 * Version:     $Id: valuepair.c,v 1.60.2.3 2004/09/09 14:31:06 aland Exp $
 
5
 * Version:     $Id: valuepair.c,v 1.60.2.4 2005/02/07 20:04:47 aland Exp $
6
6
 *
7
7
 *   This program is free software; you can redistribute it and/or modify
8
8
 *   it under the terms of the GNU General Public License as published by
22
22
 * Copyright 2000  Alan DeKok <aland@ox.org>
23
23
 */
24
24
 
25
 
static const char rcsid[] = "$Id: valuepair.c,v 1.60.2.3 2004/09/09 14:31:06 aland Exp $";
 
25
static const char rcsid[] = "$Id: valuepair.c,v 1.60.2.4 2005/02/07 20:04:47 aland Exp $";
26
26
 
27
27
#include "autoconf.h"
28
28
#include "libradius.h"
570
570
        if (ret != 0)
571
571
                return ret;
572
572
 
573
 
        if (pairfind(check_pairs, PW_STRIP_USER_NAME)) {
574
 
                /*
575
 
                 *      I don't think we want to update the User-Name
576
 
                 *      attribute in place... - atd
577
 
                 */
578
 
                strcpy((char *)request->strvalue, rest);
579
 
                request->length = strlen(rest);
 
573
        if ((vp = pairfind(check_pairs, PW_STRIP_USER_NAME)) != NULL) {
 
574
                if (vp->lvalue == 1) {
 
575
                        /*
 
576
                         *      I don't think we want to update the User-Name
 
577
                         *      attribute in place... - atd
 
578
                         */
 
579
                        strcpy((char *)request->strvalue, rest);
 
580
                        request->length = strlen(rest);
 
581
                } else {
 
582
                        return ret;
 
583
                }
580
584
        } else {
581
585
                if ((vp = pairfind(check_pairs, PW_STRIPPED_USER_NAME)) != NULL){
582
586
                        strcpy((char *)vp->strvalue, rest);