Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
lcferrum committed Dec 22, 2013
1 parent a96e05a commit 2a0624d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions qtc_packaging/debian_harmattan/control
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Homepage: https://github.com/lcferrum
Package: hmtsu
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Recommends: busybox (>= 1.20) | which, busybox-symlinks-procps (>= 1.20) | procps, dpkg
Description: HMTsu is a frontend to devel-su, sudo and ariadne.
Inspired by gksu, it's primary purpose is to run graphical programs
that need root without the need to run an terminal emulator and using
Expand Down
1 change: 1 addition & 0 deletions src/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ void Context::Run()
if (Tools) {
Tools->Run(user, login, kpp_env, command, splash, splash_lscape);
delete Tools;
Tools=NULL;
}
}

Expand Down
6 changes: 1 addition & 5 deletions src/pswtools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

using namespace std;

Q_DECLARE_METATYPE(RunModes::QmlEnum)

PswTools::PswTools():
QObject(NULL), prepared(false), no_pass(false), pw_passwd()
{
Expand Down Expand Up @@ -62,14 +60,12 @@ bool PswTools::PrepareForCheck(RunModes::QmlEnum mode, const QString &target_use
return false;
}

bool PswTools::CheckSuNoPass()
void PswTools::CheckSuNoPass()
{
//if (user_record->pw_uid==getuid()||!getuid())
if (getuid()==ROOT_UID) {
no_pass=true;
}

return true;
}

bool PswTools::CheckSudoNoPass()
Expand Down
2 changes: 1 addition & 1 deletion src/pswtools.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PswTools: public QObject, protected IntercomHandler {
bool no_pass;
QByteArray pw_passwd;
bool PrepareForCheck(RunModes::QmlEnum mode, const QString &target_user);
bool CheckSuNoPass();
void CheckSuNoPass();
bool CheckSudoNoPass();
public:
PswTools();
Expand Down

0 comments on commit 2a0624d

Please sign in to comment.