9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Ethan Grammatikidis <eekee57@fastmail.fm>
To: 9front@9front.org
Subject: Surprise insertion of bind into namespace (anecdote)
Date: Fri, 13 Sep 2013 12:01:49 +0100	[thread overview]
Message-ID: <1379070109.6031.21505573.042A6EE4@webmail.messagingengine.com> (raw)

Just noting a surprise I had with namespaces. I fixed my usage, but
thought it so surprising it ought to be shown for other namespace newbs
to see.

I wanted to bind /n/other/usr/ethan on /usr/ethan so that all dirs and
files in the former appeared in the latter; not just tmp. To do this I
simply changed the bind in $home/lib/profile, removing the "/tmp" from
both args as shown in line 4 below. 

lib/profile:
1       bind -b $home/bin/rc /bin
2       bind -b $home/bin/$cputype /bin
3       mount -qC /srv/boot /n/other other
4       bind -qa /n/other/usr/$user $home
5       bind -c $home/tmp /tmp
ns output:
1       bind -b /usr/ethan/bin/rc /bin 
2       bind -b /usr/ethan/bin/386 /bin 
3       mount -C '#s/boot' /n/other other
	bind  /usr/ethan /usr/ethan                             ←
	unrequested; breaks my namespace
4       bind -a /n/other/usr/ethan /usr/ethan 
5       bind -c /n/other/usr/ethan/tmp /tmp 

I got my dirs from /n/other, I could read and write existing files as
normal, but I could no longer create files in $home! I assumed binding
with -a would leave the original dir unaffected, but this was false.
That extra line in ns output, "bind /usr/ethan /usr/ethan", shows the
system doesn't follow this assumption; as soon as I made /usr/ethan a
mount point it implicitly lost create permissions. The fix was simple:
add "bind -bc $home $home" before line 4. Ns still shows the unrequested
bind, it appears before the "bind -bc", but apparently the -c in "bind
-bc" overrides it.

In brief: binding over a dir which is not already a mountpoint
implicitly removes create permission from that dir. Add a "bind -c $dir
$dir" to restore create permission.


             reply	other threads:[~2013-09-13 11:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-13 11:01 Ethan Grammatikidis [this message]
2013-09-13 19:13 ` [9front] " Ethan Grammatikidis
2013-09-13 19:17   ` Ethan Grammatikidis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379070109.6031.21505573.042A6EE4@webmail.messagingengine.com \
    --to=eekee57@fastmail.fm \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).