From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200501261553.j0QFr9w28322@zamenhof.cs.utwente.nl> To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> From: Axel Belinfante Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 26 Jan 2005 16:53:09 +0100 Subject: [9fans] tftpd vs assumptions about user none? (to have or have not home dir) Topicbox-Message-UUID: 36428abc-eace-11e9-9e20-41e7f4b1d025 I noticed that because I had a /usr/none directory (*) tftpd would try to serve relative file name requests from /usr/none instead of from /lib/tftpd. the reason is that tftpd first does a chdir and only later (via setuser() a newns("none", nil) which in my case unfortuantely succeeded to cd to /usr/none (because that directory existed, see below (*) until I removed it recently) so, a) what are the assumptions about none ? should not have home dir, I guess, other places where that matters? other issues? b) would it make sense to make tftpd a bit more robust in this respect? It's probably worth noting, though, that I saw that in a recent tftpd.c the setuser() call was moved even `later' in the tftpd code, such that each session (via doserve()) gets its own clean namespace) from which I gather that moving setuser() _up_ in the code till before (earlier than) the chdir call is likely a bad idea... Comments welcome, just trying to learn, Axel. (*) I added it myself (summer 2003 - history rocks :-) and I don't remember why :-(