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

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since 577dd9b was 577dd9b, checked in by Ken Moore <ken@…>, 17 months ago

Setup the PCDM main session process to run fork and setsid to start the process.
Also add the beginning of the changes to the xprocess class to change over to running C process commands rather than using a QProcess for starting the desktop session.
You just need to change the USECLIBS flag at the top of main.cpp to switch which one to use.

  • Property mode set to 100644
File size: 1.4 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        void startDesktop(); 
36       
37 
38  public slots:
39        void loginToXSession(QString, QString, QString); //user, pwd, desktop
40        void checkPW(QString,QString); //user, pwd
41        void setupDesktop(QString,QString,QString); //user, pwd, desktop
42       
43  private:
44        int fstatus; //fork status
45        pid_t fpid;  //fork pid
46        QString xuser, xcmd, xhome, xpwd, xde;
47        bool startXSession();
48       
49        // PAM stuff and simplification functions
50        pam_handle_t *pamh;  //handle for the PAM process structure
51        bool pam_started, pam_session_open;
52        bool pam_checkPW();
53        bool pam_startSession();
54        bool pam_stopSession();
55        void pam_logFailure(int);
56        void pam_shutdown(); //cleanly close all the PAM stuff
57       
58  private slots:
59        void slotCleanup(int, QProcess::ExitStatus);
60
61  signals:
62        void ValidLogin();
63        void InvalidLogin();
64
65};
66#endif
Note: See TracBrowser for help on using the repository browser.