MCPcopy Create free account
hub / github.com/F-Stack/f-stack / auth_checknologin

Function auth_checknologin

tools/libutil/login_auth.c:65–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 */
64
65void
66auth_checknologin(login_cap_t *lc)
67{
68 const char *file;
69
70 /* Do we ignore a nologin file? */
71 if (login_getcapbool(lc, "ignorenologin", 0))
72 return;
73
74 /* Note that <file> will be "" if there is no nologin capability */
75 if ((file = login_getcapstr(lc, "nologin", "", NULL)) == NULL)
76 exit(1);
77
78 /*
79 * *file is true IFF there was a "nologin" capability
80 * Note that auth_cat() returns 1 only if the specified
81 * file exists, and is readable. E.g., /.nologin exists.
82 */
83 if ((*file && auth_cat(file)) || auth_cat(_PATH_NOLOGIN))
84 exit(1);
85}
86
87
88/*

Callers

nothing calls this directly

Calls 3

login_getcapboolFunction · 0.85
login_getcapstrFunction · 0.85
auth_catFunction · 0.85

Tested by

no test coverage detected