Closed Bug 156814 Opened 22 years ago Closed 22 years ago

If bookmark file is symlink, mozilla overwrites symlink with a file

Categories

(SeaMonkey :: Bookmarks & History, defect)

x86
Linux
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: griswold, Assigned: timeless)

References

Details

Attachments

(1 file)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1a) Gecko/20020610
BuildID:    2002061108

I have my Mozilla bookmark file symlinked to my Netscape 4.x bookmark file so
that I can keep them in sync.  This has worked for a long time, but since I
upgraded to Mozilla 1.1 Alpha, Mozilla replaces the symlink with a file when it
exits.  I would expect that Mozilla would keep the symlink intact when writing
to the bookmark file.

Reproducible: Always
Steps to Reproduce:
1.  CD to Mozilla profile directory
2.  Make bookmarks.html a symlink to Netscape's bookmarks.html (ln -sf
~/.netscape/bookmarks.html .)
3.  Start Mozilla
4.  Add a bookmark
5.  Exit Mozilla
6.  bookmarks.html is no longer a symlink, but is now a regular file.

Actual Results:  Mozilla's bookmarks.html is no longer a symlink, but is now a
regular file.

Expected Results:  Mozilla should keep the symlink intact and overwrite the
symlink target instead.  This is normal Unix behavior.

I'm running on RedHat Linux 7.2, kernel 2.4.7-10.
Some additional information:

-  This happens for hard links as well as soft links.
-  Upon closer inspection, the file is overwritten soon after Mozilla starts.  I
do not have to change the bookmarks file or exit Mozilla for this to happen
Confirming..... This is not good at all....
Severity: normal → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
Also happens with Mozilla 1.1a on SPARC Solaris 8.
can someone from networking: file please tell bookmarks what they should be doing?

claudius: can you find someone to do whatever networking tells bookmarks to do?
URL: N/A
Component: Bookmarks → Networking: File
QA Contact: claudius
.
Assignee: ben → dougt
QA Contact: benc
time is scarce.  I need a reduced test case if this is a problem in the linux
nsIFile impl. However, i bet it is just the bookmarks code doing something wrong.
Assignee: dougt → ben
Component: Networking: File → Bookmarks
QA Contact: benc → claudius
Should this block bug 58647?
*** Bug 162278 has been marked as a duplicate of this bug. ***
re comment 7: no, unless you know of a way to create a polymorphic symlink.

people who want mozilla to use some other bookmark file should just set the pref
manually to point to another bookmark file. the mozilla preference is
"browser.bookmark.location" the netscape4 and older preference was
"browser.bookmark_location" documentation for these preferences can be found
using google, or bugzilla or ufaq.

--note that i'm not saying this report isn't valid, i'm just explaining what you
can and probably should do in the interim, when it's fixed you can decide what
you want to do.
*** Bug 165541 has been marked as a duplicate of this bug. ***
Also in Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827
*** Bug 172377 has been marked as a duplicate of this bug. ***
*** Bug 172765 has been marked as a duplicate of this bug. ***
Temporary solution described in comment #9 does not work.  I have tried the
following combinations:

user_pref("browser.bookmark.location",
"/data/doc/netscape/users/deragon/obf1wrrq.slt");
user_pref("browser.bookmark.location",
"/data/doc/netscape/users/deragon/obf1wrrq.slt/bookmarks.html");
user_pref("browser.bookmarks.location",
"/data/doc/netscape/users/deragon/obf1wrrq.slt");
user_pref("browser.bookmarks.location",
"/data/doc/netscape/users/deragon/obf1wrrq.slt/bookmarks.html");

in prefs.js, and deleted the local bookmarks.html.  Yet this preference entry is
ignored and a new bookmarks.html file is created.

My temporary solution is to create a script which calls mozilla, and when
mozilla dies, it moves the bookmarks.html file recreated to the other location
and then rebuild the symlink.
Man you people are so picky and uncreative, I'm sorry I got the pref wrong, a
bit of lxr use found the correct string (please report if this one fails):

1.187 <gerv@gerv.net> 19 May 2001 08:57
Make it possible to set the location of the bookmarks file. Bug 31623.
r=timeless, sr=waterson. Pref for this is browser.bookmarks.file - you need to
edit your pref.js manually. I seem to remember you need to double your
backslashes on Windows...
*** Bug 178444 has been marked as a duplicate of this bug. ***
Attached patch sillySplinter Review
.
Assignee: ben → timeless
Comment on attachment 105352 [details] [diff] [review]
silly

sr=bzbarsky
Attachment #105352 - Flags: superreview+
checked in
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
*** Bug 181658 has been marked as a duplicate of this bug. ***
*** Bug 183498 has been marked as a duplicate of this bug. ***
Problem is present in mozilla release 1.2 and 1.2.1 for linux again.
Let's see here...

1)  This bug fixed:  2002-11-06 17:29  (That's November 6, afternoon)
2)  1.2 branched from the trunk:  01-Nov-2002 (according to
    http://mozilla.org/roadmap.html)

So 1.2 is just too old to have the fix.  All there is to it.
This seems to work.  If I symlink the bookmarks file, and open Mozilla, create
some bookmarks, and then close mozilla, it seems to work with no problems.  But
today, I just happened to peer into my .mozilla directory and notice that
bookmarks.html wasn't symlinked anymore, it was local.  So I'm not sure if this
bug has been completely squashed.  I'll keep an eye out, and I'll check my
.mozilla directory periodically, to see if I can figure out what triggered this.
 I am using 1.3 alpha.
Sorry, in my last comment (#26) I should have said: "This DOESN'T seem to work".
 Sorry for that typo.

It is now 2 days after I wrote that comment, and I have noticed once again, that
this bug is not 100% squashed.  My bookmarks.html file has once again been
replaced by a local version.  I'm sorry, but I have not yet figured out what
exactly is causing it to not follow the symlink.
*** Bug 191617 has been marked as a duplicate of this bug. ***
It looks like the bug was never reopened, but are you still seeing this problem,
David?  I just tested with latest nightly and am seeing this problem fixed.  Are
you using Mozilla with different users who have different access permissions on
the linked-to bookmarks.html?  I know that for example Redhat 8.0 will by
default mount windows partitions in such a way that you can not write to them. 
Can you check your permissions in the linked-to file and see if this is working
with latest nightly?
I don't think my problem is an access permission problem for the bookmarks.html
file.  Because I've symlinked it before, and then added some sites to the
bookmarts from within Mozilla and then it follows the symlink fine.  I'm using
1.3b, but I can check out a nightly no problem.  Is there only one area in the
code where the bookmarks.html is modifified?  Or is it possible that there are
different pieces of code, one which follows the symlink and another which doesn't?
Okay here's what I did today:

1) Symlinked my bookmarks.html to a FAT32 drive bookmarks.html file
2) Started Mozilla 1.3a
3) Noted that filesize of bookmarks.html file on FAT32 drive was 23762 bytes.
4) Added a bookmark
5) Closed Browser
6) Noted that file was still symlinked and the file size was now 23880 bytes,
confirming that a new bookmark was in fact added to the file.

But what's the catch?  Eventually, after a few days, my bookmarks.html file will
suddenly become localized again, and the symlink is lost.  I admit that this MAY
be a problem on my computer and not a bug.  I am not ruling out that
possibility, however, I am also not ruling out the possibility that this bug is
still not perfectly fixed.

According to comment #25, this should be fixed by 1.3a, so I don't think
upgrading to nightly right now would help.  Especially since it mostly works in
1.3a.  I just can't track down when the bookmarks.html is getting replaced with
a local version.  I'll keep looking.
reported with build 1.4a on OS/X: bug 198138
This bug is again present in 1.4b, although it had disappeared in 1.3...
I noticed that even if I don't do anything with my bookmarks (add/delete), the
link is replaced with a file.
My bookmarks.html is linked to the one in a FAT32 partition (used by my Windows
Mozilla).
I think all the bookmarks code was re-written or at least overhauled for 1.4
I just checked with the latest nightly on Linux [Mozilla/5.0 (X11; U; Linux
i686; en-US; rv:1.4b) Gecko/20030522] and the problem is still here. 

I think this bug must be reopened and fixed for 1.4.
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: