Ignore:
Timestamp:
Nov 4, 2007, 3:16:40 AM (17 years ago)
Author:
Bruno Cornec
Message:

Update to busybox 1.7.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi-busybox/include/shadow_.h

    r821 r1765  
     1/* vi: set sw=4 ts=4: */
    12/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    23   This file is part of the GNU C Library.
     
    1718   02111-1307 USA.  */
    1819
    19 /* Declaration of types and functions for shadow password suite. */
     20/* Declaration of types and functions for shadow password suite */
    2021
    21 #if !defined CONFIG_USE_BB_SHADOW
     22#if !ENABLE_USE_BB_SHADOW
     23
    2224#include <shadow.h>
     25
    2326#else
    2427
    2528#ifndef _SHADOW_H
    26 #define _SHADOW_H   1
     29#define _SHADOW_H 1
    2730
    28 #include <stdio.h>
     31/* Paths to the user database files */
     32#ifndef _PATH_SHADOW
     33#define _PATH_SHADOW "/etc/shadow"
     34#endif
    2935
    30 /* Paths to the user database files.  */
    31 #ifndef _PATH_SHADOW
    32 #define _PATH_SHADOW    "/etc/shadow"
    33 #endif
    34 #define SHADOW _PATH_SHADOW
    35 
    36 
    37 /* Structure of the password file.  */
    38 struct spwd
    39 {
    40     char *sp_namp;      /* Login name.  */
    41     char *sp_pwdp;      /* Encrypted password.  */
    42     long int sp_lstchg;     /* Date of last change.  */
    43     long int sp_min;        /* Minimum number of days between changes.  */
    44     long int sp_max;        /* Maximum number of days between changes.  */
    45     long int sp_warn;       /* Number of days to warn user to change
    46                    the password.  */
    47     long int sp_inact;      /* Number of days the account may be
    48                    inactive.  */
    49     long int sp_expire;     /* Number of days since 1970-01-01 until
    50                    account expires.  */
    51     unsigned long int sp_flag;  /* Reserved.  */
     36/* Structure of the password file */
     37struct spwd {
     38    char *sp_namp;          /* Login name */
     39    char *sp_pwdp;          /* Encrypted password */
     40    long sp_lstchg;         /* Date of last change */
     41    long sp_min;            /* Minimum number of days between changes */
     42    long sp_max;            /* Maximum number of days between changes */
     43    long sp_warn;           /* Number of days to warn user to change the password */
     44    long sp_inact;          /* Number of days the account may be inactive */
     45    long sp_expire;         /* Number of days since 1970-01-01 until account expires */
     46    unsigned long sp_flag;  /* Reserved */
    5247};
    5348
    5449
    55 /* Open database for reading.  */
    56 extern void setspent (void);
     50#define setspent    bb_internal_setspent
     51#define endspent    bb_internal_endspent
     52#define getspent    bb_internal_getspent
     53#define getspnam    bb_internal_getspnam
     54#define sgetspent   bb_internal_sgetspent
     55#define fgetspent   bb_internal_fgetspent
     56#define putspent    bb_internal_putspent
     57#define getspent_r  bb_internal_getspent_r
     58#define getspnam_r  bb_internal_getspnam_r
     59#define sgetspent_r bb_internal_sgetspent_r
     60#define fgetspent_r bb_internal_fgetspent_r
     61#define lckpwdf     bb_internal_lckpwdf
     62#define ulckpwdf    bb_internal_ulckpwdf
    5763
    58 /* Close database.  */
    59 extern void endspent (void);
    6064
    61 /* Get next entry from database, perhaps after opening the file.  */
    62 extern struct spwd *getspent (void);
     65/* All function names below should be remapped by #defines above
     66 * in order to not collide with libc names.
     67 * In theory it isn't necessary, but I saw weird interactions at link time.
     68 * Let's play safe */
    6369
    64 /* Get shadow entry matching NAME.  */
    65 extern struct spwd *getspnam (__const char *__name);
    6670
    67 /* Read shadow entry from STRING. */
    68 extern struct spwd *sgetspent (__const char *__string);
     71/* Open database for reading */
     72extern void setspent(void);
    6973
    70 /* Read next shadow entry from STREAM. */
    71 extern struct spwd *fgetspent (FILE *__stream);
     74/* Close database */
     75extern void endspent(void);
    7276
    73 /* Write line containing shadow password entry to stream. */
    74 extern int putspent (__const struct spwd *__p, FILE *__stream);
     77/* Get next entry from database, perhaps after opening the file */
     78extern struct spwd *getspent(void);
    7579
    76 /* Reentrant versions of some of the functions above.  */
    77 extern int getspent_r (struct spwd *__result_buf, char *__buffer,
     80/* Get shadow entry matching NAME */
     81extern struct spwd *getspnam(__const char *__name);
     82
     83/* Read shadow entry from STRING */
     84extern struct spwd *sgetspent(__const char *__string);
     85
     86/* Read next shadow entry from STREAM */
     87extern struct spwd *fgetspent(FILE *__stream);
     88
     89/* Write line containing shadow password entry to stream */
     90extern int putspent(__const struct spwd *__p, FILE *__stream);
     91
     92/* Reentrant versions of some of the functions above */
     93extern int getspent_r(struct spwd *__result_buf, char *__buffer,
    7894               size_t __buflen, struct spwd **__result);
    7995
    80 extern int getspnam_r (__const char *__name, struct spwd *__result_buf,
     96extern int getspnam_r(__const char *__name, struct spwd *__result_buf,
    8197               char *__buffer, size_t __buflen,
    8298               struct spwd **__result);
    8399
    84 extern int sgetspent_r (__const char *__string, struct spwd *__result_buf,
     100extern int sgetspent_r(__const char *__string, struct spwd *__result_buf,
    85101            char *__buffer, size_t __buflen,
    86102            struct spwd **__result);
    87103
    88 extern int fgetspent_r (FILE *__stream, struct spwd *__result_buf,
     104extern int fgetspent_r(FILE *__stream, struct spwd *__result_buf,
    89105            char *__buffer, size_t __buflen,
    90106            struct spwd **__result);
    91 /* Protect password file against multi writers. */
    92 extern int lckpwdf (void);
     107/* Protect password file against multi writers */
     108extern int lckpwdf(void);
    93109
    94 /* Unlock password file. */
    95 extern int ulckpwdf (void);
     110/* Unlock password file */
     111extern int ulckpwdf(void);
    96112
    97113#endif /* shadow.h */
Note: See TracChangeset for help on using the changeset viewer.