aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/Auth.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nxcomp/Auth.cpp')
-rwxr-xr-xnxcomp/Auth.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/nxcomp/Auth.cpp b/nxcomp/Auth.cpp
index 57e2070ec..78f93a013 100755
--- a/nxcomp/Auth.cpp
+++ b/nxcomp/Auth.cpp
@@ -55,6 +55,8 @@ Auth::Auth(char *display, char *cookie)
dataSize_ = 0;
+ generatedCookie_ = 0;
+
if (display == NULL || *display == '\0' || cookie == NULL ||
*cookie == '\0' || strlen(cookie) != 32)
{
@@ -316,16 +318,20 @@ int Auth::getCookie()
<< "auth command.\n" << logofs_flush;
#endif
+ #ifdef TEST
cerr << "Warning" << ": Failed to read data from the X "
<< "auth command.\n";
+ #endif
#ifdef PANIC
*logofs << "Auth: WARNING! Generating a fake cookie for "
<< "X authentication.\n" << logofs_flush;
#endif
+ #ifdef TEST
cerr << "Warning" << ": Generating a fake cookie for "
<< "X authentication.\n";
+ #endif
generateCookie(realCookie_);
}
@@ -621,6 +627,8 @@ void Auth::generateCookie(char *cookie)
data >>= 8;
}
+ generatedCookie_ = 1;
+
#ifdef TEST
*logofs << "Auth: Generated X cookie string '"
<< cookie << "'.\n" << logofs_flush;