vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

commit e399db13cacb63f1a2c362e2548b6a4afd16e9f9
parent d2a5337d0444a374d2577f5d68f13169fe772b94
Author: Jesus Galan Lopez (yiyus) <yiyu.jgl@gmail.com>
Date:   Sat, 18 Sep 2010 23:29:30 +0200

some fixes

Diffstat:
Mdoc/9vx.1 | 2+-
Msrc/9vx/conf.c | 2+-
Msrc/9vx/devfs-posix.c | 6+++---
Msrc/9vx/main.c | 3+--
4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/doc/9vx.1 b/doc/9vx.1 @@ -101,7 +101,7 @@ Do not fork at init Do not start the gui .TP .BI -i -If there is no root, boot from +If there is no root or config file, boot from .I rootfs.bz2 and run rc(1), else set .I init=/386/init -tm diff --git a/src/9vx/conf.c b/src/9vx/conf.c @@ -200,7 +200,7 @@ printconfig(char *argv0){ if(ve[i].mac != nil) print(" -a %s", ve[i].mac); } - if(allowed) + if(allowed && strcmp(allowed, "/") != 0) print(" -z %s", allowed); if(localroot) print(" -r %s", localroot); diff --git a/src/9vx/devfs-posix.c b/src/9vx/devfs-posix.c @@ -33,7 +33,7 @@ enum FsChar = 'Z', }; -extern char *zallowed; +extern char *allowed; extern Path *addelem(Path*, char*, Chan*); static char *uidtoname(int); static char *gidtoname(int); @@ -356,8 +356,8 @@ fsopen(Chan *c, int mode) if(Trace) print("fsopen %s %#x\n", ufd->path->s, mode); - /* protect files whose path does not begin with zallowed */ - if(strncmp(ufd->path->s, zallowed, strlen(zallowed)) != 0) + /* protect files whose path does not begin with allowed */ + if(strncmp(ufd->path->s, allowed, strlen(allowed)) != 0) error(Eperm); if(mode & ~(OTRUNC|ORCLOSE|3)) diff --git a/src/9vx/main.c b/src/9vx/main.c @@ -89,7 +89,6 @@ main(int argc, char **argv) { int vetap; char *vedev; - char *inifile; /* Minimal set up to make print work. */ #ifndef TLS @@ -533,7 +532,7 @@ init0(void) inifields(&inienv); if(initrc != 0){ - if(localroot == nil && bootargc == 0){ + if(localroot == nil && inifile == nil && bootargc == 0){ ksetenv("nobootprompt", defaultroot, 0); ksetenv("initcmd", defaultinit, 0); ksetenv("init", "/386/bin/rc -c 'eval $initcmd", 0);