Thread: [srvx-commits] CVS: services/src nickserv.c,1.218,1.219
Brought to you by:
entrope
|
From: Zoot <zo...@us...> - 2002-12-15 10:20:34
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv12539/src
Modified Files:
nickserv.c
Log Message:
Include checks for authenticated users in allowauth; hoist stamped checks in e-mail system to the top half, *before* e-mails are sent.
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.218
retrieving revision 1.219
diff -C2 -r1.218 -r1.219
*** nickserv.c 15 Dec 2002 09:59:38 -0000 1.218
--- nickserv.c 15 Dec 2002 10:20:31 -0000 1.219
***************
*** 134,141 ****
#define NSMSG_HOSTMASK_INVALID "Your hostmask is not valid for account $b%s$b."
#define NSMSG_USER_IS_SERVICE "$b%s$b is a network service; you can only use that command on real users."
#define NSMSG_STAMPED_REGISTER "You have already authenticated to an account once this session; you may not register a new account."
#define NSMSG_STAMPED_AUTH "You have already authenticated to an account once this session; you may not authenticate to another."
! #define NSMSG_STAMPED_COOKIE "You have already authenticated to an account once this session; you may not use this cookie."
#define NSMSG_HANDLEINFO_ON "Account information for $b%s$b:"
--- 134,144 ----
#define NSMSG_HOSTMASK_INVALID "Your hostmask is not valid for account $b%s$b."
#define NSMSG_USER_IS_SERVICE "$b%s$b is a network service; you can only use that command on real users."
+ #define NSMSG_USER_PREV_AUTH "$b%s$b is already authenticated."
+ #define NSMSG_USER_PREV_STAMP "$b%s$b has authenticated to an account once and cannot authenticate again."
#define NSMSG_STAMPED_REGISTER "You have already authenticated to an account once this session; you may not register a new account."
#define NSMSG_STAMPED_AUTH "You have already authenticated to an account once this session; you may not authenticate to another."
! #define NSMSG_STAMPED_RSTPASS "You have already authenticated to an account once this session; you may not reset your password to authenticate again."
! #define NSMSG_STAMPED_AUTHCOOKIE "You have already authenticated to an account once this session; you may not use a cookie to authenticate to another account."
#define NSMSG_HANDLEINFO_ON "Account information for $b%s$b:"
***************
*** 1474,1477 ****
--- 1477,1491 ----
return 0;
}
+ if (target->handle_info) {
+ nickserv_notice(user, NSMSG_USER_PREV_AUTH, target->nick);
+ return 0;
+ }
+ if (IsStamped(target)) {
+ /* Unauthenticated users might still have been stamped
+ previously and could therefore have a hidden host;
+ do not allow them to authenticate to an account. */
+ nickserv_notice(target, NSMSG_USER_PREV_STAMP, target->nick);
+ return 0;
+ }
if (argc == 2) hi = NULL;
else if (!(hi = get_handle_info(argv[2]))) {
***************
*** 1508,1511 ****
--- 1522,1532 ----
return 0;
}
+ if (IsStamped(user)) {
+ /* Unauthenticated users might still have been stamped
+ previously and could therefore have a hidden host;
+ do not allow them to authenticate to an account. */
+ nickserv_notice(user, NSMSG_STAMPED_AUTHCOOKIE);
+ return 0;
+ }
if (!(hi = get_handle_info(argv[1]))) {
nickserv_notice(user, MSG_HANDLE_UNKNOWN, argv[1]);
***************
*** 1555,1558 ****
--- 1576,1586 ----
return 0;
}
+ if (IsStamped(user)) {
+ /* Unauthenticated users might still have been stamped
+ previously and could therefore have a hidden host;
+ do not allow them to activate an account. */
+ nickserv_notice(user, NSMSG_STAMPED_RSTPASS);
+ return 0;
+ }
if (!(hi = get_handle_info(argv[1]))) {
nickserv_notice(user, MSG_HANDLE_UNKNOWN, argv[1]);
***************
*** 1598,1608 ****
switch (hi->cookie->type) {
case ACTIVATION:
- if (IsStamped(user)) {
- /* Unauthenticated users might still have been stamped
- previously and could therefore have a hidden host;
- do not allow them to activate a new account. */
- nickserv_notice(user, NSMSG_STAMPED_COOKIE);
- return 0;
- }
safestrncpy(hi->passwd, hi->cookie->data, sizeof(hi->passwd));
set_user_handle_info(user, hi, 1);
--- 1626,1629 ----
***************
*** 1610,1620 ****
break;
case PASSWORD_CHANGE:
- if (IsStamped(user)) {
- /* Unauthenticated users might still have been stamped
- previously and could therefore have a hidden host;
- do not allow them to activate an account. */
- nickserv_notice(user, NSMSG_STAMPED_COOKIE);
- return 0;
- }
set_user_handle_info(user, hi, 1);
safestrncpy(hi->passwd, hi->cookie->data, sizeof(hi->passwd));
--- 1631,1634 ----
***************
*** 1626,1636 ****
break;
case ALLOWAUTH:
- if (IsStamped(user)) {
- /* Unauthenticated users might still have been stamped
- previously and could therefore have a hidden host;
- do not allow them to authenticate to an account. */
- nickserv_notice(user, NSMSG_STAMPED_COOKIE);
- return 0;
- }
set_user_handle_info(user, hi, 1);
nickserv_notice(user, NSMSG_AUTH_SUCCESS);
--- 1640,1643 ----
|