All users were logged out of Bugzilla on October 13th, 2018

[PP]Build fails if DIST path contains symlinks (sometimes)

VERIFIED FIXED

Status

P3
normal
VERIFIED FIXED
20 years ago
20 years ago

People

(Reporter: tenthumbs, Assigned: srinivas)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

20 years ago
I decide the final resting place for NSPR is /usr/xtra/nspr but I do not want to
build as root; so ...

As the build user, I create /tmp/usr/xtra. As root I do
  ln -s /tmp/usr/xtra /usr/xtra

As the build user I say "make DIST=/usr/xtra/nspr".

The first time nsinstall runs it dies with an error saying "permission" denied
trying to create /usr/xtra.

It appears that nsinstall uses lstat rather than stat sometimes and doesn't
recognize that it can create /usr/xtra/nspr.

If I manually create /tmp/usr/xtra/nspr the build works.
(Assignee)

Updated

20 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 1

20 years ago
Accepted the bug and added CC list.

Updated

20 years ago
Summary: Build fails if DIST path contains symlinks (sometimes) → [PP]Build fails if DIST path contains symlinks (sometimes)

Comment 2

20 years ago
I followed the exact recipe you described on
my machine and it worked for me.

Can you do 'ls -l /usr/xtra' and see what it
says?
(Reporter)

Comment 3

20 years ago
Created attachment 19 [details]
Problem documentation
(Assignee)

Comment 4

20 years ago
This is caused by the use of lstat by nsinstall. To create

/usr/xtra/nspr

nsinstall checks, by calling lstat, if each component of the path is a
directory. After reaching a directory (/usr, in this case) nsinstall starts to
build the path and fails because you don't have write permission for /usr.

Can you apply the following patch to nsprpub/config/nsinstall.c and retry your
test case?

Index: nsinstall.c
===================================================================
RCS file: /cvsroot/mozilla/nsprpub/config/nsinstall.c,v
retrieving revision 3.10
diff -r3.10 nsinstall.c
132c132
<       if ((lstat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
---
>       if ((stat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
(Reporter)

Comment 5

20 years ago
Yes, that fixes it.
(Reporter)

Comment 6

20 years ago
Since this same code appears in mozilla/config/nsinstall.c, perhaps this should
be passed on to the person responsible.
(Assignee)

Comment 7

20 years ago
Added Chris Yeh and Ramiro to the cc list.

Chris and Ramiro, can you make a similar change to

mozilla/config/nsinstall.c?
(Assignee)

Updated

20 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 20 years ago
Resolution: --- → FIXED
(Assignee)

Comment 8

20 years ago
Fix checked in. Marking the bug resolved.

File modified;

mozilla/nsprpub/config/nsinstall.c (rev. 3.11)

Comment 9

20 years ago
NSPR now has its own Bugzilla product.  Moving this bug to the NSPR product.

Comment 10

20 years ago
this fix is not visible to qa. if you think this bug should be reopened,
please do so.

will mark as verified.

Updated

20 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.