Blame shadow/shadow.h

Packit Service 82fcde
/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
/* Declaration of types and functions for "shadow" storage of hashed
Packit Service 82fcde
   passphrases.  The shadow database is like the user database, but is
Packit Service 82fcde
   only accessible with special privileges, so that malicious users
Packit Service 82fcde
   cannot retrieve everyone else's hashed passphrase to brute-force at
Packit Service 82fcde
   their convenience.  */
Packit Service 82fcde
Packit Service 82fcde
#ifndef _SHADOW_H
Packit Service 82fcde
#define _SHADOW_H	1
Packit Service 82fcde
Packit Service 82fcde
#include <features.h>
Packit Service 82fcde
Packit Service 82fcde
#include <paths.h>
Packit Service 82fcde
Packit Service 82fcde
#define __need_size_t
Packit Service 82fcde
#include <stddef.h>
Packit Service 82fcde
Packit Service 82fcde
#include <bits/types/FILE.h>
Packit Service 82fcde
Packit Service 82fcde
/* Paths to the user database files.  */
Packit Service 82fcde
#define	SHADOW _PATH_SHADOW
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
__BEGIN_DECLS
Packit Service 82fcde
Packit Service 82fcde
/* A record in the shadow database.  */
Packit Service 82fcde
struct spwd
Packit Service 82fcde
  {
Packit Service 82fcde
    char *sp_namp;		/* Login name.  */
Packit Service 82fcde
    char *sp_pwdp;		/* Hashed passphrase.  */
Packit Service 82fcde
    long int sp_lstchg;		/* Date of last change.  */
Packit Service 82fcde
    long int sp_min;		/* Minimum number of days between changes.  */
Packit Service 82fcde
    long int sp_max;		/* Maximum number of days between changes.  */
Packit Service 82fcde
    long int sp_warn;		/* Number of days to warn user to change
Packit Service 82fcde
				   the password.  */
Packit Service 82fcde
    long int sp_inact;		/* Number of days the account may be
Packit Service 82fcde
				   inactive.  */
Packit Service 82fcde
    long int sp_expire;		/* Number of days since 1970-01-01 until
Packit Service 82fcde
				   account expires.  */
Packit Service 82fcde
    unsigned long int sp_flag;	/* Reserved.  */
Packit Service 82fcde
  };
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Open database for reading.
Packit Service 82fcde
Packit Service 82fcde
   This function is not part of POSIX and therefore no official
Packit Service 82fcde
   cancellation point.  But due to similarity with an POSIX interface
Packit Service 82fcde
   or due to the implementation it is a cancellation point and
Packit Service 82fcde
   therefore not marked with __THROW.  */
Packit Service 82fcde
extern void setspent (void);
Packit Service 82fcde
Packit Service 82fcde
/* Close database.
Packit Service 82fcde
Packit Service 82fcde
   This function is not part of POSIX and therefore no official
Packit Service 82fcde
   cancellation point.  But due to similarity with an POSIX interface
Packit Service 82fcde
   or due to the implementation it is a cancellation point and
Packit Service 82fcde
   therefore not marked with __THROW.  */
Packit Service 82fcde
extern void endspent (void);
Packit Service 82fcde
Packit Service 82fcde
/* Get next entry from database, perhaps after opening the file.
Packit Service 82fcde
Packit Service 82fcde
   This function is not part of POSIX and therefore no official
Packit Service 82fcde
   cancellation point.  But due to similarity with an POSIX interface
Packit Service 82fcde
   or due to the implementation it is a cancellation point and
Packit Service 82fcde
   therefore not marked with __THROW.  */
Packit Service 82fcde
extern struct spwd *getspent (void);
Packit Service 82fcde
Packit Service 82fcde
/* Get shadow entry matching NAME.
Packit Service 82fcde
Packit Service 82fcde
   This function is not part of POSIX and therefore no official
Packit Service 82fcde
   cancellation point.  But due to similarity with an POSIX interface
Packit Service 82fcde
   or due to the implementation it is a cancellation point and
Packit Service 82fcde
   therefore not marked with __THROW.  */
Packit Service 82fcde
extern struct spwd *getspnam (const char *__name);
Packit Service 82fcde
Packit Service 82fcde
/* Read shadow entry from STRING.
Packit Service 82fcde
Packit Service 82fcde
   This function is not part of POSIX and therefore no official
Packit Service 82fcde
   cancellation point.  But due to similarity with an POSIX interface
Packit Service 82fcde
   or due to the implementation it is a cancellation point and
Packit Service 82fcde
   therefore not marked with __THROW.  */
Packit Service 82fcde
extern struct spwd *sgetspent (const char *__string);
Packit Service 82fcde
Packit Service 82fcde
/* Read next shadow entry from STREAM.
Packit Service 82fcde
Packit Service 82fcde
   This function is not part of POSIX and therefore no official
Packit Service 82fcde
   cancellation point.  But due to similarity with an POSIX interface
Packit Service 82fcde
   or due to the implementation it is a cancellation point and
Packit Service 82fcde
   therefore not marked with __THROW.  */
Packit Service 82fcde
extern struct spwd *fgetspent (FILE *__stream);
Packit Service 82fcde
Packit Service 82fcde
/* Write line containing shadow entry to stream.
Packit Service 82fcde
Packit Service 82fcde
   This function is not part of POSIX and therefore no official
Packit Service 82fcde
   cancellation point.  But due to similarity with an POSIX interface
Packit Service 82fcde
   or due to the implementation it is a cancellation point and
Packit Service 82fcde
   therefore not marked with __THROW.  */
Packit Service 82fcde
extern int putspent (const struct spwd *__p, FILE *__stream);
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
#ifdef __USE_MISC
Packit Service 82fcde
/* Reentrant versions of some of the functions above.
Packit Service 82fcde
Packit Service 82fcde
   These functions are not part of POSIX and therefore no official
Packit Service 82fcde
   cancellation point.  But due to similarity with an POSIX interface
Packit Service 82fcde
   or due to the implementation they are cancellation points and
Packit Service 82fcde
   therefore not marked with __THROW.  */
Packit Service 82fcde
extern int getspent_r (struct spwd *__result_buf, char *__buffer,
Packit Service 82fcde
		       size_t __buflen, struct spwd **__result);
Packit Service 82fcde
Packit Service 82fcde
extern int getspnam_r (const char *__name, struct spwd *__result_buf,
Packit Service 82fcde
		       char *__buffer, size_t __buflen,
Packit Service 82fcde
		       struct spwd **__result);
Packit Service 82fcde
Packit Service 82fcde
extern int sgetspent_r (const char *__string, struct spwd *__result_buf,
Packit Service 82fcde
			char *__buffer, size_t __buflen,
Packit Service 82fcde
			struct spwd **__result);
Packit Service 82fcde
Packit Service 82fcde
extern int fgetspent_r (FILE *__stream, struct spwd *__result_buf,
Packit Service 82fcde
			char *__buffer, size_t __buflen,
Packit Service 82fcde
			struct spwd **__result);
Packit Service 82fcde
#endif	/* misc */
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* The simple locking functionality provided here is not suitable for
Packit Service 82fcde
   multi-threaded applications.  */
Packit Service 82fcde
Packit Service 82fcde
/* Request exclusive access to /etc/passwd and /etc/shadow.  */
Packit Service 82fcde
extern int lckpwdf (void) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Release exclusive access to /etc/passwd and /etc/shadow.  */
Packit Service 82fcde
extern int ulckpwdf (void) __THROW;
Packit Service 82fcde
Packit Service 82fcde
__END_DECLS
Packit Service 82fcde
Packit Service 82fcde
#endif /* shadow.h */