[web:add translator pages 05/15] add translator/fakeroot page

2024-10-16 Thread jbra...@dismail.de
* hurd/translator.mdwn: add a link to fakeroot * hurd/translator/fakeroot.mdwn: I added a trivial example. --- hurd/translator.mdwn | 1 + hurd/translator/fakeroot.mdwn | 65 +++ 2 files changed, 66 insertions(+) create mode 100644 hurd/translator

Re: Lightly tested patch to make fakeroot obey O_NOFOLLOW

2017-06-20 Thread Justus Winter
Justus Winter writes: > I haven't had a chance to build packages with it yet, but it makes my > minimal test case happy. With this fix, dkpg builds without problems. I will commit the fix. Justus signature.asc Description: PGP signature

[PATCH hurd] trans/fakeroot: Obey O_NOFOLLOW.

2017-06-19 Thread Justus Winter
* trans/fakeroot.c (netfs_S_dir_lookup): Do not follow symlinks if the client used O_NOFOLLOW. --- trans/fakeroot.c | 60 +++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/trans/fakeroot.c b/trans/fakeroot.c index f3f5e43d6..df47

Lightly tested patch to make fakeroot obey O_NOFOLLOW

2017-06-19 Thread Justus Winter
I haven't had a chance to build packages with it yet, but it makes my minimal test case happy. Justus

Re: Hurd's fakeroot seems to break dpkg 1.18.24 testsuite

2017-06-05 Thread Justus Winter
Hi :) Guillem Jover writes: > I finally got the chance to take a look at the dpkg FTBFS on Hurd (after > recovering my VM! :), and it appears as if it was a fakeroot problem? It is a bug in our fakeroot, it breaks O_NOFOLLOW: teythoon@hurdbox ~ % cat onofollow.c #include #include #i

Re: fakeroot-hurd doesn't work with scripts

2016-03-07 Thread Justus Winter
Quoting Samuel Thibault (2016-03-07 20:49:01) > Justus Winter, on Mon 07 Mar 2016 20:30:37 +0100, wrote: > > teythoon@hurdbox ~ % for x in sh py pl; do cat test.$x ; fakeroot ./test.$x > > ; done > > I should have mentioned it: the issue is only for scripts coming from >

Re: fakeroot-hurd doesn't work with scripts

2016-03-07 Thread Samuel Thibault
Justus Winter, on Mon 07 Mar 2016 20:30:37 +0100, wrote: > teythoon@hurdbox ~ % for x in sh py pl; do cat test.$x ; fakeroot ./test.$x ; > done I should have mentioned it: the issue is only for scripts coming from PATH. When you specify the path, the interpreter will know how to open th

Re: fakeroot-hurd doesn't work with scripts

2016-03-07 Thread Justus Winter
Hi, Quoting Samuel Thibault (2016-03-04 18:39:21) > We have an issue between fakeroot and scripts (from the borgbackup build > log): > > > fakeroot dh_auto_test > > Can't open perl script "dh_auto_test": No such file or directory > > I guess that'

fakeroot-hurd doesn't work with scripts

2016-03-04 Thread Samuel Thibault
Hello, We have an issue between fakeroot and scripts (from the borgbackup build log): > fakeroot dh_auto_test > Can't open perl script "dh_auto_test": No such file or directory I guess that's due to the way fakeauth starts the program, I haven't looked further. Samuel

[bug #17134] fakeroot; ports

2016-02-14 Thread Samuel Thibault
Update of bug #17134 (project hurd): Status:None => Works For Me Open/Closed:Open => Closed Wiki-like text discussion box: => I seems to be working fine now indeed.

[bug #17134] fakeroot; ports

2016-02-14 Thread Justus Winter
Follow-up Comment #1, bug #17134 (project hurd): Samuel, can you still reproduce this? I observed id ports being created and destroyed like they should. The large number of ports after doing find / are likely all pager ports. ___ Reply to

[bug #11509] fakeroot is not reliable

2016-02-08 Thread Justus Winter
Update of bug #11509 (project hurd): Status: Confirmed => Fixed Open/Closed:Open => Closed Wiki-like text discussion box: => We worked on fakeroot quite a bit, and

Re: fakeroot-hurd bug or not?

2015-10-20 Thread Samuel Thibault
Samuel Thibault, le Thu 08 Oct 2015 22:13:09 +0200, a écrit : > Justus Winter, le Thu 08 Oct 2015 12:56:20 +0200, a écrit : > > Quoting Samuel Thibault (2015-09-23 19:08:15) > > > All that being said, we should probably not let the programs inside > > > fakeroo

Re: fakeroot-hurd bug or not?

2015-10-08 Thread Samuel Thibault
Justus Winter, le Thu 08 Oct 2015 12:56:20 +0200, a écrit : > Quoting Samuel Thibault (2015-09-23 19:08:15) > > All that being said, we should probably not let the programs inside > > fakeroot believe they can write to / > > I'm not so sure. In my mind, fakeroot should

Re: fakeroot-hurd bug or not?

2015-10-08 Thread Justus Winter
Hi, Quoting Samuel Thibault (2015-09-23 19:08:15) > All that being said, we should probably not let the programs inside > fakeroot believe they can write to / I'm not so sure. In my mind, fakeroot should fake as much as possible, and fail at the latest point possible. The test p

Re: fakeroot-hurd, fakeroot-tcp: small test to show failure

2015-10-08 Thread Samuel Thibault
Svante Signell, le Thu 08 Oct 2015 17:17:16 +0200, a écrit : > cp test dir > cp: unwritable ‘dir/test’ (mode 0444, r--r--r--); try anyway? y > cp: cannot create regular file ‘dir/test’: Permission denied > > fakeroot-tcp cp test dir > cp: cannot create regular file ‘dir/test’:

fakeroot-hurd, fakeroot-tcp: small test to show failure

2015-10-08 Thread Svante Signell
srs 0 Oct 8 17:06 test cp test dir cp: unwritable ‘dir/test’ (mode 0444, r--r--r--); try anyway? y cp: cannot create regular file ‘dir/test’: Permission denied fakeroot-tcp cp test dir cp: cannot create regular file ‘dir/test’: Permission denied fakeroot-hurd cp test dir cp: cannot create regular

Re: fakeroot-hurd bug or not?

2015-09-23 Thread Samuel Thibault
Svante Signell, le Wed 23 Sep 2015 23:24:16 +0200, a écrit : > You are a DD, please raise this question on debian-devel. I'm just > nobody :( One doesn't have to be a DD to raise an issue on debian-devel. People on debian-devel don't care who you are, but what topic you bring there. Of course, if

Re: fakeroot-hurd bug or not?

2015-09-23 Thread Svante Signell
On Wed, 2015-09-23 at 20:09 +0200, Samuel Thibault wrote: > Svante Signell, le Wed 23 Sep 2015 20:07:56 +0200, a écrit : > > Seems like dh does this by default now, see debian/rules. From the > > build log > > debian/rules build > > make: 'build' is up to da

Re: fakeroot-hurd bug or not?

2015-09-23 Thread Samuel Thibault
Svante Signell, le Wed 23 Sep 2015 20:07:56 +0200, a écrit : > Seems like dh does this by default now, see debian/rules. From the > build log > debian/rules build > make: 'build' is up to date. > fakeroot debian/rules binary > dh binary --with autoreconf > ... &

Re: fakeroot-hurd bug or not?

2015-09-23 Thread Svante Signell
On Wed, 2015-09-23 at 19:08 +0200, Samuel Thibault wrote: > Svante Signell, le Wed 23 Sep 2015 15:45:13 +0200, a écrit : > > This test fails with fakeroot-hurd on Hurd due to that /non > > -existant is > > writable for faked nodes according to: > > No. Check what ha

Re: fakeroot-hurd bug or not?

2015-09-23 Thread Samuel Thibault
Svante Signell, le Wed 23 Sep 2015 15:45:13 +0200, a écrit : > This test fails with fakeroot-hurd on Hurd due to that /non-existant is > writable for faked nodes according to: No. Check what happens in the testcase again. It fails due to / being announced as writable by fakeroot (s

fakeroot-hurd bug or not?

2015-09-23 Thread Svante Signell
Hi, The attached test program is extracted from one of p11-kit tests (the only failing test) in trust/test_token.c: test_not_writable (): token = p11_token_new (333, "/non-existant", "Label"); main(): p11_test (test_not_writable, "/token/not-writable"); This test fa

More fakeroot issues

2015-09-07 Thread Samuel Thibault
Hello, I have noticed a few more fakeroot issues probably worth looking at: https://buildd.debian.org/status/fetch.php?pkg=gcc-snapshot&arch=hurd-i386&ver=20150817-1&stamp=1439929709 Error: can't open /tmp/cc7P65hz.s for reading: Permission denied https://buildd.debian.org/sta

Re: RFC: [PATCH] Re: Test case for fakeroot-hurd failure with a socket

2015-05-13 Thread Samuel Thibault
Hello, I have eventually applied this version: Svante Signell, le Wed 13 May 2015 09:35:28 +0200, a écrit : > +error_t > +netfs_set_translator (struct iouser *cred, struct node *np, > + char *argz, size_t argzlen) > +{ > + return file_set_translator (netfs_node_netnode (np)->fi

Re: RFC: [PATCH] Re: Test case for fakeroot-hurd failure with a socket

2015-05-13 Thread Samuel Thibault
Svante Signell, le Wed 13 May 2015 10:31:42 +0200, a écrit : > On Wed, 2015-05-13 at 10:04 +0200, Samuel Thibault wrote: > > Samuel Thibault, le Wed 13 May 2015 09:57:27 +0200, a écrit : > > > > + return file_set_translator (netfs_node_netnode (np)->file, > > > > + FS_T

Re: RFC: [PATCH] Re: Test case for fakeroot-hurd failure with a socket

2015-05-13 Thread Svante Signell
On Wed, 2015-05-13 at 10:04 +0200, Samuel Thibault wrote: > Samuel Thibault, le Wed 13 May 2015 09:57:27 +0200, a écrit : > > > + return file_set_translator (netfs_node_netnode (np)->file, > > > + FS_TRANS_EXCL|FS_TRANS_SET, > > > + FS_TRANS_EXCL|FS_TRAN

Re: RFC: [PATCH] Re: Test case for fakeroot-hurd failure with a socket

2015-05-13 Thread Samuel Thibault
Samuel Thibault, le Wed 13 May 2015 09:57:27 +0200, a écrit : > > + return file_set_translator (netfs_node_netnode (np)->file, > > + FS_TRANS_EXCL|FS_TRANS_SET, > > + FS_TRANS_EXCL|FS_TRANS_SET, 0, > > + argz, argzlen, > > +

Re: RFC: [PATCH] Re: Test case for fakeroot-hurd failure with a socket

2015-05-13 Thread Samuel Thibault
Svante Signell, le Wed 13 May 2015 09:35:28 +0200, a écrit : > Q: Why does it work without fakeroot-hurd? You mean on a bare filesystem? They use libdiskfs, which implements diskfs_S_file_set_translator, which calls diskfs_set_translator, which is implemented by filesystems. And the filesyst

Re: RFC: [PATCH] Re: Test case for fakeroot-hurd failure with a socket

2015-05-13 Thread Svante Signell
lator does not handle the case when the passive translator is a socket. Q: Why does it work without fakeroot-hurd? Index: hurd-0.6/trans/fakeroot.c === --- hurd-0.6.orig/trans/fakeroot.c +++ hurd-0.6/trans/fakeroot.c @@ -450,6 +450,20

Re: RFC: [PATCH] Re: Test case for fakeroot-hurd failure with a socket

2015-05-12 Thread Samuel Thibault
s' netfs_S_file_set_translator which is called first, does checks, and calls file_set_translator, which you'd implement in fakeroot. As another example, see libnetfs' netfs_S_dir_rmdir which does checks, and calls netfs_attempt_rmdir, which in fakeroot.c just calls dir_rmdir on the un

RFC: [PATCH] Re: Test case for fakeroot-hurd failure with a socket

2015-05-12 Thread Svante Signell
in libnetfs/set-get-trans.c? > > The former. > > > Still confusing is which functions are called: The ones in libnetfs vs > > the ones in fakeroot? > > The ones in libnetfs, and they call stubs from fakeroot. Attached is a patch that solves the test case

Re: Test case for fakeroot-hurd failure with a socket

2015-05-07 Thread Samuel Thibault
alled: The ones in libnetfs vs > the ones in fakeroot? The ones in libnetfs, and they call stubs from fakeroot. Samuel

Re: Test case for fakeroot-hurd failure with a socket

2015-05-07 Thread Svante Signell
On Wed, 2015-05-06 at 23:30 +0200, Samuel Thibault wrote: > Hello, > > Svante Signell, le Mon 04 May 2015 14:14:16 +0200, a écrit : > > Attached is the test code where fakeroot-hurd fails. > > fakeroot-hurd ./test_sockets > > bind: Operation not supported > &

Re: Test case for fakeroot-hurd failure with a socket

2015-05-06 Thread Samuel Thibault
Hello, Svante Signell, le Mon 04 May 2015 14:14:16 +0200, a écrit : > Attached is the test code where fakeroot-hurd fails. > fakeroot-hurd ./test_sockets > bind: Operation not supported Mmm, I don't think we want to implement it in netfs_attempt_chmod as you are trying to do

Test case for fakeroot-hurd failure with a socket

2015-05-04 Thread Svante Signell
Hi, Attached is the test code where fakeroot-hurd fails. fakeroot-hurd ./test_sockets bind: Operation not supported Using fakeroot-tcp or no fakeroot succeeds: ./test_sockets Receiving via datagram socket plain (similar with fakeroot-tcp) = rpctrace ./test_sockets ... 67<--141(pid9

Re: Investigation of the failing build of gnat-4.9 using fakeroot-hurd

2015-02-03 Thread Justus Winter
Hello :) Quoting Svante Signell (2015-02-02 12:26:06) > Confusing thing is: Printouts in > libnetfs/dir-lookup.c:netfs_S_dir_lookup() are not triggered, but > libdiskfs/dir-lookup.c:diskfs_S_dir_lookup are. > libnetfs is built into fakeroot itself, but not libdiskfs, which is

Re: Investigation of the failing build of gnat-4.9 using fakeroot-hurd

2015-02-02 Thread Svante Signell
On Sat, 2014-12-20 at 15:29 +0100, Svante Signell wrote: > Hi, > > Building gnat-4.9 fails currently with EACCES errors when building some > of the .debs, specifically libgnatvsn4.9-dev, libgnatprj4.9-dev. The > failing commands are dh_movefiles and dh_md5sums, ... > Invoking

Investigation of the failing build of gnat-4.9 using fakeroot-hurd

2014-12-20 Thread Svante Signell
that the processing is via pipes, see below for dh_md5sums. (the failures are also somewhat random, sometimes the build of the .deb succeeds, sometimes not. A race condition/something not properly initialized?) Invoking .../fakeroot-hurd sh -c 'command' results in different code paths. Ho

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Samuel Thibault
Hello, I investigated a bit and found the issue, which probably explains quite a few other bugs: - I added fprintf(stderr,"%s:%s", __FILE__, __func__); fflush(stderr); basically in all EBUSY places in libdiskfs, libnetfs, libfshelp - I got it from libnetfs/netfs_S_file_set_translator. That di

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Samuel Thibault
Svante Signell, le Mon 08 Dec 2014 14:17:24 +0100, a écrit : > Aha, so if I had used fprintf to e.g. stderr the built hurd would boot > even with printing enabled? Good to know ;) I do put printfs to stderr in my installed translators essentially all the time, including ext2fs and such. So yes, th

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Svante Signell
On Mon, 2014-12-08 at 14:10 +0100, Samuel Thibault wrote: > Svante Signell, le Mon 08 Dec 2014 14:08:15 +0100, a écrit : > > On Mon, 2014-12-08 at 13:26 +0100, Samuel Thibault wrote: > > > Svante Signell, le Mon 08 Dec 2014 13:24:16 +0100, a écrit : > > > > what is wrong with writing to a file? > >

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Samuel Thibault
Svante Signell, le Mon 08 Dec 2014 14:08:15 +0100, a écrit : > On Mon, 2014-12-08 at 13:26 +0100, Samuel Thibault wrote: > > Svante Signell, le Mon 08 Dec 2014 13:24:16 +0100, a écrit : > > > what is wrong with writing to a file? > > > > Nothing wrong, except that you must be sure that the transla

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Svante Signell
r write to its own > /tmp/foobar.log is probably deemed to fail, for instance. Ok, but the ext2fs translator I started is only working on /my_chroot/DEBs/test_fakeroot-hurd/test_ext2fs. Update: The printouts and the bugfix works now (hopefully) :) I had to add LD_LIBRARY_PATH in two places in the

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Justus Winter
Quoting Samuel Thibault (2014-12-08 13:11:22) > fprintf(stderr)+fflush *does* work, I've been using various times. I like to use error (0, 0, "didum"). It's easy to use, prints the servers name, prints a newline and does fflush. The most annoying thing about it is that it doesn't print the messa

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Samuel Thibault
BTW, one way to check what is actually getting run is using gdb: $ ps -feM | grep auth youpi 19910 19908 0:00.01 /bin/fakeauth /bin/sh -c cd "$1" || exit ; shift $ gdb /bin/fakeauth 19910 ... Reading symbols from /home/youpi/libpthread.so.0.3...(no debugging symbols found)...done. Loaded symbo

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Samuel Thibault
Svante Signell, le Mon 08 Dec 2014 13:24:16 +0100, a écrit : > what is wrong with writing to a file? Nothing wrong, except that you must be sure that the translator can write to it. Making the root translator write to its own /tmp/foobar.log is probably deemed to fail, for instance. Samuel

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Svante Signell
gt; using various times. If you don't get your prints going somewhere, > you're probably not managing to start your rebuilt programs. Again, to > be sure, put fprintf(stderr)+fflush in the main() and initialization > function of your translators and libraries to make sure you'

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Samuel Thibault
Svante Signell, le Mon 08 Dec 2014 13:09:28 +0100, a écrit : > On Mon, 2014-12-08 at 12:40 +0100, Samuel Thibault wrote: > > Svante Signell, le Mon 08 Dec 2014 12:05:13 +0100, a écrit : > > > Which translators are restarted when installing, > > > > Nothing gets restarted when you install. Only the

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Samuel Thibault
my_chroot/DEBs/test_fakeroot-hurd/settrans --chroot \ > > > /my_chroot/DEBs/test_fakeroot-hurd/fakeauth \ > > > > See ./hurd/debugging/translator/gdb on the wiki: you need to use env to > > properly set LD_LIBRARY_PATH for a translator. > > problem is that fakeroo

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Svante Signell
On Mon, 2014-12-08 at 12:40 +0100, Samuel Thibault wrote: > Svante Signell, le Mon 08 Dec 2014 12:05:13 +0100, a écrit : > > Which translators are restarted when installing, > > Nothing gets restarted when you install. Only the newer translator that > you start will use the new implementation. >

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Svante Signell
t_fakeroot-hurd/fakeauth \ > > See ./hurd/debugging/translator/gdb on the wiki: you need to use env to > properly set LD_LIBRARY_PATH for a translator. problem is that fakeroot-hurd is a script so adding /usr/bin/env LD_LIBRARY_PATH=... to /my_chroot/DEBs/test_fakeroot-hurd/fakeroot-hurd

Re: Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Samuel Thibault
Svante Signell, le Mon 08 Dec 2014 12:05:13 +0100, a écrit : > Which translators are restarted when installing, Nothing gets restarted when you install. Only the newer translator that you start will use the new implementation. > and which are when rebooting? Everything gets restarted of course.

Confusing results when trying to debug fakeroot-hurd

2014-12-08 Thread Svante Signell
Hi, Attached is a partial summery trying to debug the problems with fakeroot-hurd when building glibc. Print statements to file are added to: trans/fakeroot.c libnetfs/file-set-translator.c libdiskfs/file-set-trans.c (and other files in libnetfs/, libdiskfs/, but no hits whatsoever for them

Re: [PATCH hurd 21/30] trans/fakeroot: make the demuxer payload-aware

2014-12-01 Thread Samuel Thibault
Justus Winter, le Thu 27 Nov 2014 14:19:01 +0100, a écrit : > * trans/fakeroot.c (netfs_demuxer): Make the demuxer payload-aware. Ack. > --- > trans/fakeroot.c | 17 + > 1 file changed, 13 insertions(+), 4 deletions(-) > > diff --git a/trans/fakeroot.c b/trans/fakeroot.c > index

[PATCH hurd 21/30] trans/fakeroot: make the demuxer payload-aware

2014-11-27 Thread Justus Winter
* trans/fakeroot.c (netfs_demuxer): Make the demuxer payload-aware. --- trans/fakeroot.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/trans/fakeroot.c b/trans/fakeroot.c index df2de64..12173bd 100644 --- a/trans/fakeroot.c +++ b/trans/fakeroot.c @@ -964,9

Re: fakeroot-hurd not properly returning errors

2014-08-19 Thread Ivan Shmakov
> Anatoly A Kazantsev writes: […] > @@ -348,9 +349,17 @@ main(int argc, char *argv[]) >break; > default: /* Parent. */ > - if (waitpid (pid, NULL, 0) == -1) > + if (waitpid (pid, &status, 0) == -1) > error (8, errno, "waitpid"); > + if (WIFSIGNA

Re: fakeroot-hurd not properly returning errors

2014-08-19 Thread Svante Signell
l take a look. However, fixing this does not solve the permission > > > > denied problem of fakeroot-hurd. > > > > > > Sure, but at least it won't produce bogus binaries. > > > > Attached is a patch for settrans.c. Tested in the build tree. Will be >

Re: fakeroot-hurd not properly returning errors

2014-08-19 Thread Samuel Thibault
Ah, a duplicate, thanks for the contribution anyway :) Samuel

Re: fakeroot-hurd not properly returning errors

2014-08-19 Thread Samuel Thibault
Svante Signell, le Tue 19 Aug 2014 17:45:25 +0200, a écrit : > On Tue, 2014-08-19 at 17:07 +0200, Samuel Thibault wrote: > > Svante Signell, le Tue 19 Aug 2014 16:23:05 +0200, a écrit : > > > I'll take a look. However, fixing this does not solve the permission > > >

Re: fakeroot-hurd not properly returning errors

2014-08-19 Thread Svante Signell
On Tue, 2014-08-19 at 17:07 +0200, Samuel Thibault wrote: > Svante Signell, le Tue 19 Aug 2014 16:23:05 +0200, a écrit : > > I'll take a look. However, fixing this does not solve the permission > > denied problem of fakeroot-hurd. > > Sure, but at least it won't pr

Re: fakeroot-hurd not properly returning errors

2014-08-19 Thread Anatoly A. Kazantsev
On Tue, 19 Aug 2014 15:30:43 +0200 Samuel Thibault wrote: > Hello, > > In short: > > youpi@exodar:~$ fakeroot-hurd false > /bin/fakeauth: Error 1 for child 28735 > youpi@exodar:~$ echo $? > 0 > > It should be 1. That's the reason why the gnat-4.9 build

Re: fakeroot-hurd not properly returning errors

2014-08-19 Thread Samuel Thibault
Svante Signell, le Tue 19 Aug 2014 16:23:05 +0200, a écrit : > I'll take a look. However, fixing this does not solve the permission > denied problem of fakeroot-hurd. Sure, but at least it won't produce bogus binaries. Samuel

Re: fakeroot-hurd not properly returning errors

2014-08-19 Thread Svante Signell
On Tue, 2014-08-19 at 15:30 +0200, Samuel Thibault wrote: > Hello, > > In short: > > youpi@exodar:~$ fakeroot-hurd false > /bin/fakeauth: Error 1 for child 28735 > youpi@exodar:~$ echo $? > 0 > > It should be 1. That's the reason why the gnat-4.9 build failur

fakeroot-hurd not properly returning errors

2014-08-19 Thread Samuel Thibault
Hello, In short: youpi@exodar:~$ fakeroot-hurd false /bin/fakeauth: Error 1 for child 28735 youpi@exodar:~$ echo $? 0 It should be 1. That's the reason why the gnat-4.9 build failure went unnoticed. The source in hurd/utils/settrans.c, when chroot_command is given, indeed forks and waitp

Re: [PATCH 3/5] trans/fakeroot: fix error handling

2014-06-17 Thread Samuel Thibault
Justus Winter, le Mon 16 Jun 2014 19:49:27 +0200, a écrit : > Found using the Clang Static Analyzer. > > * trans/fakeroot.c (new_node): Do not leak a pointer to freed memory. > Store NULL at *np instead. This fixes a node use-after-free in > netfs_S_dir_lookup. Ack. > --- > trans/fakeroot.c |

[PATCH 3/5] trans/fakeroot: fix error handling

2014-06-16 Thread Justus Winter
Found using the Clang Static Analyzer. * trans/fakeroot.c (new_node): Do not leak a pointer to freed memory. Store NULL at *np instead. This fixes a node use-after-free in netfs_S_dir_lookup. --- trans/fakeroot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/trans/fakeroot.c b/trans/fakero

Re: [PATCH 4/6] trans/fakeroot: use netfs_node_netnode instead of np->nn

2014-05-29 Thread Samuel Thibault
Justus Winter, le Thu 29 May 2014 18:41:02 +0200, a écrit : > When using fat nodes, expressions of the form E->nn can be rewritten > as netfs_node_netnode (E). This is much faster as it only involves a > offset calculation. For reference, I used the following semantic > patch to create the patch:

Re: [PATCH 3/6] trans/fakeroot: use fat nodes to simplify the node cache

2014-05-29 Thread Samuel Thibault
Justus Winter, le Thu 29 May 2014 18:41:01 +0200, a écrit : > Previously, fakeroot stored netnodes in the hash table. But we are > not interested in a cache for netnodes, we need a node cache. So > fakeroot kept pointers to the associated node object in each netnode > object. >

[PATCH 4/6] trans/fakeroot: use netfs_node_netnode instead of np->nn

2014-05-29 Thread Justus Winter
When using fat nodes, expressions of the form E->nn can be rewritten as netfs_node_netnode (E). This is much faster as it only involves a offset calculation. For reference, I used the following semantic patch to create the patch: @@ expression E; @@ - E->nn + netfs_node_netnode (E) * trans/fak

[PATCH 3/6] trans/fakeroot: use fat nodes to simplify the node cache

2014-05-29 Thread Justus Winter
Previously, fakeroot stored netnodes in the hash table. But we are not interested in a cache for netnodes, we need a node cache. So fakeroot kept pointers to the associated node object in each netnode object. Use fat netfs nodes, which combine node and netnode objects. * trans/fakeroot.c

[PATCH 11/11] trans/fakeroot: use netfs_node_netnode instead of np->nn

2014-05-22 Thread Justus Winter
When using fat nodes, expressions of the form E->nn can be rewritten as netfs_node_netnode (E). This is much faster as it only involves a offset calculation. For reference, I used the following semantic patch to create the patch: @@ expression E; @@ - E->nn + netfs_node_netnode (E) * trans/fak

[PATCH 10/11] trans/fakeroot: use fat nodes to simplify the node cache

2014-05-22 Thread Justus Winter
Previously, fakeroot stored netnodes in the hash table. But we are not interested in a cache for netnodes, we need a node cache. So fakeroot kept pointers to the associated node object in each netnode object. Use fat netfs nodes, which combine node and netnode objects. * trans/fakeroot.c

Re: [PATCH] trans/fakeroot: override fshelp_isowner

2014-05-20 Thread Samuel Thibault
Justus Winter, le Tue 20 May 2014 09:46:02 +0200, a écrit : > As of recently, fakeroot would fail to create symlinks: > > % fakeroot-hurd ln -s foo a > ln: failed to create symbolic link ‘a’: Operation not permitted > > Fix this by overriding fshelp_isowner. > > Vari

[PATCH] trans/fakeroot: override fshelp_isowner

2014-05-20 Thread Justus Winter
As of recently, fakeroot would fail to create symlinks: % fakeroot-hurd ln -s foo a ln: failed to create symbolic link ‘a’: Operation not permitted Fix this by overriding fshelp_isowner. Various netfs functions will call fshelp_isowner to check whether USER is allowed to do some operation. As

[PATCH 3/4] trans/fakeroot: use fat nodes to simplify the node cache

2014-05-18 Thread Justus Winter
Previously, fakeroot stored netnodes in the hash table. But we are not interested in a cache for netnodes, we need a node cache. So fakeroot kept pointers to the associated node object in each netnode object. Use fat netfs nodes, which combine node and netnode objects. * trans/fakeroot.c

[PATCH 4/4] trans/fakeroot: use netfs_node_netnode instead of np->nn

2014-05-18 Thread Justus Winter
When using fat nodes, expressions of the form E->nn can be rewritten as netfs_node_netnode (E). This is much faster as it only involves a offset calculation. For reference, I used the following semantic patch to create the patch: @@ expression E; @@ - E->nn + netfs_node_netnode (E) * trans/fak

Re: [PATCH 3/4] trans/fakeroot: use C99-style struct initialization

2014-05-16 Thread Samuel Thibault
Justus Winter, le Fri 16 May 2014 18:56:26 +0200, a écrit : > * trans/fakeroot.c (main): Use C99-style struct initialization to > initialize argp. This avoids a warning about missing field > initializers. Ack. > --- > trans/fakeroot.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >

Re: [PATCH 2/4] trans/fakeroot: fix comparison between signed and unsigned

2014-05-16 Thread Samuel Thibault
Justus Winter, le Fri 16 May 2014 18:56:25 +0200, a écrit : > * trans/fakeroot.c (netfs_attempt_chown): Fix comparison between > signed and unsigned integer expressions. Ack. > --- > trans/fakeroot.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/trans/fakeroot.c b

Re: [PATCH 1/4] trans/fakeroot: remove spurious semicolon

2014-05-16 Thread Samuel Thibault
Justus Winter, le Fri 16 May 2014 18:56:24 +0200, a écrit : > A spurious semicolon caused a control flow bug in check_openmodes, > leading to a port leak. Ack > * trans/fakeroot.c (check_openmodes): Remove spurious semicolon. > --- > trans/fakeroot.c | 2 +- > 1 file changed, 1 insertion(+), 1 d

[PATCH 2/4] trans/fakeroot: fix comparison between signed and unsigned

2014-05-16 Thread Justus Winter
* trans/fakeroot.c (netfs_attempt_chown): Fix comparison between signed and unsigned integer expressions. --- trans/fakeroot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 0ea3cbf..3107e29 100644 --- a/trans/fakeroot.c +++ b/tran

[PATCH 3/4] trans/fakeroot: use C99-style struct initialization

2014-05-16 Thread Justus Winter
* trans/fakeroot.c (main): Use C99-style struct initialization to initialize argp. This avoids a warning about missing field initializers. --- trans/fakeroot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 3107e29..c4b95de 100644 ---

[PATCH 1/4] trans/fakeroot: remove spurious semicolon

2014-05-16 Thread Justus Winter
A spurious semicolon caused a control flow bug in check_openmodes, leading to a port leak. * trans/fakeroot.c (check_openmodes): Remove spurious semicolon. --- trans/fakeroot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 987af24..0

Re: [PATCH] trans/fakeroot: shutdown the translator if the last client is gone

2013-12-19 Thread Samuel Thibault
Justus Winter, le Thu 19 Dec 2013 12:47:37 +0100, a écrit : > Previously, fakeroot would not exit if a process outlived the original > process started by settrans. This caused bugs like this: > > % fakeroot-hurd /bin/sh -c 'sleep 1&' 2>&1 | tee > > >

[PATCH] trans/fakeroot: shutdown the translator if the last client is gone

2013-12-19 Thread Justus Winter
Previously, fakeroot would not exit if a process outlived the original process started by settrans. This caused bugs like this: % fakeroot-hurd /bin/sh -c 'sleep 1&' 2>&1 | tee Fix this by exiting if the last client of fakeroot goes away. If noone has a right to any c

[PATCH] trans/fakeroot: shutdown the translator if the last client is gone

2013-12-18 Thread Justus Winter
Previously, fakeroot would not exit if a process outlived the original process started by settrans. This caused bugs like this: % fakeroot-hurd /bin/sh -c 'sleep 1&' 2>&1 | tee Fix this by exiting if the last client of fakeroot goes away. * trans/fakeroot.c (fakeroot

Re: [PATCH 5/5] trans/fakeroot: remove dead code

2013-12-10 Thread Samuel Thibault
Justus Winter, le Tue 10 Dec 2013 17:50:30 +0100, a écrit : > * trans/fakeroot.c (netfs_S_dir_lookup): Remove dead code. Ack. > --- > trans/fakeroot.c |6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/trans/fakeroot.c b/trans/fakeroot.c > index 58f1112..203f2c1 1

Re: [PATCH 4/5] trans/fakeroot: remove dead code

2013-12-10 Thread Samuel Thibault
Justus Winter, le Tue 10 Dec 2013 17:50:29 +0100, a écrit : > * trans/fakeroot.c (netfs_S_dir_lookup): Remove dead code. Ack. > --- > trans/fakeroot.c | 67 > +++--- > 1 file changed, 29 insertions(+), 38 deletions(-) > > diff --git a/trans/fak

Re: [PATCH 3/5] trans/fakeroot: drop else

2013-12-10 Thread Samuel Thibault
Justus Winter, le Tue 10 Dec 2013 17:50:28 +0100, a écrit : > * trans/fakeroot.c (netfs_S_dir_lookup): Drop else. Ack. > --- > trans/fakeroot.c | 76 > ++ > 1 file changed, 37 insertions(+), 39 deletions(-) > > diff --git a/trans/fakeroot.c

Re: [PATCH 2/5] trans/fakeroot: fix ownership of newly created files

2013-12-10 Thread Samuel Thibault
Justus Winter, le Tue 10 Dec 2013 17:50:27 +0100, a écrit : > Previously, files created in the fakeroot environment were created > with the uid and gid of the user running fakeroot: > > % fakeroot-hurd /bin/sh -c 'touch /tmp/$$; stat --format=%u:%g /tmp/$$' > 1000:100

Re: [PATCH 07/13] trans: return nodes locked when creating fake nodes in fakeroot

2013-12-10 Thread Samuel Thibault
fs_nref (*np); /* Return a reference to the caller. */ > > > + } > > >pthread_mutex_unlock (&idport_ihash_lock); > > > > Did you check the lock ordering between these two? > > Yes. Previously, new_node added an unlocked node to the hash table a

[PATCH 5/5] trans/fakeroot: remove dead code

2013-12-10 Thread Justus Winter
* trans/fakeroot.c (netfs_S_dir_lookup): Remove dead code. --- trans/fakeroot.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 58f1112..203f2c1 100644 --- a/trans/fakeroot.c +++ b/trans/fakeroot.c @@ -371,10 +371,8 @@ netfs_S_

[PATCH 4/5] trans/fakeroot: remove dead code

2013-12-10 Thread Justus Winter
* trans/fakeroot.c (netfs_S_dir_lookup): Remove dead code. --- trans/fakeroot.c | 67 +++--- 1 file changed, 29 insertions(+), 38 deletions(-) diff --git a/trans/fakeroot.c b/trans/fakeroot.c index f278db1..58f1112 100644 --- a/trans/fakeroot.c ++

[PATCH 3/5] trans/fakeroot: drop else

2013-12-10 Thread Justus Winter
* trans/fakeroot.c (netfs_S_dir_lookup): Drop else. --- trans/fakeroot.c | 76 ++ 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 6882618..f278db1 100644 --- a/trans/fakeroot.c +++ b/tra

[PATCH 2/5] trans/fakeroot: fix ownership of newly created files

2013-12-10 Thread Justus Winter
Previously, files created in the fakeroot environment were created with the uid and gid of the user running fakeroot: % fakeroot-hurd /bin/sh -c 'touch /tmp/$$; stat --format=%u:%g /tmp/$$' 1000:1000 * trans/fakeroot.c (netfs_S_dir_lookup): Fix ownership of newly created files.

Re: [PATCH 07/13] trans: return nodes locked when creating fake nodes in fakeroot

2013-12-10 Thread Justus Winter
} > >pthread_mutex_unlock (&idport_ihash_lock); > > Did you check the lock ordering between these two? Yes. Previously, new_node added an unlocked node to the hash table and unlocked the idport_ihash_lock. The use of locks in fakeroot is partially ordered: * If you need to pick

Re: [PATCH 12/13] trans: unlock nodes with faked attributes in fakeroot

2013-12-09 Thread Samuel Thibault
Justus Winter, le Mon 09 Dec 2013 15:16:40 +0100, a écrit : > When a node has faked attributes, we cannot drop our node. > Reinitialize the lock box as if the node was dropped. This fixes the > following bug: > > % fakeroot-hurd /bin/sh -c 'touch /tmp/$$.lock >

Re: [PATCH 10/13] trans: fix reference counting bug in fakeroot

2013-12-09 Thread Samuel Thibault
ction of the node causing bugs like this: Ack. > % fakeroot-hurd sh -c 'l(){ flock /tmp/$$.lock true; }; l; l' > > > * trans/fakeroot.c (new_node): Fix reference count of newly created > nodes. > --- > trans/fakeroot.c |5 + > 1 file changed, 1 insert

Re: [PATCH 07/13] trans: return nodes locked when creating fake nodes in fakeroot

2013-12-09 Thread Samuel Thibault
Justus Winter, le Mon 09 Dec 2013 15:16:35 +0100, a écrit : > + { > + pthread_mutex_lock (&(*np)->lock); > + netfs_nref (*np); /* Return a reference to the caller. */ > + } >pthread_mutex_unlock (&idport_ihash_lock); Did you check the lock ordering between these tw

Re: [PATCH 06/13] trans: fix locking issue in fakeroot

2013-12-09 Thread Samuel Thibault
Justus Winter, le Mon 09 Dec 2013 15:16:34 +0100, a écrit : > * trans/fakeroot.c (netfs_attempt_mkfile): Keep dir locked until the > new node is created. Ack. > --- > trans/fakeroot.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/trans/fakeroot.c b/trans/fakeroot

  1   2   3   >