KDEsu
su.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef __SU_h_Included__
00014 #define __SU_h_Included__
00015
00016 #include <qcstring.h>
00017
00018 #include <kdelibs_export.h>
00019
00020 #include "stub.h"
00021
00026 class KDESU_EXPORT SuProcess: public StubProcess
00027 {
00028 public:
00029 SuProcess(const QCString &user=0, const QCString &command=0);
00030 ~SuProcess();
00031
00032 enum Errors { SuNotFound=1, SuNotAllowed, SuIncorrectPassword };
00033
00037 enum checkMode { NoCheck=0, Install=1, NeedPassword=2 } ;
00038 int exec(const char *password, int check=NoCheck);
00039
00044 int checkInstall(const char *password);
00045
00049 int checkNeedPassword();
00050
00051 private:
00052 enum SuErrors { error=-1, ok=0, killme=1, notauthorized=2 } ;
00053 int ConverseSU(const char *password);
00054
00055 protected:
00056 virtual void virtual_hook( int id, void* data );
00057 private:
00058 class SuProcessPrivate;
00059 SuProcessPrivate *d;
00060 QString superUserCommand;
00061 };
00062
00063 #endif