Skip to content

Commit

Permalink
s/authorization/authentication/g
Browse files Browse the repository at this point in the history
OK kn@ tedu@
  • Loading branch information
martijn authored and Duncaen committed Jan 28, 2021
1 parent 6e3c6ba commit e8e8713
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions doas.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,15 @@ main(int argc, char **argv)
#if defined(USE_SHADOW)
if (!(rule->options & NOPASS)) {
if (nflag)
errx(1, "Authorization required");
errx(1, "Authentication required");

shadowauth(mypw->pw_name, rule->options & PERSIST);
}
#elif !defined(USE_PAM)
/* no authentication provider, only allow NOPASS rules */
(void) nflag;
if (!(rule->options & NOPASS))
errx(1, "Authorization required");
errx(1, "Authentication required");
#endif

if ((p = getenv("PATH")) != NULL)
Expand Down
8 changes: 4 additions & 4 deletions pam.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ pamauth(const char *user, const char *myname, int interactive, int nopass, int p
#endif

if (!user || !myname)
errx(1, "Authorization failed");
errx(1, "Authentication failed");

ret = pam_start(PAM_SERVICE_NAME, myname, &conv, &pamh);
if (ret != PAM_SUCCESS)
Expand Down Expand Up @@ -277,7 +277,7 @@ pamauth(const char *user, const char *myname, int interactive, int nopass, int p

if (!nopass) {
if (!interactive)
errx(1, "Authorization required");
errx(1, "Authentication required");

/* doas style prompt for pam */
char host[HOST_NAME_MAX + 1];
Expand All @@ -291,7 +291,7 @@ pamauth(const char *user, const char *myname, int interactive, int nopass, int p
if (ret != PAM_SUCCESS) {
pamcleanup(ret, sess, cred);
syslog(LOG_AUTHPRIV | LOG_NOTICE, "failed auth for %s", myname);
errx(1, "Authorization failed");
errx(1, "Authentication failed");
}
}

Expand All @@ -304,7 +304,7 @@ pamauth(const char *user, const char *myname, int interactive, int nopass, int p
if (ret != PAM_SUCCESS) {
pamcleanup(ret, sess, cred);
syslog(LOG_AUTHPRIV | LOG_NOTICE, "failed auth for %s", myname);
errx(1, "Authorization failed");
errx(1, "Authentication failed");
}

/* set PAM_USER to the user we want to be */
Expand Down
8 changes: 4 additions & 4 deletions shadow.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ shadowauth(const char *myname, int persist)
if (hash[0] == 'x' && hash[1] == '\0') {
struct spwd *sp;
if ((sp = getspnam(myname)) == NULL)
errx(1, "Authorization failed");
errx(1, "Authentication failed");
hash = sp->sp_pwdp;
} else if (hash[0] != '*') {
errx(1, "Authorization failed");
errx(1, "Authentication failed");
}

char host[HOST_NAME_MAX + 1];
Expand All @@ -91,12 +91,12 @@ shadowauth(const char *myname, int persist)
err(1, "readpassphrase");
if ((encrypted = crypt(response, hash)) == NULL) {
explicit_bzero(rbuf, sizeof(rbuf));
errx(1, "Authorization failed");
errx(1, "Authentication failed");
}
explicit_bzero(rbuf, sizeof(rbuf));
if (strcmp(encrypted, hash) != 0) {
syslog(LOG_AUTHPRIV | LOG_NOTICE, "failed auth for %s", myname);
errx(1, "Authorization failed");
errx(1, "Authentication failed");
}

#ifdef USE_TIMESTAMP
Expand Down

0 comments on commit e8e8713

Please sign in to comment.