source: src-qt4/PCDM/src/pcdm-xprocess.h @ 9cc1b3c

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1releng/10.1.1releng/10.1.2
Last change on this file since 9cc1b3c was 9cc1b3c, checked in by Ken Moore <ken@…>, 19 months ago

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

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/* PCDM Login Manager:
2*  Written by Ken Moore (ken@pcbsd.org) 2012/2013
3*  Copyright(c) 2013 by the PC-BSD Project
4*  Available under the 3-clause BSD license
5*/
6
7/*
8 Sub-classed widget for starting an XSession process
9*/
10
11#ifndef PCDM_XPROCESS_H
12#define PCDM_XPROCESS_H
13
14#include <QFile>
15#include <QDebug>
16#include <QProcess>
17#include <QProcessEnvironment>
18
19#include <sys/types.h>
20#include <security/pam_appl.h>
21#include <security/openpam.h>
22
23#include "pcdm-backend.h"
24
25#include <X11/Xauth.h>
26
27class XProcess : public QProcess
28{
29        Q_OBJECT
30
31  public:
32        XProcess();
33        ~XProcess();
34        bool isRunning();
35        void waitForSessionClosed();
36       
37        void startDesktop(); 
38       
39 
40  public slots:
41        void loginToXSession(QString, QString, QString); //user, pwd, desktop
42        void checkPW(QString,QString); //user, pwd
43        void setupDesktop(QString,QString,QString); //user, pwd, desktop
44       
45  private:
46        int fstatus; //fork status
47        pid_t fpid;  //fork pid
48        QString xuser, xcmd, xhome, xpwd, xde;
49        bool startXSession();
50       
51        // PAM stuff and simplification functions
52        pam_handle_t *pamh;  //handle for the PAM process structure
53        bool pam_started, pam_session_open;
54        bool pam_checkPW();
55        bool pam_startSession();
56        bool pam_stopSession();
57        void pam_logFailure(int);
58        void pam_shutdown(); //cleanly close all the PAM stuff
59        // XAuthoriy functions
60        Xauth XAUTH; //saved authority structure
61        char *XAUTHFILENAME; //file location for the authority file
62        void generateXAuth();
63        void revokeXAuth();
64       
65 
66  private slots:
67        void slotCleanup(int, QProcess::ExitStatus);
68
69  signals:
70        void ValidLogin();
71        void InvalidLogin();
72
73};
74#endif
Note: See TracBrowser for help on using the repository browser.