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

9.1-release9.2-releasereleng/10.0releng/10.0.1
Last change on this file since 1620346 was 1620346, checked in by Kris Moore <kris@…>, 12 months ago

Initial import of PC-BSD /current/ SVN repo

  • Property mode set to 100644
File size: 1.2 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
25class XProcess : public QProcess
26{
27        Q_OBJECT
28
29  public:
30        XProcess();
31        ~XProcess();
32        bool isRunning();
33        void waitForSessionClosed();
34 
35  public slots:
36        void loginToXSession(QString, QString, QString, QString); //user, pwd, homedir, cmd
37       
38  private:
39        QString xuser, xcmd, xhome, xpwd;
40        bool startXSession();
41       
42        // PAM stuff and simplification functions
43        pam_handle_t *pamh;  //handle for the PAM process structure
44        bool pam_started, pam_session_open;
45        bool pam_checkPW();
46        bool pam_startSession();
47        bool pam_stopSession();
48        void pam_logFailure(int);
49        void pam_shutdown(); //cleanly close all the PAM stuff
50       
51  private slots:
52        void slotCleanup(int, QProcess::ExitStatus);
53
54  signals:
55        void InvalidLogin();
56
57};
58#endif
Note: See TracBrowser for help on using the repository browser.