Closed Bug 272019 Opened 20 years ago Closed 20 years ago

Bookmarks Lost on Version Upgrade

Categories

(Firefox :: Bookmarks & History, defect)

x86
Linux
defect
Not set
critical

Tracking

()

VERIFIED DUPLICATE of bug 236593

People

(Reporter: ruhl+bugzilla, Unassigned)

Details

(Whiteboard: DUPEME)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.7.5) Gecko/20041110 Firefox/1.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.7.5) Gecko/20041110 Firefox/1.0

When upgrading firefox, one is supposed to run it as root once, in order to
rebuild various files.  The standard secure way to run things as root is to use
sudo, but sudo only changes the effective UID--one is still oneself, and this
firefox attempts to load one's own bookmarks and prefs.js.  Then on quit it
saves them, only as root instead of as one's own user.  So far, there has been
no data loss.

Then one starts firefox again as oneself.  Since the file modes on bookmarks.*
and prefs.js as rw only for the user, one cannot read the now-root-owned
bookmarks, and firefox defaults to a completely empty list of bookmarks (a
message "(QFA)Talkback error: Can't initialize." is also printed to stdout).  So
far there's no data loss on disk, just in memory.

Then one quits firefox and the 'new' bookmarks are written out, over-writing the
root-owned bookmarks.html and bookmarks.bak (since one's user still owns the
containing directory, one can over-write the root-owned files therein).  Thus is
a bookmarks file which may contain years of collected data destroyed in the
blink of an eye, with no way to recover it, save from backups (if they exist).

Reproducible: Always
Steps to Reproduce:
1. ls -l .mozilla/firefox/WHATEVER/{bookmarks.*,*.js}
2. sudo firefox&
3. ls -l .mozilla/firefox/WHATEVER/{bookmarks.*,*.js}
4. # quit firefox
5. ls -l .mozilla/firefox/WHATEVER/{bookmarks.*,*.js} # bookmarks owned by root
6. firefox&
7. ls -l .mozilla/firefox/WHATEVER/{bookmarks.*,*.js}
8. # quit firefox
9. ls -l .mozilla/firefox/WHATEVER/{bookmarks.*,*.js} # bookmarks now destroyed

Actual Results:  
Both bookmarks.bak and bookmarks.html are empty stubs and all my collected
bookmarks were lost.

Expected Results:  
Obv. data should never be lost: bookmarks.html should not have been so brittle.

Had the files been written in-place, there would have been no issue (ownership
would have been retained by the user at all times).  Were the permissions
different, I do not believe there would have been an issue (the user could have
read in the root-owned bookmarks).  There may be other, more complex, ways to
resolve this situation as well.
Whiteboard: DUPEME
Assignee: vladimir → vladimir+bm
(In reply to comment #0)
> User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.7.5)
Gecko/20041110 Firefox/1.0
> Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.7.5)
Gecko/20041110 Firefox/1.0
> 
> When upgrading firefox, one is supposed to run it as root once, in order to
> rebuild various files.  The standard secure way to run things as root is to use
> sudo, but sudo only changes the effective UID--one is still oneself, and this
> firefox attempts to load one's own bookmarks and prefs.js.  Then on quit it
> saves them, only as root instead of as one's own user.  So far, there has been
> no data loss.
> 
> Then one starts firefox again as oneself.  Since the file modes on bookmarks.*
> and prefs.js as rw only for the user, one cannot read the now-root-owned
> bookmarks, and firefox defaults to a completely empty list of bookmarks (a
> message "(QFA)Talkback error: Can't initialize." is also printed to stdout).  So
> far there's no data loss on disk, just in memory.
> 
> Then one quits firefox and the 'new' bookmarks are written out, over-writing the
> root-owned bookmarks.html and bookmarks.bak (since one's user still owns the
> containing directory, one can over-write the root-owned files therein).  Thus is
> a bookmarks file which may contain years of collected data destroyed in the
> blink of an eye, with no way to recover it, save from backups (if they exist).
> 
> Reproducible: Always
> Steps to Reproduce:
> 1. ls -l .mozilla/firefox/WHATEVER/{bookmarks.*,*.js}
> 2. sudo firefox&
> 3. ls -l .mozilla/firefox/WHATEVER/{bookmarks.*,*.js}
> 4. # quit firefox
> 5. ls -l .mozilla/firefox/WHATEVER/{bookmarks.*,*.js} # bookmarks owned by root
> 6. firefox&
> 7. ls -l .mozilla/firefox/WHATEVER/{bookmarks.*,*.js}
> 8. # quit firefox
> 9. ls -l .mozilla/firefox/WHATEVER/{bookmarks.*,*.js} # bookmarks now destroyed
> 
> Actual Results:  
> Both bookmarks.bak and bookmarks.html are empty stubs and all my collected
> bookmarks were lost.
> 
> Expected Results:  
> Obv. data should never be lost: bookmarks.html should not have been so brittle.
> 
> Had the files been written in-place, there would have been no issue (ownership
> would have been retained by the user at all times).  Were the permissions
> different, I do not believe there would have been an issue (the user could have
> read in the root-owned bookmarks).  There may be other, more complex, ways to
> resolve this situation as well.


I have run into the same VERY annoying problem.  This doesn't just happen when
upgrading to a new version...it happens whenever you run firefox w/ the sudo
command.  I wasn't able to install the CPAN search engine while running firefox
as a non-root user, so I ran it w/ sudo.  The CPAN search then installed, but
all my bookmarks are GONE!!  This is extremely frustrating and disappointing.

*** This bug has been marked as a duplicate of 236593 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
Assignee: vladimir+bm → nobody
sorry for bugspam, long-overdue mass reassign of ancient QA contact bugs, filter on "beltznerLovesGoats" to get rid of this mass change
QA Contact: mconnor → bookmarks
You need to log in before you can comment on or make changes to this bug.