Project

General

Profile

Bug #17201

Nautilus Bookmarks Tor Browser infinite add

Added by op_mb about 1 month ago. Updated 13 days ago.

Status:
In Progress
Priority:
Low
Assignee:
Category:
Persistence
Target version:
Start date:
Due date:
% Done:

100%

Feature Branch:
Type of work:
Code
Blueprint:
Starter:
Yes
Affected tool:

Description

when using dotfiles to persist bookmarks in Nautilus side bar,
(/live/persistence/TailsData_unlocked/dotfiles/.config/gtk-3.0/bookmarks)

after every restart, new line [file:///home/amnesia/Tor%20Browser] gets added,
so with infinite boots -> infinite Tor Browser shortcuts in the Nautilus' side bar

it is possible that there is a missing conditional statement that checks if in the /live/persistence/TailsData_unlocked/dotfiles/.config/gtk-3.0/bookmarks the [file:///home/amnesia/Tor%20Browser] already exists.

this can be remedied by setting the owner permission of the [file:///home/amnesia/Tor%20Browser] to read only.

as a consequence, if the permission is set to read only, the shortcuts on the doesktop break - their pictures dont get loaded, only metadata gets loaded, which may suggest that there is a hard exit when Tails cant write to /live/persistence/TailsData_unlocked/dotfiles/.config/gtk-3.0/bookmarks

i've attached the pictures

cheers!

To whoever will work on this

The corresponding code lives in /usr/local/lib/add-GNOME-bookmarks.
To test the fix: systemctl --user restart tails-add-GNOME-bookmarks.service

as a consequence.png View - after setting owner to read only (117 KB) op_mb, 10/31/2019 07:57 AM

shorcuts open this.png View - shortcut metadata instead of exec (203 KB) op_mb, 10/31/2019 07:57 AM

x2.png View - reboot 1 (73 KB) op_mb, 10/31/2019 07:57 AM

x3.png View - reboot 2 (96.1 KB) op_mb, 10/31/2019 07:57 AM

add-GNOME-bookmarks - updated 1 line, else if statement (1.01 KB) op_mb, 11/01/2019 08:15 PM

add-GNOME-bookmarks - added if/else clause if argc >=2 (1.21 KB) op_mb, 11/02/2019 10:02 AM

add-GNOME-bookmarks - bugfix/17201 Nautilus Bookmarks Tor Browser infinite add (1.21 KB) op_mb, 11/03/2019 04:35 AM

History

#1 Updated by op_mb about 1 month ago

correction: this can be remedied by setting the owner permission of the:
/live/persistence/TailsData_unlocked/dotfiles/.config/gtk-3.0/bookmarks

#2 Updated by intrigeri about 1 month ago

  • Description updated (diff)
  • Category set to Persistence
  • Status changed from New to Confirmed
  • Priority changed from Normal to Low
  • Feature Branch deleted (Tails4.0_release)
  • Starter set to Yes

op_mb wrote:

correction: this can be remedied by setting the owner permission of the:
/live/persistence/TailsData_unlocked/dotfiles/.config/gtk-3.0/bookmarks

Doing so will effectively fork these bookmarks and will prevent any future update Tails may provide there. I would not advise doing so.

I've added pointers to whoever will work on this in the ticket description :)

#3 Updated by Gelovex about 1 month ago

exactly the same problem, I also have a problem with .desktop files but this problem has already been reported.

@op_mb
https://redmine.tails.boum.org/code/attachments/2445/as%20a%20consequence.png
Please, how do you save color settings for command line in persistence mode?

#4 Updated by op_mb about 1 month ago

i've added 1 line to the script, else if condition, using grep.

i ran: systemctl --user restart tails-add-GNOME-bookmarks.service, on 4.0, but couldnt start it, dont remember error, was something to do with not being eble to create Tor-Browser directiry, im redownloadint 4.0 now, will update.

ran: systemctl --user restart tails-add-GNOME-bookmarks.service, on 3.16, returned no errors, worked as intended

i attached the file

#5 Updated by op_mb about 1 month ago

Gelovex wrote:

exactly the same problem, I also have a problem with .desktop files but this problem has already been reported.

@op_mb
https://redmine.tails.boum.org/code/attachments/2445/as%20a%20consequence.png
Please, how do you save color settings for command line in persistence mode?

i dont have command line settings in persistence, i change to whatever manually

#6 Updated by intrigeri about 1 month ago

Hi @op_mb,

i've added 1 line to the script, else if condition, using grep.

i ran: systemctl --user restart tails-add-GNOME-bookmarks.service, on 4.0, but couldnt start it, dont remember error, was something to do with not being eble to create Tor-Browser directiry, im redownloadint 4.0 now, will update.

I suspect this has to do with #17206. Please retry with the fix I've proposed there.
Note that you'll probably need to run systemctl --user daemon-reload so that these changes are taken into account, before you restart the unit.

Once you have a working fix, to submit your work, see https://tails.boum.org/contribute/merge_policy/#submit :)

#7 Updated by op_mb about 1 month ago

@intrigeri

i've done what you suggested, launched with error (code=exited, status=1/FAILURE), but the script test was ok

its good that i reinstalled on a new 4.0, because there was another condition that wasnt caught, and because i was on a non standard Tails i missed that, but its all fixed, tested good, just gotta submit it now

the steps you suggested, ill add here, just incase for later:

// to restart bookmarks service change content of
/usr/lib/systemd/user/tails-add-GNOME-bookmarks.service

After=tails-create-tor-browser-directories.service gvfs-metadata.service
Requires=tails-create-tor-browser-directories.service gvfs-metadata.service

// enable, reload, restart
systemctl --user enable tails-add-GNOME-bookmarks.service
systemctl --user daemon-reload
systemctl --user restart tails-add-GNOME-bookmarks.service

#8 Updated by op_mb about 1 month ago

#9 Updated by op_mb about 1 month ago

@intrigeri

How to submit your changes: Set the ticket's Status field to In Progress

i dont have access, i cant edit anything

#10 Updated by intrigeri about 1 month ago

i dont have access, i cant edit anything

Oops, right. I just gave you access! :)

#11 Updated by op_mb about 1 month ago

  • File add-GNOME-bookmarks added
  • Status changed from Confirmed to Needs Validation
  • Assignee set to op_mb
  • Target version set to Tails_4.1
  • % Done changed from 0 to 100
  • Feature Branch set to bugfix/17201 Nautilus Bookmarks Tor Browser infinite add

#12 Updated by op_mb about 1 month ago

@intrigeri im not sure if i did it correctly, can you check pls:)
p.s. thanks for access!

#13 Updated by intrigeri about 1 month ago

  • Assignee deleted (op_mb)
  • Feature Branch deleted (bugfix/17201 Nautilus Bookmarks Tor Browser infinite add)

I understand this:

  • this is ready to be reviewed → unassigning from op_mb (otherwise no reviewer will notice this ticket)
  • the fix is provided in the form of a modified script, attached to this ticket; so the "Feature Branch" value is meaningless

Please tell me if I got it wrong!

#14 Updated by intrigeri 13 days ago

  • Status changed from Needs Validation to In Progress
  • Assignee set to op_mb
  • Target version changed from Tails_4.1 to Tails_4.2

I've reviewed the script. Sorry for the delay!

First, IMO we should not repeat ourselves, wrt. the check for "is this bookmark already there?". There are several ways to avoid code duplication here. One way is to delegate this work to a new function. YMMV :)

Second, I'd like the grep-based check to be stricter (i.e. more correct and less prone to false positives):

  • include file:// in the regexp
  • use --line-regexp

Also available in: Atom PDF