1 |
/* This file is part of GNU RADIUS. |
/* This file is part of GNU Radius. |
2 |
Copyright (C) 2001, Sergey Poznyakoff |
Copyright (C) 2000,2001,2002,2003 Sergey Poznyakoff |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or modify |
GNU Radius is free software; you can redistribute it and/or modify |
5 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
6 |
the Free Software Foundation; either version 2 of the License, or |
the Free Software Foundation; either version 2 of the License, or |
7 |
(at your option) any later version. |
(at your option) any later version. |
8 |
|
|
9 |
This program is distributed in the hope that it will be useful, |
GNU Radius is distributed in the hope that it will be useful, |
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
GNU General Public License for more details. |
GNU General Public License for more details. |
13 |
|
|
14 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
15 |
along with this program; if not, write to the Free Software Foundation, |
along with GNU Radius; if not, write to the Free Software Foundation, |
16 |
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
17 |
|
|
18 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
34 |
}; |
}; |
35 |
|
|
36 |
radut_file_t |
radut_file_t |
37 |
rut_setent(name, append) |
rut_setent(char *name, int append) |
|
char *name; |
|
|
int append; |
|
38 |
{ |
{ |
39 |
int fd; |
int fd; |
40 |
int ro = 0; |
int ro = 0; |
59 |
} |
} |
60 |
|
|
61 |
void |
void |
62 |
rut_rewind(file) |
rut_rewind(radut_file_t file) |
|
radut_file_t file; |
|
63 |
{ |
{ |
64 |
lseek(file->fd, 0, SEEK_SET); |
lseek(file->fd, 0, SEEK_SET); |
65 |
file->eof = 0; |
file->eof = 0; |
66 |
} |
} |
67 |
|
|
68 |
void |
void |
69 |
rut_endent(file) |
rut_endent(radut_file_t file) |
|
radut_file_t file; |
|
70 |
{ |
{ |
71 |
if (!file) |
if (!file) |
72 |
return; |
return; |
75 |
} |
} |
76 |
|
|
77 |
struct radutmp * |
struct radutmp * |
78 |
rut_getent(file) |
rut_getent(radut_file_t file) |
|
radut_file_t file; |
|
79 |
{ |
{ |
80 |
int rc; |
int rc; |
81 |
|
|
89 |
} |
} |
90 |
|
|
91 |
int |
int |
92 |
rut_putent(file, ent) |
rut_putent(radut_file_t file, struct radutmp *ent) |
|
radut_file_t file; |
|
|
struct radutmp *ent; |
|
93 |
{ |
{ |
94 |
if (file->readonly) { |
if (file->readonly) { |
95 |
radlog(L_ERR, "rut_putent(): file opened readonly"); |
radlog(L_ERR, "rut_putent(): file opened readonly"); |
120 |
} |
} |
121 |
|
|
122 |
int |
int |
123 |
radutmp_putent(filename, ut, status) |
radutmp_putent(char *filename, struct radutmp *ut, int status) |
|
char *filename; |
|
|
struct radutmp *ut; |
|
|
int status; |
|
124 |
{ |
{ |
125 |
radut_file_t file; |
radut_file_t file; |
126 |
struct radutmp *ent; |
struct radutmp *ent; |
207 |
} |
} |
208 |
|
|
209 |
int |
int |
210 |
radwtmp_putent(filename, ut) |
radwtmp_putent(char *filename, struct radutmp *ut) |
|
char *filename; |
|
|
struct radutmp *ut; |
|
211 |
{ |
{ |
212 |
radut_file_t file; |
radut_file_t file; |
213 |
|
|