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