No empty .Rs/.Re
[netbsd-mini2440.git] / crypto / dist / heimdal / appl / popper / pop_user.c
blobdbf354e2627361e32871e17a4d9245c3443a812a
1 /*
2 * Copyright (c) 1989 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 */
7 #include <popper.h>
8 __RCSID("$Heimdal: pop_user.c 15289 2005-05-29 21:44:30Z lha $"
9 "$NetBSD$");
11 /*
12 * user: Prompt for the user name at the start of a POP session
15 int
16 pop_user (POP *p)
18 strlcpy(p->user, p->pop_parm[1], sizeof(p->user));
20 if (p->auth_level == AUTH_OTP) {
21 #ifdef OTP
22 char ss[256], *s;
24 if(otp_challenge (&p->otp_ctx, p->user, ss, sizeof(ss)) == 0)
25 return pop_msg(p, POP_SUCCESS, "Password %s required for %s.",
26 ss, p->user);
27 s = otp_error(&p->otp_ctx);
28 return pop_msg(p, POP_FAILURE, "Permission denied%s%s",
29 s ? ":" : "", s ? s : "");
30 #endif
32 if (p->auth_level == AUTH_SASL) {
33 return pop_msg(p, POP_FAILURE, "Permission denied");
35 return pop_msg(p, POP_SUCCESS, "Password required for %s.", p->user);