summaryrefslogtreecommitdiff
path: root/Source/Kernel/UserManager
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-11-29 12:30:07 +0100
committerAlexis211 <alexis211@gmail.com>2009-11-29 12:30:07 +0100
commit74dea7d492d6d352bfacb147b1c08ad0cf0a8b29 (patch)
treef613c8395b75a68e51d69c24eb3acdb0816ad509 /Source/Kernel/UserManager
parentd3e4ef59cbb45f02e07fe17fb7c58cba3c737900 (diff)
parenta913d4c2cb4daf10c0eac4d548fccb26b2a9f099 (diff)
downloadMelon-74dea7d492d6d352bfacb147b1c08ad0cf0a8b29.tar.gz
Melon-74dea7d492d6d352bfacb147b1c08ad0cf0a8b29.zip
Merge branch 'mountpoints' of github.com:Alexis211/Melon into mountpoints
Diffstat (limited to 'Source/Kernel/UserManager')
-rw-r--r--Source/Kernel/UserManager/Usr.ns.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/Source/Kernel/UserManager/Usr.ns.cpp b/Source/Kernel/UserManager/Usr.ns.cpp
index ecf9bae..66e159e 100644
--- a/Source/Kernel/UserManager/Usr.ns.cpp
+++ b/Source/Kernel/UserManager/Usr.ns.cpp
@@ -26,11 +26,13 @@ void load() {
if (VFS::find("/System/Configuration/Groups")) VFS::find("/System/Configuration/Groups")->setPermissions(0600);
if (VFS::find("/System/Configuration/Users")) VFS::find("/System/Configuration/Users")->setPermissions(0600);
TextFile groups("/System/Configuration/Groups", FM_READ);
- while (!groups.eof()) {
- String s = groups.readLine();
- Vector<String> data = s.split(":");
- if (data.size() == 2 and !(s[0] == WChar("#"))) {
- m_groups = m_groups->cons(Group(data[1], data[0].toInt()));
+ if (groups.valid()) {
+ while (!groups.eof()) {
+ String s = groups.readLine();
+ Vector<String> data = s.split(":");
+ if (data.size() == 2 and !(s[0] == WChar("#"))) {
+ m_groups = m_groups->cons(Group(data[1], data[0].toInt()));
+ }
}
}
if (m_groups == 0) {
@@ -39,12 +41,14 @@ void load() {
}
TextFile users("/System/Configuration/Users", FM_READ);
- while (!users.eof()) {
- String s = users.readLine();
- if (s == "" or s[0] == WChar("#")) continue;
- Vector<String> data = s.split(":");
- if (data.size() == 6) {
- m_users = m_users->cons(User(data[1], data[4], data[5], group(data[2].toInt()), data[3], data[0].toInt()));
+ if (users.valid()) {
+ while (!users.eof()) {
+ String s = users.readLine();
+ if (s == "" or s[0] == WChar("#")) continue;
+ Vector<String> data = s.split(":");
+ if (data.size() == 6) {
+ m_users = m_users->cons(User(data[1], data[4], data[5], group(data[2].toInt()), data[3], data[0].toInt()));
+ }
}
}
if (m_users == 0) {