Skip to content
Snippets Groups Projects
Commit e1be7134 authored by rswindell's avatar rswindell
Browse files

Don't require sysop system password re-authentication unless 15 minutes

or more have elapsed since the last system password (SY:) prompt. Similar
to Linux 'sudo' command. Might make this time configurable rather than
hard-coded at some point, but 15 minutes seems like a good default.
parent 47015a57
No related branches found
No related tags found
No related merge requests found
/* con_hi.cpp */
/* Synchronet hi-level console routines */ /* Synchronet hi-level console routines */
// vi: tabstop=4
/* $Id$ */ /* $Id$ */
...@@ -155,6 +154,8 @@ bool sbbs_t::chksyspass(const char* sys_pw) ...@@ -155,6 +154,8 @@ bool sbbs_t::chksyspass(const char* sys_pw)
logline(LOG_NOTICE,"S!","Remote sysop access disabled"); logline(LOG_NOTICE,"S!","Remote sysop access disabled");
return(false); return(false);
} }
if(time(NULL) - last_sysop_auth < 15*60)
return true;
if(sys_pw != NULL) if(sys_pw != NULL)
SAFECOPY(str, sys_pw); SAFECOPY(str, sys_pw);
else { else {
...@@ -172,5 +173,6 @@ bool sbbs_t::chksyspass(const char* sys_pw) ...@@ -172,5 +173,6 @@ bool sbbs_t::chksyspass(const char* sys_pw)
logline(LOG_NOTICE,"S!",str2); logline(LOG_NOTICE,"S!",str2);
return(false); return(false);
} }
last_sysop_auth = time(NULL);
return(true); return(true);
} }
...@@ -3162,6 +3162,7 @@ sbbs_t::sbbs_t(ushort node_num, union xp_sockaddr *addr, size_t addr_len, const ...@@ -3162,6 +3162,7 @@ sbbs_t::sbbs_t(ushort node_num, union xp_sockaddr *addr, size_t addr_len, const
scanposts_inside = false; scanposts_inside = false;
scansubs_inside = false; scansubs_inside = false;
timeleft = 60*10; /* just incase this is being used for calling gettimeleft() */ timeleft = 60*10; /* just incase this is being used for calling gettimeleft() */
last_sysop_auth = 0;
uselect_total = 0; uselect_total = 0;
lbuflen = 0; lbuflen = 0;
keybufbot=keybuftop=0; /* initialize [unget]keybuf pointers */ keybufbot=keybuftop=0; /* initialize [unget]keybuf pointers */
......
...@@ -463,6 +463,7 @@ public: ...@@ -463,6 +463,7 @@ public:
ulong console; /* Defines current Console settings */ ulong console; /* Defines current Console settings */
char wordwrap[81]; /* Word wrap buffer */ char wordwrap[81]; /* Word wrap buffer */
time_t now, /* Used to store current time in Unix format */ time_t now, /* Used to store current time in Unix format */
last_sysop_auth,/* Time sysop was last authenticated */
answertime, /* Time call was answered */ answertime, /* Time call was answered */
logontime, /* Time user logged on */ logontime, /* Time user logged on */
starttime, /* Time stamp to use for time left calcs */ starttime, /* Time stamp to use for time left calcs */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment