diff options
author | Alexis211 <alexis211@gmail.com> | 2009-10-24 18:24:46 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-10-24 18:24:46 +0200 |
commit | b639b99b3e8f4cf77560d8d473b13d992ac8eb10 (patch) | |
tree | 63ebeec75f4ab71d73d743afca04a98636dee165 /Source/Kernel/UserManager | |
parent | f62cfdc8ff6297616d68f6b195db7abc82ab457b (diff) | |
download | Melon-b639b99b3e8f4cf77560d8d473b13d992ac8eb10.tar.gz Melon-b639b99b3e8f4cf77560d8d473b13d992ac8eb10.zip |
More work on userland syscalls : Files are implemented.
TextFile now is a common (= kernel and userland) library.
Diffstat (limited to 'Source/Kernel/UserManager')
-rw-r--r-- | Source/Kernel/UserManager/Usr.ns.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/Kernel/UserManager/Usr.ns.cpp b/Source/Kernel/UserManager/Usr.ns.cpp index a551344..db371ae 100644 --- a/Source/Kernel/UserManager/Usr.ns.cpp +++ b/Source/Kernel/UserManager/Usr.ns.cpp @@ -1,9 +1,10 @@ #include "Usr.ns.h" +#include <Core/Log.ns.h> #include <UserManager/User.class.h> #include <SimpleList.class.h> #include <TaskManager/Task.ns.h> -#include <VFS/TextFile.class.h> +#include <TextFile.class.h> /* * Syntax for Users and Groups configuration files : one entry per line @@ -29,6 +30,10 @@ void load() { m_groups = m_groups->cons(Group(data[1], data[0].toInt())); } } + if (m_groups == 0) { + m_groups = m_groups->cons(Group("root", 0)); //In case, add a default group + Log::log(KL_WARNING, "Usr.ns : group file invalid, had to add default group."); + } TextFile users("/System/Configuration/Users", FM_READ); while (!users.eof()) { @@ -38,6 +43,10 @@ void load() { m_users = m_users->cons(User(data[1], data[4], group(data[2].toInt()), data[3], data[0].toInt())); } } + if (m_users == 0) { + m_users = m_users->cons(User("melon", "MelOS", group(0), "", 0)); + Log::log(KL_WARNING, "Usr.ns : users file invalid, had to add default users."); + } } void save() { |