author | mickeyl <mickeyl> | 2005-03-20 18:03:31 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-03-20 18:03:31 (UTC) |
commit | 64104e14e4026658551e7283498eafbe3855e6d5 (patch) (unidiff) | |
tree | 488a9916344c2627441742ae97eebf9a18a48a86 /noncore | |
parent | 20aaf67029ac50afd8af8673db24721f10fbb43e (diff) | |
download | opie-64104e14e4026658551e7283498eafbe3855e6d5.zip opie-64104e14e4026658551e7283498eafbe3855e6d5.tar.gz opie-64104e14e4026658551e7283498eafbe3855e6d5.tar.bz2 |
#1560 fix opie-console picking up the wrong shell. patch courtesy Paul Eggleton (bluelightning)
-rw-r--r-- | noncore/apps/opie-console/consoleconfigwidget.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/consoleconfigwidget.cpp b/noncore/apps/opie-console/consoleconfigwidget.cpp index a6ad8d2..27d9a3f 100644 --- a/noncore/apps/opie-console/consoleconfigwidget.cpp +++ b/noncore/apps/opie-console/consoleconfigwidget.cpp | |||
@@ -5,13 +5,13 @@ | |||
5 | #include <qlistview.h> | 5 | #include <qlistview.h> |
6 | #include <qhbox.h> | 6 | #include <qhbox.h> |
7 | #include <stdio.h> | 7 | #include <stdio.h> |
8 | 8 | ||
9 | #include <pwd.h> | 9 | #include <pwd.h> |
10 | #include <sys/types.h> | 10 | #include <sys/types.h> |
11 | 11 | #include <unistd.h> | |
12 | 12 | ||
13 | #include "consoleconfigwidget.h" | 13 | #include "consoleconfigwidget.h" |
14 | 14 | ||
15 | ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent, | 15 | ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent, |
16 | const char* na ) | 16 | const char* na ) |
17 | : ProfileDialogConnectionWidget( name, parent, na ) { | 17 | : ProfileDialogConnectionWidget( name, parent, na ) { |
@@ -68,18 +68,18 @@ ConsoleConfigWidget::~ConsoleConfigWidget() { | |||
68 | void ConsoleConfigWidget::load( const Profile& prof ) { | 68 | void ConsoleConfigWidget::load( const Profile& prof ) { |
69 | /* | 69 | /* |
70 | * default to the users default shell | 70 | * default to the users default shell |
71 | */ | 71 | */ |
72 | struct passwd *ent = 0; | 72 | struct passwd *ent = 0; |
73 | char *shell = "/bin/sh"; | 73 | char *shell = "/bin/sh"; |
74 | int uid = getuid(); | ||
74 | 75 | ||
75 | while ( (ent = getpwent()) != 0 ) { | 76 | ent = getpwuid(uid); |
76 | if (ent->pw_shell != "") { | 77 | if (ent->pw_shell != "") { |
77 | shell = ent->pw_shell; | 78 | shell = ent->pw_shell; |
78 | } | 79 | } |
79 | } | ||
80 | 80 | ||
81 | m_cmd->setText(prof.readEntry("Command", shell )); | 81 | m_cmd->setText(prof.readEntry("Command", shell )); |
82 | int envcount = prof.readNumEntry("EnvVars", 0); | 82 | int envcount = prof.readNumEntry("EnvVars", 0); |
83 | for (int i=0; i<envcount; i++) { | 83 | for (int i=0; i<envcount; i++) { |
84 | QString name = prof.readEntry("Env_Name_" + QString::number(i), ""); | 84 | QString name = prof.readEntry("Env_Name_" + QString::number(i), ""); |
85 | QString value = prof.readEntry("Env_Value_" + QString::number(i), ""); | 85 | QString value = prof.readEntry("Env_Value_" + QString::number(i), ""); |