summaryrefslogtreecommitdiff
path: root/noncore/settings/usermanager/passwd.cpp
authorumopapisdn <umopapisdn>2003-03-28 13:12:09 (UTC)
committer umopapisdn <umopapisdn>2003-03-28 13:12:09 (UTC)
commitb271d575fa05cf570a1a829136517761bd47e69b (patch) (side-by-side diff)
treee82c8e348b3b926fb365c42454d12a56dda0adc6 /noncore/settings/usermanager/passwd.cpp
parent8e8803488d2c11b12449e785802da4a5a9adad0f (diff)
downloadopie-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.
Diffstat (limited to 'noncore/settings/usermanager/passwd.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/usermanager/passwd.cpp11
1 files changed, 8 insertions, 3 deletions
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
@@ -207,10 +207,15 @@ bool Passwd::searchGroup(QRegExp &groupRegExp) {
if((tempStringList.isEmpty())) {
return false;
} else {
- groupString=(*(tempStringList.begin()));
- splitGroupEntry(groupString);
+ 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 true;
+ return false;
}
// Find a group by groupname.