Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

Commit

Permalink
Added fix that prevents ntop to loop the "ask admin password" on the …
Browse files Browse the repository at this point in the history
…screem

when run in daemon mode.

Fix courtesy of Ambrose Li <a.c.li@ieee.org>
  • Loading branch information
deri committed Oct 14, 2002
1 parent dfa2409 commit 90c30d6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,10 +932,21 @@ static void addKeyIfMissing(char* key, char* value,

if((return_data.dptr == NULL) || (existingOK != 0)) {
char *thePw, pw1[16], pw2[16];

/* If not existing, then add user 'admin' and ask for password */

if(userQuestion != NULL) {
if (myGlobals.daemonMode) {
/*
* We need a password for the admin user, but the user requested
* daemon mode. stdin is already detached; getpass() would fail.
*
* Courtesy of Ambrose Li <a.c.li@ieee.org>
*
*/
traceEvent(TRACE_ERROR, "No password for admin user. Please re-run ntop in non-daemon mode first.\n");
exit(1);
}

memset(pw1, 0, sizeof(pw1)); memset(pw2, 0, sizeof(pw2));

while(pw1[0] == '\0') {
Expand Down

0 comments on commit 90c30d6

Please sign in to comment.