* [PATCH] Make sure /dev/pts/ptmx is world-writable
@ 2014-04-02 21:41 Ludovic Courtès
2014-04-03 6:53 ` Lluís Batlle i Rossell
0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2014-04-02 21:41 UTC (permalink / raw)
To: nix-dev; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 469 bytes --]
Hello,
While running Python 3’s test suite, we noticed that on some systems
/dev/pts/ptmx is created with permissions 0 (that’s the case with my
Nixpkgs-originating 3.0.43 kernel, but someone with a Debian-originating
3.10-3 reported not having this problem.)
There’s still the problem that people without
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y are screwed (as noted in build.cc),
but I don’t see how we could work around it.
Thoughts?
Ludo’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 707 bytes --]
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index e846995..53a92c1 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2079,6 +2079,10 @@ void DerivationGoal::initChild()
if (mount("none", (chrootRootDir + "/dev/pts").c_str(), "devpts", 0, "newinstance,mode=0620") == -1)
throw SysError("mounting /dev/pts");
createSymlink("/dev/pts/ptmx", chrootRootDir + "/dev/ptmx");
+
+ /* Make sure /dev/pts/ptmx is world-writable. With some
+ Linux versions, it is created with permissions 0. */
+ chmod_(chrootRootDir + "/dev/pts/ptmx", 0666);
}
/* Do the chroot(). Below we do a chdir() to the
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Make sure /dev/pts/ptmx is world-writable
2014-04-02 21:41 [PATCH] Make sure /dev/pts/ptmx is world-writable Ludovic Courtès
@ 2014-04-03 6:53 ` Lluís Batlle i Rossell
2014-04-03 7:28 ` Ludovic Courtès
2014-04-03 7:31 ` Ludovic Courtès
0 siblings, 2 replies; 5+ messages in thread
From: Lluís Batlle i Rossell @ 2014-04-03 6:53 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel, nix-dev
On Wed, Apr 02, 2014 at 11:41:11PM +0200, Ludovic Courtès wrote:
> Hello,
>
> While running Python 3’s test suite, we noticed that on some systems
> /dev/pts/ptmx is created with permissions 0 (that’s the case with my
> Nixpkgs-originating 3.0.43 kernel, but someone with a Debian-originating
> 3.10-3 reported not having this problem.)
>
> There’s still the problem that people without
> CONFIG_DEVPTS_MULTIPLE_INSTANCES=y are screwed (as noted in build.cc),
> but I don’t see how we could work around it.
>
> Thoughts?
>
> Ludo’.
Usually it's handled with the devpts special mountable device. The
"ptmxmode" variable handles that. Don't you want to mount that in the
chroot?
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Make sure /dev/pts/ptmx is world-writable
2014-04-03 6:53 ` Lluís Batlle i Rossell
@ 2014-04-03 7:28 ` Ludovic Courtès
2014-04-03 7:31 ` Ludovic Courtès
1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2014-04-03 7:28 UTC (permalink / raw)
To: Lluís Batlle i Rossell; +Cc: guix-devel, nix-dev
Hello!
Lluís Batlle i Rossell <viric@viric.name> skribis:
> On Wed, Apr 02, 2014 at 11:41:11PM +0200, Ludovic Courtès wrote:
>> Hello,
>>
>> While running Python 3’s test suite, we noticed that on some systems
>> /dev/pts/ptmx is created with permissions 0 (that’s the case with my
>> Nixpkgs-originating 3.0.43 kernel, but someone with a Debian-originating
>> 3.10-3 reported not having this problem.)
Actually the doc confirms that:
https://www.kernel.org/doc/Documentation/filesystems/devpts.txt
>> There’s still the problem that people without
>> CONFIG_DEVPTS_MULTIPLE_INSTANCES=y are screwed (as noted in build.cc),
>> but I don’t see how we could work around it.
>>
>> Thoughts?
>>
>> Ludo’.
>
> Usually it's handled with the devpts special mountable device. The
> "ptmxmode" variable handles that. Don't you want to mount that in the
> chroot?
We do want to mount /dev/pts, yes. What’s the ‘ptmxmode variable’?
Ludo’.
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Make sure /dev/pts/ptmx is world-writable
2014-04-03 6:53 ` Lluís Batlle i Rossell
2014-04-03 7:28 ` Ludovic Courtès
@ 2014-04-03 7:31 ` Ludovic Courtès
2014-04-03 10:38 ` Lluís Batlle i Rossell
1 sibling, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2014-04-03 7:31 UTC (permalink / raw)
To: Lluís Batlle i Rossell; +Cc: guix-devel, nix-dev
Lluís Batlle i Rossell <viric@viric.name> skribis:
> Usually it's handled with the devpts special mountable device. The
> "ptmxmode" variable handles that. Don't you want to mount that in the
> chroot?
Ah sorry, I see the ptmxmode mount option:
https://www.kernel.org/doc/Documentation/filesystems/devpts.txt
Well it seems both chmod and that mount option would work, but the
ptmxmode option is marked as “new” in the doc above, so maybe it’s safer
to use chmod?
Ludo’.
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Make sure /dev/pts/ptmx is world-writable
2014-04-03 7:31 ` Ludovic Courtès
@ 2014-04-03 10:38 ` Lluís Batlle i Rossell
0 siblings, 0 replies; 5+ messages in thread
From: Lluís Batlle i Rossell @ 2014-04-03 10:38 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel, nix-dev
On Thu, Apr 03, 2014 at 09:31:11AM +0200, Ludovic Courtès wrote:
> Lluís Batlle i Rossell <viric@viric.name> skribis:
>
> > Usually it's handled with the devpts special mountable device. The
> > "ptmxmode" variable handles that. Don't you want to mount that in the
> > chroot?
>
> Ah sorry, I see the ptmxmode mount option:
>
> https://www.kernel.org/doc/Documentation/filesystems/devpts.txt
>
> Well it seems both chmod and that mount option would work, but the
> ptmxmode option is marked as “new” in the doc above, so maybe it’s safer
> to use chmod?
I think that ptmxmode is there since 2.6 kernels, at least. :)
There is a reason for having the devpts fs instead of static nodes, but I don't remember it.
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-04-03 10:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-02 21:41 [PATCH] Make sure /dev/pts/ptmx is world-writable Ludovic Courtès
2014-04-03 6:53 ` Lluís Batlle i Rossell
2014-04-03 7:28 ` Ludovic Courtès
2014-04-03 7:31 ` Ludovic Courtès
2014-04-03 10:38 ` Lluís Batlle i Rossell
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.