summaryrefslogtreecommitdiff
path: root/Source/Kernel/UserManager
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-11-25 18:42:44 +0100
committerAlexis211 <alexis211@gmail.com>2009-11-25 18:42:44 +0100
commita40fe1166ab1db972a8ca0380d603c4d90eede62 (patch)
treef92c2c02d9d78d68f7c116dff9ac508895f757af /Source/Kernel/UserManager
parentf367fe4e5a7712bafc121ce5c228f15e90fc5c93 (diff)
downloadMelon-a40fe1166ab1db972a8ca0380d603c4d90eede62.tar.gz
Melon-a40fe1166ab1db972a8ca0380d603c4d90eede62.zip
Re-organized file system stuff.
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) {