Luna/libc/include/shadow.h
apio 701dc30221
All checks were successful
Build and test / build (push) Successful in 1m39s
base+su+libc: Add support for a shadow file and use it by default
2024-04-10 22:37:36 +02:00

49 lines
1021 B
C

/* shadow.h: Password file parsing. */
#ifndef _SHADOW_H
#define _SHADOW_H
#include <stdio.h>
struct spwd
{
char* sp_namp;
char* sp_pwdp;
long sp_lstchg;
long sp_min;
long sp_max;
long sp_warn;
long sp_inact;
long sp_expire;
unsigned long sp_flag;
};
#ifdef __cplusplus
extern "C"
{
#endif
/* Read the next entry from the shadow file. */
struct spwd* getspent();
/* Find the entry with a matching username in the shadow file. */
struct spwd* getspnam(const char* name);
/* Read the next entry from the shadow file (reentrant version). */
int getspent_r(struct spwd* spbuf, char* buf, size_t buflen, struct spwd** spbufp);
/* Read the next entry from a shadow file (reentrant version). */
int fgetspent_r(FILE* stream, struct spwd* spbuf, char* buf, size_t buflen, struct spwd** spbufp);
/* Rewind the shadow file. */
void setspent(void);
/* End shadow file parsing. */
void endspent(void);
#ifdef __cplusplus
}
#endif
#endif