Re: [9fans] 9vx patch to read environment var PLAN9
> >> > What? The findroot code reads: > >> > >> read the code again; findroot doesn't come into play. > > > > it most certainly does! > > the whole point was that given -r, findroot doesn't come into play. > > if NINEROOT is not set, what does your version of 9vx do (without -r)? In short it fails with the error "cannot find plan 9 root; use -r" Here is the specific sequence: If the 9vx invocation is in the root directory use `cwd` -> here is where I checked for NINEROOT try "/Users/rsc/9vx" try "/home/rsc/plan9/4e" fail with error "cannot find plan 9 root; use -r" EBo --
Re: [9fans] 9vx patch to read environment var PLAN9
>> > What? The findroot code reads: >> >> read the code again; findroot doesn't come into play. > > it most certainly does! the whole point was that given -r, findroot doesn't come into play. if NINEROOT is not set, what does your version of 9vx do (without -r)?
Re: [9fans] 9vx patch to read environment var PLAN9
Skip Tavakkolian <9...@9netics.com> said: > > What? The findroot code reads: > > read the code again; findroot doesn't come into play. it most certainly does! in main... if(!bootboot){ if(localroot == nil && (localroot = findroot()) == nil) panic("cannot find plan 9 root; use -r"); So, if you do not specify localroot (via -r) then it uses findroot. Findroot first checks the cwd, and then two hardcoded paths. This means that unless the program is run from the 9vx's associated Plan 9 root, or the programs were installed in "/Users/rsc/9vx" or "/home/rsc/plan9/4e", then you are requiring all users on a system to run 9vx with -r and know where that root is always. Is it unreasonable to expect that an invocation of "9vx" to actually run? EBo --
Re: [9fans] 9vx patch to read environment var PLAN9
> What? The findroot code reads: read the code again; findroot doesn't come into play.
Re: [9fans] 9vx patch to read environment var PLAN9
Skip Tavakkolian <9...@9netics.com> said: > > but both > > of the hard-coded paths in 9vx main.c are obviously in RSC's home > > directories > > it's not hardcoded; What? The findroot code reads: static char* findroot(void) { static char cwd[1024]; int i; char buf[1024]; char *dir[] = { cwd, "/Users/rsc/9vx", "/home/rsc/plan9/4e" }; if(getcwd(cwd, sizeof cwd) == nil){ oserrstr(); panic("getcwd: %r"); } for(i=0; i= 0) return dir[i]; } return nil; } "/Users/rsc/9vx","/home/rsc/plan9/4e" are most certainly hard coded locations, and will likely only be default on rsc's machines. > you can use -r as Russ said. the difference is: > "use default unless -r is given" vs. "use default unless > getenv(NINEROOT) is given". -r makes it very obvious what the root is > and probably will work better for un-unix-like environments. Put another way, what are the default locations? Also, it would probably be "use default unless getenv(NINEROOT) or -r is given". Also, getenv works on Windoz. What un-unix-like environments are you referring to? > but at any rate, you have the sources and are free to change things > locally to suit your taste. true, but will these patches be accepted upstream? If I was looking to just build this for myself I would not be bothering any of you, I'm trying to figure out what would be useful to include upstream. I guess I should not have posted this to the list, but simply taken it up with Russ off-list since it is his code. EBo --
Re: [9fans] 9vx patch to read environment var PLAN9
> but both > of the hard-coded paths in 9vx main.c are obviously in RSC's home directories it's not hardcoded; you can use -r as Russ said. the difference is: "use default unless -r is given" vs. "use default unless getenv(NINEROOT) is given". -r makes it very obvious what the root is and probably will work better for un-unix-like environments. but at any rate, you have the sources and are free to change things locally to suit your taste.
Re: [9fans] /sys/lib/newuser patch
EBo said: > > > > Hunting on the we it looks like Ron Cox is the goto person for that > > > (http://bitbucket.org/rsc/vx32/changesets/ dated 2009-12-27): > > > > Ah, my bad. I was looking at the old, pre-bitbucket repository (in my > > defense, still linked from swtch.com/9vx). I take it back. > > hmmm... the sources I am building 9vx from are: > > http://hg.pdos.csail.mit.edu/hg/vx32/http://code.swtch.com/9vx. > > Should I be building them from http://bitbucket.org/rsc/vx32? yep. Just verified it. The bitbucket sources are a superset and seem to be moved sometime after 2009/10/05. Thanks Anthony for bringing that to my attention! EBo --
Re: [9fans] /sys/lib/newuser patch
> > Hunting on the we it looks like Ron Cox is the goto person for that > > (http://bitbucket.org/rsc/vx32/changesets/ dated 2009-12-27): > > Ah, my bad. I was looking at the old, pre-bitbucket repository (in my > defense, still linked from swtch.com/9vx). I take it back. hmmm... the sources I am building 9vx from are: http://hg.pdos.csail.mit.edu/hg/vx32/http://code.swtch.com/9vx. Should I be building them from http://bitbucket.org/rsc/vx32? EBo --
Re: [9fans] /sys/lib/newuser patch
On Apr 12, 2010, at 22:53, EBo wrote: On Apr 12, 2010, at 11:23, hiro wrote: and what is src/9vx/a/devcap.c ? As far as my system and (as far as I can tell) the Mercurial repository: fictional. Something you'd like to share with the class? Hunting on the we it looks like Ron Cox is the goto person for that (http://bitbucket.org/rsc/vx32/changesets/ dated 2009-12-27): Ah, my bad. I was looking at the old, pre-bitbucket repository (in my defense, still linked from swtch.com/9vx). I take it back. PGP.sig Description: This is a digitally signed message part
Re: [9fans] /sys/lib/newuser patch
> On Apr 12, 2010, at 11:23, hiro wrote: > > > and what is src/9vx/a/devcap.c ? > > As far as my system and (as far as I can tell) the > Mercurial repository: fictional. Something you'd > like to share with the class? Hunting on the we it looks like Ron Cox is the goto person for that (http://bitbucket.org/rsc/vx32/changesets/ dated 2009-12-27): "To make it possible to log into 9vx using drawterm a device #¤ (devcap) is needed, otherwise auth_chuid() will fail, because it cannot open #¤/capuse." "This patch adds `9/port/devcap.c' from Plan 9 to 9vx/a, with only a few adaptions (see a/devcap.ed)." So if I am reading this correctly, it is in a vx32 repository but not in the 9vx one. I could be totally off base with that one, but thought the info might be useful for tracking down. EBo --
Re: [9fans] /sys/lib/newuser patch
On Apr 12, 2010, at 11:23, hiro wrote: and what is src/9vx/a/devcap.c ? As far as my system and (as far as I can tell) the Mercurial repository: fictional. Something you'd like to share with the class? PGP.sig Description: This is a digitally signed message part
Re: [9fans] /sys/lib/newuser patch
> > the problem you're addressing can't be addressed well through #Z. > > unix systems act differently than plan 9 ones do. there are a host > > of locking, etc. questions that #Z doesn't handle either. it would be > > easier > > to use a plan 9 fs (ken fs, cwfs, fossil). then you wouldn't need to > > deal with unix authentication. > > Probably true. However, I'm confident that there are ways to address > it -- and still, one of the cool things about 9vx is the local FS > access. When I was doing my 9vx autoprovisioner, the instances would > start in a chrooted sandbox, which was the best way I could figure to > deal with the permissioning issues at that point in time (without lots > o hacking). that is cool. but i think it's a mistake to get carried away. #Z just isn't a regular plan 9 file system. locks don't work. users and groups work differently. (and of course, 9vx is run by exactly 1 unix user so i don't see how pam helps.) authentication works differently, there's no append-only mode, etc. - erik
Re: [9fans] /sys/lib/newuser patch
and what is src/9vx/a/devcap.c ? On 4/12/10, erik quanstrom wrote: >> 2010/4/12 hiro <23h...@googlemail.com>: >> > I have not the slightest idea about the complexity involved; And I >> > think I misunderstand how much of plan9 is actually running in a >> > sandbox. But what if we wanted to have a working security system for >> > multiple users in 9vx. Would it be - or is it - possible? >> >> Yes, it is possible, but it probably requires writing something to use >> PAM (or whatever authentication mechanism is set up) on the host >> system. I have a few ideas for this. > > iirc, 9vx doesn't have devcap. > > the problem you're addressing can't be addressed well through #Z. > unix systems act differently than plan 9 ones do. there are a host > of locking, etc. questions that #Z doesn't handle either. it would be > easier > to use a plan 9 fs (ken fs, cwfs, fossil). then you wouldn't need to > deal with unix authentication. > > - erik > >
Re: [9fans] /sys/lib/newuser patch
And the users are running in single sandboxes? On 4/12/10, erik quanstrom wrote: >> 2010/4/12 hiro <23h...@googlemail.com>: >> > I have not the slightest idea about the complexity involved; And I >> > think I misunderstand how much of plan9 is actually running in a >> > sandbox. But what if we wanted to have a working security system for >> > multiple users in 9vx. Would it be - or is it - possible? >> >> Yes, it is possible, but it probably requires writing something to use >> PAM (or whatever authentication mechanism is set up) on the host >> system. I have a few ideas for this. > > iirc, 9vx doesn't have devcap. > > the problem you're addressing can't be addressed well through #Z. > unix systems act differently than plan 9 ones do. there are a host > of locking, etc. questions that #Z doesn't handle either. it would be > easier > to use a plan 9 fs (ken fs, cwfs, fossil). then you wouldn't need to > deal with unix authentication. > > - erik > >
Re: [9fans] /sys/lib/newuser patch
2010/4/12 erik quanstrom : >> 2010/4/12 hiro <23h...@googlemail.com>: >> > I have not the slightest idea about the complexity involved; And I >> > think I misunderstand how much of plan9 is actually running in a >> > sandbox. But what if we wanted to have a working security system for >> > multiple users in 9vx. Would it be - or is it - possible? >> >> Yes, it is possible, but it probably requires writing something to use >> PAM (or whatever authentication mechanism is set up) on the host >> system. I have a few ideas for this. > > iirc, 9vx doesn't have devcap. It does not. (Yet). > the problem you're addressing can't be addressed well through #Z. > unix systems act differently than plan 9 ones do. there are a host > of locking, etc. questions that #Z doesn't handle either. it would be easier > to use a plan 9 fs (ken fs, cwfs, fossil). then you wouldn't need to > deal with unix authentication. Probably true. However, I'm confident that there are ways to address it -- and still, one of the cool things about 9vx is the local FS access. When I was doing my 9vx autoprovisioner, the instances would start in a chrooted sandbox, which was the best way I could figure to deal with the permissioning issues at that point in time (without lots o hacking). --dho > - erik > >
Re: [9fans] revision control system or SCM of Plan 9 sources
Yes, I saw this link before, but I mean some current sources, what happens with Plan9 just right now. Thanks. On 12 апр, 16:54, gd...@rejaa.com (Gabriel Díaz) wrote: > Hello > > http://swtch.com/plan9history/ > > may be is sometthing on the lines you're looking for. > > slds. > > gabi
Re: [9fans] /sys/lib/newuser patch
> 2010/4/12 hiro <23h...@googlemail.com>: > > I have not the slightest idea about the complexity involved; And I > > think I misunderstand how much of plan9 is actually running in a > > sandbox. But what if we wanted to have a working security system for > > multiple users in 9vx. Would it be - or is it - possible? > > Yes, it is possible, but it probably requires writing something to use > PAM (or whatever authentication mechanism is set up) on the host > system. I have a few ideas for this. iirc, 9vx doesn't have devcap. the problem you're addressing can't be addressed well through #Z. unix systems act differently than plan 9 ones do. there are a host of locking, etc. questions that #Z doesn't handle either. it would be easier to use a plan 9 fs (ken fs, cwfs, fossil). then you wouldn't need to deal with unix authentication. - erik
Re: [9fans] /sys/lib/newuser patch
2010/4/12 hiro <23h...@googlemail.com>: > I have not the slightest idea about the complexity involved; And I > think I misunderstand how much of plan9 is actually running in a > sandbox. But what if we wanted to have a working security system for > multiple users in 9vx. Would it be - or is it - possible? Yes, it is possible, but it probably requires writing something to use PAM (or whatever authentication mechanism is set up) on the host system. I have a few ideas for this. --dho > On 4/12/10, erik quanstrom wrote: >>> Can't we then fix 9vx? >>> (Stepping in to the tradition of concern of reception: This is not a >>> rhetoric question) >> >> it's not 9vx, but #Z. and no, #Z is going to be limited by >> the underlying system. >> >> - erik >> >> > >
Re: [9fans] revision control system or SCM of Plan 9 sources
On Mon, Apr 12, 2010 at 09:30:11AM +, Boo wrote: > Hi folks, > Is there any revision control system or SCM of Plan 9 sources? I would > like to read changesets, but don't know where I can find them. > Thanks. There's a mirror of the daily fossil snapshots from 2002/1212 to some time last year, at http://code.google.com/p/plan9sys/ . It will, eventually, be brought up to date and stay current via a cron job. --nwf; pgpcUB6D3m0mF.pgp Description: PGP signature
Re: [9fans] /sys/lib/newuser patch
I have not the slightest idea about the complexity involved; And I think I misunderstand how much of plan9 is actually running in a sandbox. But what if we wanted to have a working security system for multiple users in 9vx. Would it be - or is it - possible? On 4/12/10, erik quanstrom wrote: >> Can't we then fix 9vx? >> (Stepping in to the tradition of concern of reception: This is not a >> rhetoric question) > > it's not 9vx, but #Z. and no, #Z is going to be limited by > the underlying system. > > - erik > >
Re: [9fans] revision control system or SCM of Plan 9 sources
Hello http://swtch.com/plan9history/ may be is sometthing on the lines you're looking for. slds. gabi - Original Message From: Boo To: 9fans@9fans.net Sent: Mon, April 12, 2010 11:30:11 AM Subject: [9fans] revision control system or SCM of Plan 9 sources Hi folks, Is there any revision control system or SCM of Plan 9 sources? I would like to read changesets, but don't know where I can find them. Thanks.
Re: [9fans] /sys/lib/newuser patch
> you must also exit if ~ $user none. i'd also recommend > aborting if ~ $home /. you don't want none making > files in /. on a regular plan 9 system, that's no worry, but > 9vx, ... I also tried to add test -z $user for the null string. It turns out that user=`{cat /dev/user} dies with the error "rc (newuser): null list in concatenation". Is this an appropriate failure mode, or is there some workaround to do a null username? or is this getting to complicated? EBo --
Re: [9fans] /sys/lib/newuser patch
> Can't we then fix 9vx? > (Stepping in to the tradition of concern of reception: This is not a > rhetoric question) it's not 9vx, but #Z. and no, #Z is going to be limited by the underlying system. - erik
Re: [9fans] /sys/lib/newuser patch
On 4/12/10, erik quanstrom wrote: >> Following on several peoples advice and a suggested code snippet from Erik >> I've added the following before the check for profile: >> >> if(! test -d $home){ >> echo no home directory $home >> exit homeless >> } >> if(! ls -ld $home >[2=] | grep -s '^d-rwx.* '$user){ >> echo bad permissions >> exit homeless >> } > > you must also exit if ~ $user none. i'd also recommend > aborting if ~ $home /. you don't want none making > files in /. on a regular plan 9 system, that's no worry, but > 9vx, ... > > - erik > > Can't we then fix 9vx? (Stepping in to the tradition of concern of reception: This is not a rhetoric question)
Re: [9fans] /sys/lib/newuser patch
erik quanstrom said: > > Following on several peoples advice and a suggested code snippet from Erik > > I've added the following before the check for profile: > > > > if(! test -d $home){ > > echo no home directory $home > > exit homeless > > } > > if(! ls -ld $home >[2=] | grep -s '^d-rwx.* '$user){ > > echo bad permissions > > exit homeless > > } > > you must also exit if ~ $user none. i'd also recommend > aborting if ~ $home /. you don't want none making > files in /. on a regular plan 9 system, that's no worry, but > 9vx, ... The reason I did not include ~ $home / is that the first two lines of code in newuser are: user=`{cat /dev/user} home=/usr/$user so home can never be just / (unless I am missing something here), but the ~ $user none is a very good point. Thanks! EBo --
Re: [9fans] 9vx patch to read environment var PLAN9
> That is what I did for the first prototype. I thought this would be a beeter > solution. > > Out of curiosity, have I hit a nerve or something. Have I somehow offended? > I'm just a bit confused by some of the responses. no. i don't think anyone's offended. and i personally think the env variable is fine. but i can see the objection to complication. if i were you, the question i'd why have a list of hardcoded roots at all? none are even in the user's home directory. - erik
Re: [9fans] /sys/lib/newuser patch
> Following on several peoples advice and a suggested code snippet from Erik > I've added the following before the check for profile: > > if(! test -d $home){ > echo no home directory $home > exit homeless > } > if(! ls -ld $home >[2=] | grep -s '^d-rwx.* '$user){ > echo bad permissions > exit homeless > } you must also exit if ~ $user none. i'd also recommend aborting if ~ $home /. you don't want none making files in /. on a regular plan 9 system, that's no worry, but 9vx, ... - erik
Re: [9fans] revision control system or SCM of Plan 9 sources
On Mon Apr 12 05:32:39 EDT 2010, boo...@gmail.com wrote: > Hi folks, > Is there any revision control system or SCM of Plan 9 sources? I would > like to read changesets, but don't know where I can find them. > Thanks. not really. if you want to read revision history, you can use history(1) on sources. unfortunately this requires a sources account. - erik
Re: [9fans] 9vx patch to read environment var PLAN9
Francisco J Ballesteros said: > you could also use a script to call 9vx as you please. That is what I did for the first prototype. I thought this would be a beeter solution. Out of curiosity, have I hit a nerve or something. Have I somehow offended? I'm just a bit confused by some of the responses. I could easily understand the reluctance if there are some standardization issues with getenv on the targeted platforms I do not know about. I could also understand if I was proposing to put it in some weird location, but both of the hard-coded paths in 9vx main.c are obviously in RSC's home directories and not more generic locations like /home/9vx, $home/9vx, /usr/local/9vx, /opt... EBo -- > On Mon, Apr 12, 2010 at 5:22 AM, EBo wrote: > > > >> Why isn't 9vx -r yourdir good enough? > > > > it is if you want to force all users to specify the root directory every > > single time they run 9vx, or if you want to use an alternative root. Â If I use > > a standard install locations then we can either change "/Users/rsc/9vx" and > > "/home/rsc/plan9/4e" or I can simply run a sed script during the build > > phase. > > Â Setting up a $root9vx (what I have changed it to) seemed the cleanest approach. > > > > Â EBo --
Re: [9fans] 9vx patch to read environment var PLAN9
you could also use a script to call 9vx as you please. On Mon, Apr 12, 2010 at 5:22 AM, EBo wrote: > >> Why isn't 9vx -r yourdir good enough? > > it is if you want to force all users to specify the root directory every > single time they run 9vx, or if you want to use an alternative root. If I use > a standard install locations then we can either change "/Users/rsc/9vx" and > "/home/rsc/plan9/4e" or I can simply run a sed script during the build phase. > Setting up a $root9vx (what I have changed it to) seemed the cleanest > approach. > > EBo -- > > > >
Re: [9fans] using usb
does your name space mount /srv/usb ? I mean, does it mount the files served from usbd? I'll take a look to usbfat in any case. On Mon, Apr 12, 2010 at 11:30 AM, antonio@gmail.com wrote: > I reinstalled with a new iso before to read your mail. > With the new installation I can mount one old pendrive (128mb) with > the new ones I got this: > mount: mount /n/sdU2.0: unknown format > and in the screen like a kernel message: usb/disk... disk: reset: > device is detached > (My computer is an old thinkpad 600e and this could be the problem) > > When I plug the old one, is detected but there is no lights, and > nothing happen when I try to mount it. Then I tried with usb/disk /dev/ > sdU* that EBo said, the pendrive light starts, now I can mount an > unmount without problems. > Doing the same with the new ones I got the same message: unknown > format. > > Antonio > > On Apr 1, 1:28Â pm, n...@lsub.org (Francisco J Ballesteros) wrote: >> If you can >> >> ls '#U' >> >> then you are running an old kernel. >> >> If you can't, then you have to include the usb device in your kernel. >> >> Either way, it seems your kernel does not have '#u'. >> >> On Thu, Apr 1, 2010 at 12:13 PM, antonio@gmail.com > >
Re: [9fans] using usb
I reinstalled with a new iso before to read your mail. With the new installation I can mount one old pendrive (128mb) with the new ones I got this: mount: mount /n/sdU2.0: unknown format and in the screen like a kernel message: usb/disk... disk: reset: device is detached (My computer is an old thinkpad 600e and this could be the problem) When I plug the old one, is detected but there is no lights, and nothing happen when I try to mount it. Then I tried with usb/disk /dev/ sdU* that EBo said, the pendrive light starts, now I can mount an unmount without problems. Doing the same with the new ones I got the same message: unknown format. Antonio On Apr 1, 1:28Â pm, n...@lsub.org (Francisco J Ballesteros) wrote: > If you can > > ls '#U' > > then you are running an old kernel. > > If you can't, then you have to include the usb device in your kernel. > > Either way, it seems your kernel does not have '#u'. > > On Thu, Apr 1, 2010 at 12:13 PM, antonio@gmail.com
[9fans] revision control system or SCM of Plan 9 sources
Hi folks, Is there any revision control system or SCM of Plan 9 sources? I would like to read changesets, but don't know where I can find them. Thanks.