]>
git.ipfire.org Git - thirdparty/glibc.git/blob - shadow/shadow.h
1 /* Copyright (C) 1996 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 /* Declaration of types and functions for shadow password suite. */
32 /* Paths to the userd files. */
33 #define SHADOW "/etc/shadow"
38 /* Structure of the password file. */
41 char *sp_namp
; /* Login name. */
42 char *sp_pwdp
; /* Encrypted password. */
43 long int sp_lstchg
; /* Date of last change. */
44 long int sp_min
; /* Minimum number of days between changes. */
45 long int sp_max
; /* Maximum number of days between changes. */
46 long int sp_warn
; /* Number of days to warn user to change
48 long int sp_inact
; /* Number of days the account may be
50 long int sp_expire
; /* Number of days since 1970-01-01 until
52 unsigned long int sp_flag
; /* Reserved. */
56 /* Open database for reading. */
57 extern void setspent
__P ((void));
60 extern void endspent
__P ((void));
62 /* Get next entry from database, perhaps after opening the file. */
63 extern struct spwd
*getspent
__P ((void));
65 /* Get shadow entry matching NAME. */
66 extern struct spwd
*getspnam
__P ((__const
char *__name
));
68 /* Read shadow entry from STRING. */
69 extern struct spwd
*sgetspent
__P ((__const
char *__string
));
71 /* Read next shadow entry from STREAM. */
72 extern struct spwd
*fgetspent
__P ((FILE *__stream
));
74 /* Write line containing shadow password entry to stream. */
75 extern int putspent
__P ((__const
struct spwd
*__p
, FILE *__stream
));
78 #ifdef __USE_REENTRANT
79 /* Reentrant versions of some of the functions above. */
80 extern int __getspent_r
__P ((struct spwd
*__result_buf
, char *__buffer
,
81 size_t __buflen
, struct spwd
**__result
));
82 extern int getspent_r
__P ((struct spwd
*__result_buf
, char *__buffer
,
83 size_t __buflen
, struct spwd
**__result
));
85 extern int __getspnam_r
__P ((__const
char *__name
, struct spwd
*__result_buf
,
86 char *__buffer
, size_t __buflen
,
87 struct spwd
**__result
));
88 extern int getspnam_r
__P ((__const
char *__name
, struct spwd
*__result_buf
,
89 char *__buffer
, size_t __buflen
,
90 struct spwd
**__result
));
92 extern int __sgetspent_r
__P ((__const
char *__string
,
93 struct spwd
*__result_buf
, char *__buffer
,
94 size_t __buflen
, struct spwd
**__result
));
95 extern int sgetspent_r
__P ((__const
char *__string
, struct spwd
*__result_buf
,
96 char *__buffer
, size_t __buflen
,
97 struct spwd
**__result
));
99 extern int __fgetspent_r
__P ((FILE *__stream
, struct spwd
*__result_buf
,
100 char *__buffer
, size_t __buflen
,
101 struct spwd
**__result
));
102 extern int fgetspent_r
__P ((FILE *__stream
, struct spwd
*__result_buf
,
103 char *__buffer
, size_t __buflen
,
104 struct spwd
**__result
));
105 #endif /* reentrant */
108 /* Protect password file against multi writers. */
109 extern int __lckpwdf
__P ((void));
110 extern int lckpwdf
__P ((void));
112 /* Unlock password file. */
113 extern int __ulckpwdf
__P ((void));
114 extern int ulckpwdf
__P ((void));
118 #endif /* shadow.h */