unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew C <me@drewc.ca>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH] environment: container: Do not remount network files as read-only.
Date: Sat, 26 Mar 2016 11:54:24 -0700	[thread overview]
Message-ID: <CAPySywZ=NDPnf8Zd7TZC+vPsTM3AC4VMGWvxnmCqKqwXhhP=EA@mail.gmail.com> (raw)
In-Reply-To: <87r3exyt97.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2642 bytes --]

On Sat, Mar 26, 2016 at 11:43 AM, Ludovic Courtès <ludo@gnu.org> wrote:

> "Thompson, David" <dthompson2@worcester.edu> skribis:
>
> > On Fri, Mar 18, 2016 at 4:51 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> >> "Thompson, David" <dthompson2@worcester.edu> skribis:
> >>
> >>> I noticed that 'guix environment --container --network' didn't work on
> >>> an Ubuntu machine I was on, and the culprit was remounting things like
> >>> /etc/resolv.conf read-only after the initial bind mount.
> >>
> >> [...]
> >>
> >>>                                              (file-system-mapping
> >>>                                               (source file)
> >>>                                               (target file)
> >>> -                                             (writable? #f))))
> >>> +                                             ;; An unpriviliged user
> might not
> >>> +                                             ;; be able to remount
> >>> +                                             ;; /etc/resolv.conf as
> read-only,
> >>> +                                             ;; so we say that it is
> writable
> >>> +                                             ;; here, even though in
> practice
> >>> +                                             ;; it is not.
> >>> +                                             (writable? #t))))
> >>>                                       %network-configuration-files)
> >>
> >> Not sure I understand: why would bind-mounting /etc/resolv.conf
> >> read-only fail?
> >
> > I haven't figured out the exact reason yet, but here's a strace
> > snippet as proof:
> >
> > [pid 11334] mount("/etc/resolv.conf",
> > "/tmp/guix-directory.Rc4nc6//etc/resolv.conf", 0x23da000,
> > MS_RDONLY|MS_BIND, NULL) = 0
> > [pid 11334] mount("/etc/resolv.conf",
> > "/tmp/guix-directory.Rc4nc6//etc/resolv.conf", 0x23e4080,
> > MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = -1 EPERM (Operation not
> > permitted)
> >
> > Another Ubuntu user was able to reproduce this as well.
>
> Looking at the resolvconf man page that Drew mentioned, it seems that
> /etc/resolv.conf is a symlink when resolvconf is in used, right?
>

Correct :

$ ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 29 Oct  2 08:36 /etc/resolv.conf ->
../run/resolvconf/resolv.conf



>
> If yes, does this make a difference:
>
>
>
> It may be that the result after this is that you get /etc/resolv.conf in
> the container, but it’s a dangling symlink.  But isn’t it the case
> already with the patch you propose?
>
> Thanks for finding all these curiosities.  :-)
>
> Ludo’.
>
>

[-- Attachment #2: Type: text/html, Size: 4111 bytes --]

  reply	other threads:[~2016-03-26 18:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17 18:32 [PATCH] environment: container: Do not remount network files as read-only Thompson, David
2016-03-18 20:51 ` Ludovic Courtès
2016-03-26 14:06   ` Thompson, David
2016-03-26 16:29     ` Drew C
2016-03-26 16:49       ` Thompson, David
2016-03-26 16:59         ` Drew C
2016-03-26 18:43     ` Ludovic Courtès
2016-03-26 18:54       ` Drew C [this message]
2016-03-26 19:23       ` Thompson, David
2016-03-27 17:43         ` Ludovic Courtès
2016-03-28  0:32           ` Thompson, David

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to='CAPySywZ=NDPnf8Zd7TZC+vPsTM3AC4VMGWvxnmCqKqwXhhP=EA@mail.gmail.com' \
    --to=me@drewc.ca \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).