44 lines
1.6 KiB
Plaintext
44 lines
1.6 KiB
Plaintext
$OpenBSD: patch-kdesu_kdesu_kdesu_cpp,v 1.7 2005/01/31 16:58:22 espie Exp $
|
|
--- kdesu/kdesu/kdesu.cpp.orig Sun Nov 28 18:26:12 2004
|
|
+++ kdesu/kdesu/kdesu.cpp Mon Jan 31 17:44:27 2005
|
|
@@ -111,7 +111,8 @@ int main(int argc, char *argv[])
|
|
unsetenv( "SESSION_MANAGER" );
|
|
KApplication app;
|
|
// but propagate it to the started app
|
|
- setenv( "SESSION_MANAGER", session_manager.data(), 1 );
|
|
+ if (!session_manager.isNull())
|
|
+ setenv( "SESSION_MANAGER", session_manager.data(), 1 );
|
|
|
|
{
|
|
KStartupInfoId id;
|
|
@@ -325,10 +326,12 @@ static int startApp()
|
|
KConfig *config = KGlobal::config();
|
|
config->setGroup("Passwords");
|
|
int timeout = config->readNumEntry("Timeout", defTimeout);
|
|
+ bool useSudo = config->readBoolEntry("Sudo", defSudo);
|
|
|
|
// Check if we need a password
|
|
SuProcess proc;
|
|
proc.setUser(auth_user);
|
|
+ proc.setUseSudo(useSudo);
|
|
int needpw = proc.checkNeedPassword();
|
|
if (needpw < 0)
|
|
{
|
|
@@ -351,7 +354,7 @@ static int startApp()
|
|
KStartupInfoData data;
|
|
data.setSilent( KStartupInfoData::Yes );
|
|
KStartupInfo::sendChange( id, data );
|
|
- KDEsuDialog dlg(user, auth_user, keep && !terminal, icon);
|
|
+ KDEsuDialog dlg(user, auth_user, keep && !terminal, icon, useSudo);
|
|
if (prompt)
|
|
dlg.addLine(i18n("Command:"), command);
|
|
if ((priority != 50) || (scheduler != SuProcess::SchedNormal))
|
|
@@ -404,6 +407,7 @@ static int startApp()
|
|
proc.setTerminal(terminal);
|
|
proc.setErase(true);
|
|
proc.setUser(user);
|
|
+ proc.setUseSudo(useSudo);
|
|
if (!new_dcop)
|
|
{
|
|
proc.setXOnly(true);
|