Dr Andrew Scott G7VAV

My photo
 
April 2024
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 1 2 3 4 5
6 7 8 9 10 11 12


shadow.h
001: /* Copyright (C) 1996, 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
002:    This file is part of the GNU C Library.
003: 
004:    The GNU C Library is free software; you can redistribute it and/or
005:    modify it under the terms of the GNU Lesser General Public
006:    License as published by the Free Software Foundation; either
007:    version 2.1 of the License, or (at your option) any later version.
008: 
009:    The GNU C Library is distributed in the hope that it will be useful,
010:    but WITHOUT ANY WARRANTY; without even the implied warranty of
011:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:    Lesser General Public License for more details.
013: 
014:    You should have received a copy of the GNU Lesser General Public
015:    License along with the GNU C Library; if not, write to the Free
016:    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
017:    02111-1307 USA.  */
018: 
019: /* Declaration of types and functions for shadow password suite.  */
020: 
021: #ifndef _SHADOW_H
022: #define _SHADOW_H       1
023: 
024: #include <features.h>
025: 
026: #include <paths.h>
027: 
028: #define __need_FILE
029: #include <stdio.h>
030: #define __need_size_t
031: #include <stddef.h>
032: 
033: /* Paths to the user database files.  */
034: #define SHADOW _PATH_SHADOW
035: 
036: 
037: __BEGIN_DECLS
038: 
039: /* Structure of the password file.  */
040: struct spwd
041:   {
042:     char *sp_namp;              /* Login name.  */
043:     char *sp_pwdp;              /* Encrypted password.  */
044:     long int sp_lstchg;         /* Date of last change.  */
045:     long int sp_min;            /* Minimum number of days between changes.  */
046:     long int sp_max;            /* Maximum number of days between changes.  */
047:     long int sp_warn;           /* Number of days to warn user to change
048:                                    the password.  */
049:     long int sp_inact;          /* Number of days the account may be
050:                                    inactive.  */
051:     long int sp_expire;         /* Number of days since 1970-01-01 until
052:                                    account expires.  */
053:     unsigned long int sp_flag;  /* Reserved.  */
054:   };
055: 
056: 
057: /* Open database for reading.
058: 
059:    This function is not part of POSIX and therefore no official
060:    cancellation point.  But due to similarity with an POSIX interface
061:    or due to the implementation it is a cancellation point and
062:    therefore not marked with __THROW.  */
063: extern void setspent (void);
064: 
065: /* Close database.
066: 
067:    This function is not part of POSIX and therefore no official
068:    cancellation point.  But due to similarity with an POSIX interface
069:    or due to the implementation it is a cancellation point and
070:    therefore not marked with __THROW.  */
071: extern void endspent (void);
072: 
073: /* Get next entry from database, perhaps after opening the file.
074: 
075:    This function is not part of POSIX and therefore no official
076:    cancellation point.  But due to similarity with an POSIX interface
077:    or due to the implementation it is a cancellation point and
078:    therefore not marked with __THROW.  */
079: extern struct spwd *getspent (void);
080: 
081: /* Get shadow entry matching NAME.
082: 
083:    This function is not part of POSIX and therefore no official
084:    cancellation point.  But due to similarity with an POSIX interface
085:    or due to the implementation it is a cancellation point and
086:    therefore not marked with __THROW.  */
087: extern struct spwd *getspnam (__const char *__name);
088: 
089: /* Read shadow entry from STRING.
090: 
091:    This function is not part of POSIX and therefore no official
092:    cancellation point.  But due to similarity with an POSIX interface
093:    or due to the implementation it is a cancellation point and
094:    therefore not marked with __THROW.  */
095: extern struct spwd *sgetspent (__const char *__string);
096: 
097: /* Read next shadow entry from STREAM.
098: 
099:    This function is not part of POSIX and therefore no official
100:    cancellation point.  But due to similarity with an POSIX interface
101:    or due to the implementation it is a cancellation point and
102:    therefore not marked with __THROW.  */
103: extern struct spwd *fgetspent (FILE *__stream);
104: 
105: /* Write line containing shadow password entry to stream.
106: 
107:    This function is not part of POSIX and therefore no official
108:    cancellation point.  But due to similarity with an POSIX interface
109:    or due to the implementation it is a cancellation point and
110:    therefore not marked with __THROW.  */
111: extern int putspent (__const struct spwd *__p, FILE *__stream);
112: 
113: 
114: #ifdef __USE_MISC
115: /* Reentrant versions of some of the functions above.
116: 
117:    These functions are not part of POSIX and therefore no official
118:    cancellation point.  But due to similarity with an POSIX interface
119:    or due to the implementation they are cancellation points and
120:    therefore not marked with __THROW.  */
121: extern int getspent_r (struct spwd *__result_buf, char *__buffer,
122:                        size_t __buflen, struct spwd **__result);
123: 
124: extern int getspnam_r (__const char *__name, struct spwd *__result_buf,
125:                        char *__buffer, size_t __buflen,
126:                        struct spwd **__result);
127: 
128: extern int sgetspent_r (__const char *__string, struct spwd *__result_buf,
129:                         char *__buffer, size_t __buflen,
130:                         struct spwd **__result);
131: 
132: extern int fgetspent_r (FILE *__stream, struct spwd *__result_buf,
133:                         char *__buffer, size_t __buflen,
134:                         struct spwd **__result);
135: #endif  /* misc */
136: 
137: 
138: /* The simple locking functionality provided here is not suitable for
139:    multi-threaded applications.  */
140: 
141: /* Protect password file against multi writers.  */
142: extern int lckpwdf (void) __THROW;
143: 
144: /* Unlock password file.  */
145: extern int ulckpwdf (void) __THROW;
146: 
147: __END_DECLS
148: 
149: #endif /* shadow.h */
150: 


for client 3.142.53.68
© Andrew Scott 2006 - 2024,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/