aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/Auth.cpp
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2011-11-13 09:27:52 +0100
committerReinhard Tartler <siretart@tauware.de>2011-11-13 09:27:52 +0100
commit92239dafb601d2ee5da1554d19631267c81fe57c (patch)
tree8a2b406e1d1c66c459e6c4dc3f908b60d2feacd1 /nxcomp/Auth.cpp
parentd7a8d67d760a80962821f6951caee5a9c807f5be (diff)
downloadnx-libs-92239dafb601d2ee5da1554d19631267c81fe57c.tar.gz
nx-libs-92239dafb601d2ee5da1554d19631267c81fe57c.tar.bz2
nx-libs-92239dafb601d2ee5da1554d19631267c81fe57c.zip
Imported nxcomp-3.2.0-6.tar.gznxcomp/3.2.0-6
Summary: Imported nxcomp-3.2.0-6.tar.gz Keywords: Imported nxcomp-3.2.0-6.tar.gz into Git repository
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;