Issue 20459 - loader fails in bind mount directory tree (setup failed with "absolute programpath cannot be found")
Summary: loader fails in bind mount directory tree (setup failed with "absolute progra...
Status: CLOSED FIXED
Alias: None
Product: Installation
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 RC5
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 1.1.1
Assignee: Olaf Felka
QA Contact: issues@installation
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-30 14:26 UTC by chris
Modified: 2004-01-28 09:40 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch generated against 1.1rc5 (933 bytes, patch)
2003-09-30 14:27 UTC, chris
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description chris 2003-09-30 14:26:51 UTC
Setup fails on any system that uses bind mounts to provide access to home
directories in several chroot environments, like this one:

halls@bruckner:~$ mount
/dev/sda2 on / type ext2 (rw,errors=remount-ro)
/home on /org/bruckner.debian.org/chroot/sid/home type none (rw,bind)
[...]

Running setup gives this error:

./instsetoo/unxlngppc.pro/01/normal/setup -v
-R:/home/halls/openoffice.org/debian/local/rsfile.txt -nogui
./instsetoo/unxlngppc.pro/01/normal/setup: absolute programpath cannot be found.

The problem is in loader.c:  __getFullPath() will only try to find the patchname
using names if it seems to be an NFS mount, where the devices of the current
directory and its parent are different:

if (status.st_dev == parent.st_dev)
{
 [...]
}
else
{
   /*
    * if this point is a mount point we have to check
    * each entry, because the inode number in the directory
    * is for the parent directory, not for the mounted file
    */
 [...]
}

However, on a bind mount, status.st_dev and parent.st_dev are the same, so the
first code path is followed and fails because the inode number in the parent
directory is for the mount point.

I have worked around this by disabling the first code path and making the second
path be used always.  It doesn't seem to be a performance problem, since this
code is only used during the setup loader.

I'll attach the patch I used to work around the problem.
Comment 1 chris 2003-09-30 14:27:23 UTC
Created attachment 9843 [details]
Patch generated against 1.1rc5
Comment 2 Olaf Felka 2003-09-30 14:39:42 UTC
of -> dv: please have a look at this patch.
Comment 3 dirk.voelzke 2003-10-20 09:19:37 UTC
I'll have a look.
Comment 4 dirk.voelzke 2003-10-24 14:47:07 UTC
Hi Chris,

I've replaced the function __getFullPath() with realpath() and
everything works fine, but I don't know anything about bind mounts, so
perhaps you can check, if my solution works for you, too?

Thanks, Dirk

p.s.: Use version 1.49.14.2.2.3 of loader.c
Comment 5 chris 2003-10-24 16:18:58 UTC
Hi Dirk, the use of realpath() looks fine to me, thanks for the fix. 
I will include your version of the file in the next Debian package
builds to verify it works on all our systems.

Thanks, Chris
Comment 6 dirk.voelzke 2003-10-27 15:34:43 UTC
Please verify.
Comment 7 Olaf Felka 2003-10-28 11:50:15 UTC
Now we have realpath() in loader.c.
Comment 8 Olaf Felka 2003-10-28 11:51:50 UTC
Verified in in cws SetupPP01.
Comment 9 Olaf Felka 2004-01-28 09:40:15 UTC
Ok in current version.