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

« back to all changes in this revision

Viewing changes to src/lib/filters.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:
1
1
/*
2
2
 * filters.c    Routines to parse Ascend's filter attributes.
3
3
 *
4
 
 * Version:     $Id: filters.c,v 1.36 2004/02/26 19:04:20 aland Exp $
 
4
 * Version:     $Id: filters.c,v 1.36.4.3 2006/05/03 17:35:02 aland Exp $
5
5
 *
6
6
 *   This library is free software; you can redistribute it and/or
7
7
 *   modify it under the terms of the GNU Lesser General Public
15
15
 *
16
16
 *   You should have received a copy of the GNU Lesser General Public
17
17
 *   License along with this library; if not, write to the Free Software
18
 
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
 
18
 *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19
19
 *
20
20
 * Copyright 2003  The FreeRADIUS server project
21
21
 */
22
22
 
23
 
static const char rcsid[] = "$Id: filters.c,v 1.36 2004/02/26 19:04:20 aland Exp $";
 
23
static const char rcsid[] = "$Id: filters.c,v 1.36.4.3 2006/05/03 17:35:02 aland Exp $";
24
24
 
25
25
#include <string.h>
26
26
#include <ctype.h>
1049
1049
        ascend_filter_t filter;
1050
1050
 
1051
1051
        rcode = -1;
 
1052
        
 
1053
        /*
 
1054
         *      Rather than printing specific error messages, we create
 
1055
         *      a general one here, which won't be used if the function
 
1056
         *      returns OK.
 
1057
         */
 
1058
        librad_log("Text is not in proper format");
1052
1059
 
1053
1060
        /*
1054
1061
         *      Tokenize the input string in the VP.
1055
1062
         *
1056
 
         *      Once the filter is *completelty* parsed, then we will
 
1063
         *      Once the filter is *completely* parsed, then we will
1057
1064
         *      over-write it with the final binary filter.
1058
1065
         */
1059
1066
        argc = str2argv(pair->strvalue, argv, 32);
1207
1214
  if (vp->length > SIZEOF_RADFILTER) {
1208
1215
    strcpy(p, "0x");
1209
1216
    p += 2;
 
1217
    len -= 2;
1210
1218
    for (i = 0; i < vp->length; i++) {
1211
 
      sprintf(p, " %02x", vp->strvalue[i]);
1212
 
      p += 3;
 
1219
      snprintf(p, len, "%02x", vp->strvalue[i]);
 
1220
      p += 2;
 
1221
      len -= 2;
1213
1222
    }
1214
1223
    return;
1215
1224
  }