diff --git a/clite/commands.js b/clite/commands.js index a58e844..56c5afa 100644 --- a/clite/commands.js +++ b/clite/commands.js @@ -39,7 +39,11 @@ Options: function writeNodeData(node) { if (long) { - io.write(node.perms+'\t'+node.uid+'\t'+node.gid+'\t'+node.name); + if (node.data.islink) { + io.write(node.perms+'\t'+node.uid+'\t'+node.gid+'\t'+node.name+' -> '+node.data.content); + }else{ + io.write(node.perms+'\t'+node.uid+'\t'+node.gid+'\t'+node.name); + } }else{ io.write(node.name); } diff --git a/clite/core.js b/clite/core.js index 82f1667..1bbcbfd 100644 --- a/clite/core.js +++ b/clite/core.js @@ -213,7 +213,7 @@ clite.user = { var udata = { name:'root', uid:0, - group:0, + gid:0, groups:[] }; clite.user.getUID = function() { @@ -232,7 +232,7 @@ clite.user = { function setLogin(user,uid,gid,groups) { udata.name = user; udata.uid = uid; - udata.group = gid; + udata.gid = gid; udata.groups = groups; clite.shell.env.HOME = '/usr/home/'+user; clite.shell.env.PWD = '/usr/home/'+user; @@ -251,6 +251,7 @@ clite.user = { n.uid = 1; n.gid = 1; } + vfs.mkLink('/usr/home/guest/web','/usr/share/site'); setLogin('guest',1,1,[]); clite.events.refocus(); } @@ -492,6 +493,8 @@ clite.vfs = { return true; if (node.uid == clite.user.getUID() && node.perms[1] == 'r') return true; + if (clite.user.getUID() == 0) + return true; return false; } function mkNode() { @@ -609,7 +612,7 @@ clite.vfs = { n.data.parent = parent; n.data.islink = true; n.data.content = target; - n.perms = 'lrwxr-xr-x'; + n.perms = 'lrw-r--r--'; n.uid = clite.user.getUID(); n.gid = clite.user.getGID(); parent.data.content.push(n); @@ -628,6 +631,7 @@ clite.vfs = { vfsdata.api.mkDir('/usr/clite/web'); vfsdata.api.mkDir('/usr/home'); vfsdata.api.mkDir('/usr/share'); + vfsdata.api.mkDir('/usr/share/site'); vfsdata.api.mkDir('/var'); vfsdata.api.mkFile('/var/logs');