Permalink
Browse files

Turn on the "-auth <authfile>" option for xinit in PCDMd

  • Loading branch information...
1 parent 6763bdf commit 9cc1b3c60a5315d28fdc5c9b5631319c6f3de387 Ken Moore committed Oct 29, 2013
Showing with 29 additions and 1 deletion.
  1. +1 −1 src-qt4/PCDM/src/main.cpp
  2. +20 −0 src-qt4/PCDM/src/pcdm-xprocess.cpp
  3. +8 −0 src-qt4/PCDM/src/pcdm-xprocess.h
@@ -25,7 +25,7 @@
#define TMPLANGFILE QString("/tmp/.PCDMLang")
#define TMPAUTOLOGINFILE QString("/tmp/.PCDMAutoLogin")
-
+#define TMPAUTHFILE QString("/tmp/.PCDMAuth")
//Make sure that prefix is set
//#ifndef prefix
//#define prefix "/usr/local/"
@@ -406,3 +406,23 @@ void XProcess::pam_shutdown(){
pam_started = FALSE;
}
}
+// -------------------------------------------
+// XAUTHORITY FUNCTIONS
+// -------------------------------------------
+void XProcess::generateXAuth(){
+ //determine the filename
+ XAUTHFILENAME = XauFileName();
+ //generate the structure
+ XAUTH = new Xauth;
+ XAUTH->
+ //open the file (as new)
+ FILE *XFILE = fopen( XAUTHFILENAME, "w+" );
+ //Write the authorization file
+ XauWriteAuth( XFILE, XAUTH );
+ //Now close the file
+ fclose(XFILE);
+}
+
+void XProcess::revokeXAuth(){
+
+}
@@ -22,6 +22,8 @@
#include "pcdm-backend.h"
+#include <X11/Xauth.h>
+
class XProcess : public QProcess
{
Q_OBJECT
@@ -54,7 +56,13 @@ class XProcess : public QProcess
bool pam_stopSession();
void pam_logFailure(int);
void pam_shutdown(); //cleanly close all the PAM stuff
+ // XAuthoriy functions
+ Xauth XAUTH; //saved authority structure
+ char *XAUTHFILENAME; //file location for the authority file
+ void generateXAuth();
+ void revokeXAuth();
+
private slots:
void slotCleanup(int, QProcess::ExitStatus);

0 comments on commit 9cc1b3c

Please sign in to comment.