Diffstat (limited to 'noncore/settings/usermanager/passwd.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/usermanager/passwd.cpp | 9 |
1 files changed, 7 insertions, 2 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 | |||
@@ -204,17 +204,22 @@ bool Passwd::delUser(int uid, bool delGroup) { | |||
204 | // Locate a group in the groupStringList, fill out the gr_* variables and return "true" if found. | 204 | // Locate a group in the groupStringList, fill out the gr_* variables and return "true" if found. |
205 | bool Passwd::searchGroup(QRegExp &groupRegExp) { | 205 | bool Passwd::searchGroup(QRegExp &groupRegExp) { |
206 | QStringList tempStringList(groupStringList.grep(groupRegExp)); | 206 | QStringList tempStringList(groupStringList.grep(groupRegExp)); |
207 | if((tempStringList.isEmpty())) { | 207 | if((tempStringList.isEmpty())) { |
208 | return false; | 208 | return false; |
209 | } else { | 209 | } else { |
210 | groupString=(*(tempStringList.begin())); | 210 | for(QStringList::Iterator it=tempStringList.begin(); it!=tempStringList.end(); it++) { |
211 | groupString=*it; | ||
212 | if(!groupString.find(QRegExp("^#"),0)) {// Skip commented lines. | ||
211 | splitGroupEntry(groupString); | 213 | splitGroupEntry(groupString); |
212 | } | ||
213 | return true; | 214 | return true; |
214 | } | 215 | } |
216 | } | ||
217 | } | ||
218 | return false; | ||
219 | } | ||
215 | 220 | ||
216 | // Find a group by groupname. | 221 | // Find a group by groupname. |
217 | bool Passwd::findGroup(const char *groupname) { | 222 | bool Passwd::findGroup(const char *groupname) { |
218 | QRegExp groupRegExp(QString("^%1\\:").arg(groupname)); | 223 | QRegExp groupRegExp(QString("^%1\\:").arg(groupname)); |
219 | return searchGroup(groupRegExp); | 224 | return searchGroup(groupRegExp); |
220 | } | 225 | } |