diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2011-05-17 16:42:07 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2011-05-17 16:42:07 +0000 |
commit | b498efdbbf13b1eec08541e3b2084396c508c92e (patch) | |
tree | 35ca770df0ade0d4779b806dad394f6c33f2ef44 /usr.sbin/smtpd/smtpd.c | |
parent | e0c7be3d00700d446aaca5328e91f2b18c9beb1f (diff) |
smtpd now uses an auth_backend API to authenticate users that are allowed
to send mail so they do not necessarily need a local system account.
two backends are provided by default, bsd_auth(3) and getpwnam(3), however
smtpd will only select bsd_auth(3) for the moment and not provide a way to
chose any other backend (that's on purpose ;p).
bye bye authenticate() !
Diffstat (limited to 'usr.sbin/smtpd/smtpd.c')
-rw-r--r-- | usr.sbin/smtpd/smtpd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index 38d932c1411..2e4d1002cf8 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.124 2011/05/16 21:05:52 gilles Exp $ */ +/* $OpenBSD: smtpd.c,v 1.125 2011/05/17 16:42:06 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -87,6 +87,7 @@ parent_imsg(struct imsgev *iev, struct imsg *imsg) struct forward_req *fwreq; struct reload *reload; struct auth *auth; + struct auth_backend *auth_backend; int fd, r; if (iev->proc == PROC_SMTP) { @@ -96,8 +97,9 @@ parent_imsg(struct imsgev *iev, struct imsg *imsg) return; case IMSG_PARENT_AUTHENTICATE: + auth_backend = auth_backend_lookup(AUTH_BSD); auth = imsg->data; - auth->success = authenticate_user(auth->user, + auth->success = auth_backend->authenticate(auth->user, auth->pass); imsg_compose_event(iev, IMSG_PARENT_AUTHENTICATE, 0, 0, -1, auth, sizeof *auth); |