KDEsu
su.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __SU_h_Included__
00012 #define __SU_h_Included__
00013
00014 #include <kdesu/kdesu_export.h>
00015
00016 #include "stub.h"
00017
00018
00019 namespace KDESu {
00020
00025 class KDESU_EXPORT SuProcess: public StubProcess
00026 {
00027 public:
00028 explicit SuProcess(const QByteArray &user=0, const QByteArray &command=0);
00029 ~SuProcess();
00030
00031 enum Errors { SuNotFound=1, SuNotAllowed, SuIncorrectPassword };
00032
00036 enum checkMode { NoCheck=0, Install=1, NeedPassword=2 } ;
00037 int exec(const char *password, int check=NoCheck);
00038
00043 int checkInstall(const char *password);
00044
00048 int checkNeedPassword();
00049
00054 QString superUserCommand();
00055
00061 bool useUsersOwnPassword();
00062
00063 private:
00064 enum SuErrors { error=-1, ok=0, killme=1, notauthorized=2 } ;
00065 int ConverseSU(const char *password);
00066
00067 protected:
00068 virtual void virtual_hook( int id, void* data );
00069 private:
00070 class SuProcessPrivate;
00071 SuProcessPrivate * const d;
00072 };
00073
00074 }
00075
00076 #endif