author | umopapisdn <umopapisdn> | 2003-03-28 13:12:09 (UTC) |
---|---|---|
committer | umopapisdn <umopapisdn> | 2003-03-28 13:12:09 (UTC) |
commit | b271d575fa05cf570a1a829136517761bd47e69b (patch) (side-by-side diff) | |
tree | e82c8e348b3b926fb365c42454d12a56dda0adc6 | |
parent | 8e8803488d2c11b12449e785802da4a5a9adad0f (diff) | |
download | opie-b271d575fa05cf570a1a829136517761bd47e69b.zip opie-b271d575fa05cf570a1a829136517761bd47e69b.tar.gz opie-b271d575fa05cf570a1a829136517761bd47e69b.tar.bz2 |
Bugfix: (bug #0000765) Lines in /etc/passwd & /etc/group starting with a "#" are comments and should not be editable.
-rw-r--r-- | noncore/settings/usermanager/opie-usermanager.control | 2 | ||||
-rw-r--r-- | noncore/settings/usermanager/passwd.cpp | 9 | ||||
-rw-r--r-- | noncore/settings/usermanager/userdialog.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/usermanager/usermanager.cpp | 4 |
4 files changed, 14 insertions, 3 deletions
diff --git a/noncore/settings/usermanager/opie-usermanager.control b/noncore/settings/usermanager/opie-usermanager.control index f971fdc..e1c7762 100644 --- a/noncore/settings/usermanager/opie-usermanager.control +++ b/noncore/settings/usermanager/opie-usermanager.control @@ -8,2 +8,2 @@ Maintainer: Ted Parnefors <zaurus@bredband.net> License: GPL -Description: User/Group manager for OPIE. +Description: User/Group manager for Opie. diff --git a/noncore/settings/usermanager/passwd.cpp b/noncore/settings/usermanager/passwd.cpp index 1e98778..f8e6d17 100644 --- a/noncore/settings/usermanager/passwd.cpp +++ b/noncore/settings/usermanager/passwd.cpp @@ -209,7 +209,12 @@ bool Passwd::searchGroup(QRegExp &groupRegExp) { } else { - groupString=(*(tempStringList.begin())); + for(QStringList::Iterator it=tempStringList.begin(); it!=tempStringList.end(); it++) { + groupString=*it; + if(!groupString.find(QRegExp("^#"),0)) { // Skip commented lines. splitGroupEntry(groupString); - } return true; } + } + } + return false; +} diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp index 0d2122b..c06f639 100644 --- a/noncore/settings/usermanager/userdialog.cpp +++ b/noncore/settings/usermanager/userdialog.cpp @@ -46,2 +46,3 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod accounts->splitGroupEntry(*it); + if(accounts->gr_name.find(QRegExp("^#"),0)) { // Skip commented lines. new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox); @@ -49,2 +50,3 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod } + } showMaximized(); diff --git a/noncore/settings/usermanager/usermanager.cpp b/noncore/settings/usermanager/usermanager.cpp index 57efa71..1946013 100644 --- a/noncore/settings/usermanager/usermanager.cpp +++ b/noncore/settings/usermanager/usermanager.cpp @@ -128,2 +128,3 @@ void UserConfig::getUsers() { accounts->splitPasswdEntry(*it); // Split the string into it's components and store in variables in the accounts object. ("pr_name" and so on.) + if(accounts->pw_name.find(QRegExp("^#"),0)) { // Skip commented lines. new QListViewItem(usersListView,QString::number(accounts->pw_uid),accounts->pw_name,accounts->pw_gecos); @@ -139,2 +140,3 @@ void UserConfig::getUsers() { } + } usersIconView->sort(); @@ -218,2 +220,3 @@ void UserConfig::getGroups() { accounts->splitGroupEntry(*it); // Split the line into its components and fill the variables of 'accounts'. (gr_name, gr_uid & gr_mem). + if(accounts->gr_name.find(QRegExp("^#"),0)) { // Skip commented lines. new QListViewItem(groupsListView,QString::number(accounts->gr_gid),accounts->gr_name); @@ -222,2 +225,3 @@ void UserConfig::getGroups() { } +} |