Bug #17201

Nautilus Bookmarks Tor Browser infinite add

Added by op_mb 2019-10-31 07:59:47 . Updated 2020-03-22 06:51:40 .

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

100%

Feature Branch:
Type of work:
Code
Blueprint:

Starter:
1
Affected tool:
Deliverable for:

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


Files


Subtasks


History

#1 Updated by op_mb 2019-10-31 08:02:35

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 2019-10-31 11:10:28

  • Description updated
  • 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 2019-11-01 00:58:47

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 2019-11-01 20:16:04

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 2019-11-01 20:34:19

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 2019-11-02 06:07:43

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 Bug #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 2019-11-02 10:01:11

@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 2019-11-02 10:04:43

#9 Updated by op_mb 2019-11-02 10:35:40

@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 2019-11-02 14:37:19

> i dont have access, i cant edit anything

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

#11 Updated by op_mb 2019-11-03 04:42:04

  • 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 2019-11-03 04:43:43

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

#13 Updated by intrigeri 2019-11-10 16:11:57

  • 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 2019-11-28 19:39:47

  • 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

#15 Updated by CyrilBrulebois 2020-01-07 18:00:42

  • Target version changed from Tails_4.2 to Tails_4.3

#16 Updated by anonym 2020-02-11 15:26:17

  • Target version changed from Tails_4.3 to Tails_4.4

#17 Updated by CyrilBrulebois 2020-03-12 09:55:59

  • Target version changed from Tails_4.4 to Tails_4.5

#18 Updated by intrigeri 2020-03-22 06:51:40

  • Target version deleted (Tails_4.5)

(Please set a target version once you’ll submit an updated branch to review :)