~ubuntu-branches/ubuntu/dapper/freeradius/dapper-updates

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Paul Hampson
  • Date: 2004-12-29 20:19:42 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041229201942-uj2e95la965uthc7
Tags: 1.0.1-2
* freeradius-dialupadmin Suggests php4-mysql | php4-pgsql
   Closes: #279419
* Added a two-second pause to restart in init.d script
   Closes: #262635
* FreeRADIUS module packages now depend on the same source
  version of the main FreeRADIUS package.
   Closes: #284353
* FreeRADIUS-dialupadmin's default paths in admin.conf are
  now correct.
   Closes: #280942
* FreeRADIUS-dialupadmin's help.php3 can now find README.
   Closes: #280941
* Fixes stolen from 1.0.2 CVS:
  - Bug fix to make udpfromto code work
  - radrelay shouldn't dump core if it can't read a VP from the
    detail file.
  - Only initialize the random pool once.
  - In rlm_sql, don't escape characters twice.
  - In rlm_ldap, only claim Auth-Type if a plain text password is present.
  - Locking fixes in threading code
  - Fix building on gcc-4.0 by not trying to access static auth_port from
    other files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *              The code in here was borrowed from the cache.c module
5
5
 *              and adapted to be a standalone set of functions.
6
6
 *
7
 
 * Version: $Id: compat.c,v 1.1.6.1 2003/09/12 19:18:04 phampson Exp $
 
7
 * Version: $Id: compat.c,v 1.4 2004/02/26 19:04:37 aland Exp $
8
8
 *
9
9
 *   This program is free software; you can redistribute it and/or modify
10
10
 *   it under the terms of the GNU General Public License as published by
21
21
 *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
22
 *
23
23
 * Copyright 2001  The FreeRADIUS server project.
24
 
 */    
25
 
static const char rcsid[] = "$Id: compat.c,v 1.1.6.1 2003/09/12 19:18:04 phampson Exp $";
 
24
 */
 
25
static const char rcsid[] = "$Id: compat.c,v 1.4 2004/02/26 19:04:37 aland Exp $";
26
26
 
27
27
#include        "autoconf.h"
28
28
#include        "libradius.h"
36
36
 
37
37
#include "config.h"
38
38
 
39
 
#if HAVE_SHADOW_H
 
39
#ifdef HAVE_SHADOW_H
40
40
#  include <shadow.h>
41
41
#endif
42
42
 
92
92
        ptr = buffer;
93
93
        RAD_EXTRACT_FIELD("Username", username);
94
94
        pwbuf.pw_name = username;
95
 
        
 
95
 
96
96
        /* Get (encrypted) password from password file (shadow comes later) */
97
97
        if (*ptr != '\0') ptr++;
98
98
        RAD_EXTRACT_FIELD("Password", userpwd);
102
102
        if (*ptr != '\0') ptr++;
103
103
        RAD_EXTRACT_FIELD("UID", uidtmp);
104
104
        pwbuf.pw_uid = atoi(uidtmp);
105
 
        
 
105
 
106
106
        /* Get gid from the password file */
107
107
        if (*ptr != '\0') ptr++;
108
108
        RAD_EXTRACT_FIELD("GID", gidtmp);
109
109
        pwbuf.pw_gid = atoi(gidtmp);
110
 
        
 
110
 
111
111
        /* Get the GECOS (name) field from the password file */
112
112
        if (*ptr != '\0') ptr++;
113
113
        RAD_EXTRACT_FIELD("GECOS", gecostmp);
176
176
        ptr = buffer;
177
177
        RAD_EXTRACT_FIELD("Username", username);
178
178
        GET_SP_NAME(&spbuf) = username;
179
 
        
 
179
 
180
180
        /* Get (encrypted) passwords from the shadow file */
181
181
        if (*ptr != '\0') ptr++;
182
182
        RAD_EXTRACT_FIELD("Password", userpwd);