The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
shadow.h
Go to the documentation of this file.
1#pragma once
2
3/**
4 * @file shadow.h
5 * @brief the password hashes (/etc/shadow: name:hash:last:min:max:warn:
6 * inactive:expire:), which only root can read.
7 *
8 * ginnOS uses the name and the hash; the other fields are kept as they
9 * are. a hash of "*" or "!" (or one that starts with "!") is a locked
10 * account; an empty one needs no password.
11 */
12
13#define SHADOW_FILE "/etc/shadow"
14
15struct spwd
16{
17 char *sp_namp; // the user's name
18 char *sp_pwdp; // the hash ("$5$...")
19};
20
21/**
22 * the entry of a user, in a static buffer.
23 * @return NULL if there is none, or the file cannot be read (not root).
24 */
25struct spwd *getspnam(const char *name);
struct spwd * getspnam(const char *name)
the entry of a user, in a static buffer.
Definition shadow.h:16
char * sp_pwdp
Definition shadow.h:18
char * sp_namp
Definition shadow.h:17