| 63 | */ |
| 64 | |
| 65 | void |
| 66 | auth_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 | /* |
nothing calls this directly
no test coverage detected