Print this page
remove support for non-ANSI compilation


   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*


  22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 /*      Copyright (c) 1988 AT&T     */
  27 /*        All Rights Reserved   */
  28 
  29 
  30 #ifndef _SHADOW_H
  31 #define _SHADOW_H
  32 
  33 
  34 #ifdef  __cplusplus
  35 extern "C" {
  36 #endif
  37 
  38 #define PASSWD          "/etc/passwd"
  39 #define SHADOW          "/etc/shadow"
  40 #define OPASSWD         "/etc/opasswd"
  41 #define OSHADOW         "/etc/oshadow"


  54 #define NOPWDRTR        "*NP*"  /* password is not retrievable */
  55 /*
  56  * The spwd structure is used in the retreval of information from
  57  * /etc/shadow.  It is used by routines in the libos library.
  58  */
  59 struct spwd {
  60         char *sp_namp;  /* user name */
  61         char *sp_pwdp;  /* user password */
  62         int sp_lstchg;  /* password lastchanged date */
  63         int sp_min;     /* minimum number of days between password changes */
  64         int sp_max;     /* number of days password is valid */
  65         int sp_warn;    /* number of days to warn user to change passwd */
  66         int sp_inact;   /* number of days the login may be inactive */
  67         int sp_expire;  /* date when the login is no longer valid */
  68         unsigned int sp_flag;   /* currently low 4 bits are used */
  69 
  70         /* low 4 bits of sp_flag for counting failed login attempts */
  71 #define FAILCOUNT_MASK 0xF
  72 };
  73 
  74 #if defined(__STDC__)
  75 
  76 #ifndef _STDIO_H
  77 #include <stdio.h>
  78 #endif
  79 
  80 /* Declare all shadow password functions */
  81 
  82 extern struct spwd *getspnam_r(const char *,  struct spwd *, char *, int);
  83 extern struct spwd *getspent_r(struct spwd *, char *, int);
  84 extern struct spwd *fgetspent_r(FILE *, struct spwd *, char *, int);
  85 
  86 extern void     setspent(void);
  87 extern void     endspent(void);
  88 extern struct spwd      *getspent(void);                        /* MT-unsafe */
  89 extern struct spwd      *fgetspent(FILE *);                     /* MT-unsafe */
  90 extern struct spwd      *getspnam(const char *);        /* MT-unsafe */
  91 
  92 extern int      putspent(const struct spwd *, FILE *);
  93 extern int      lckpwdf(void);
  94 extern int      ulckpwdf(void);
  95 
  96 #else
  97 
  98 /* Declare all shadow password functions */
  99 
 100 struct spwd     *getspent_r(), *fgetspent_r(), *getspnam_r();
 101 void            setspent(), endspent();
 102 struct spwd     *getspent(), *fgetspent(), *getspnam(); /* MT-unsafe */
 103 int             putspent(), lckpwdf(), ulckpwdf();
 104 
 105 #endif
 106 
 107 #ifdef  __cplusplus
 108 }
 109 #endif
 110 
 111 #endif  /* _SHADOW_H */


   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  23  *
  24  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  25  * Use is subject to license terms.
  26  */
  27 
  28 /*      Copyright (c) 1988 AT&T     */
  29 /*        All Rights Reserved   */
  30 
  31 
  32 #ifndef _SHADOW_H
  33 #define _SHADOW_H
  34 
  35 
  36 #ifdef  __cplusplus
  37 extern "C" {
  38 #endif
  39 
  40 #define PASSWD          "/etc/passwd"
  41 #define SHADOW          "/etc/shadow"
  42 #define OPASSWD         "/etc/opasswd"
  43 #define OSHADOW         "/etc/oshadow"


  56 #define NOPWDRTR        "*NP*"  /* password is not retrievable */
  57 /*
  58  * The spwd structure is used in the retreval of information from
  59  * /etc/shadow.  It is used by routines in the libos library.
  60  */
  61 struct spwd {
  62         char *sp_namp;  /* user name */
  63         char *sp_pwdp;  /* user password */
  64         int sp_lstchg;  /* password lastchanged date */
  65         int sp_min;     /* minimum number of days between password changes */
  66         int sp_max;     /* number of days password is valid */
  67         int sp_warn;    /* number of days to warn user to change passwd */
  68         int sp_inact;   /* number of days the login may be inactive */
  69         int sp_expire;  /* date when the login is no longer valid */
  70         unsigned int sp_flag;   /* currently low 4 bits are used */
  71 
  72         /* low 4 bits of sp_flag for counting failed login attempts */
  73 #define FAILCOUNT_MASK 0xF
  74 };
  75 


  76 #ifndef _STDIO_H
  77 #include <stdio.h>
  78 #endif
  79 
  80 /* Declare all shadow password functions */
  81 
  82 extern struct spwd *getspnam_r(const char *,  struct spwd *, char *, int);
  83 extern struct spwd *getspent_r(struct spwd *, char *, int);
  84 extern struct spwd *fgetspent_r(FILE *, struct spwd *, char *, int);
  85 
  86 extern void     setspent(void);
  87 extern void     endspent(void);
  88 extern struct spwd      *getspent(void);                        /* MT-unsafe */
  89 extern struct spwd      *fgetspent(FILE *);                     /* MT-unsafe */
  90 extern struct spwd      *getspnam(const char *);        /* MT-unsafe */
  91 
  92 extern int      putspent(const struct spwd *, FILE *);
  93 extern int      lckpwdf(void);
  94 extern int      ulckpwdf(void);
  95 











  96 #ifdef  __cplusplus
  97 }
  98 #endif
  99 
 100 #endif  /* _SHADOW_H */