diff options
| author | Sebastien Braun | 2010-10-06 15:01:33 +0200 |
|---|---|---|
| committer | Sebastien Braun | 2010-10-06 15:01:33 +0200 |
| commit | 9602e1063f5459d9ca05ba8f90304b7d34072561 (patch) | |
| tree | 606bccc73e6f9954dcb6896b53f4bef6fd96baaf /src/input/pvsCheckPrivileges.h | |
| parent | Add headers containing translated strings to sources for pvsmgr[touch] (diff) | |
| download | pvs-9602e1063f5459d9ca05ba8f90304b7d34072561.tar.gz pvs-9602e1063f5459d9ca05ba8f90304b7d34072561.tar.xz pvs-9602e1063f5459d9ca05ba8f90304b7d34072561.zip | |
Implement administratively configured user privileges
The administrator can set a list of users and a list of groups to
see as privileged. This list is reloaded whenever the configuration
file changes, or changes to the user/group database are detected.
Diffstat (limited to 'src/input/pvsCheckPrivileges.h')
| -rw-r--r-- | src/input/pvsCheckPrivileges.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/input/pvsCheckPrivileges.h b/src/input/pvsCheckPrivileges.h index e5cc9a4..fc82e4c 100644 --- a/src/input/pvsCheckPrivileges.h +++ b/src/input/pvsCheckPrivileges.h @@ -19,7 +19,10 @@ #define PVSCHECKPRIVILEGES_H_ #include <sys/types.h> +#include <QObject> #include <QString> +#include <QList> +#include <QMultiMap> #include <QHash> #include "inputEventHandler.h" @@ -64,8 +67,11 @@ struct CachedInputContext }; uint qHash(CachedInputContext const& p); -class PVSCheckPrivileges +class QFileSystemWatcher; + +class PVSCheckPrivileges : public QObject { + Q_OBJECT public: typedef enum { SESSION_LOOKUP_FAILURE, // Comes first because we default to assume @@ -115,8 +121,12 @@ public: QString getX11SessionName(CachedInputContext const& sender); QString getX11DisplayDevice(CachedInputContext const& sender); +public slots: + void updateCachedUserDatabase(); + void rereadConfiguration(); + private: - PVSCheckPrivileges(); + PVSCheckPrivileges(QObject* parent = 0); virtual ~PVSCheckPrivileges(); typedef QPair<pid_t, QPair<uid_t, gid_t> > piduidgid; @@ -134,6 +144,11 @@ private: QHash<CachedInputContext, UserPrivilege> _savedUserPrivilege; QHash<CachedInputContext, SessionKind> _savedSessionKind; QHash<CachedInputContext, QString> _savedConsoleKitSession; + + QList<uid_t> _privilegedUsers; + QList<gid_t> _privilegedGroups; + QMultiMap<uid_t, gid_t> _userGroupMap; + QFileSystemWatcher* _watcher; }; #endif /* PVSCHECKPRIVILEGES_H_ */ |
