The gnome-initial-setup-copy-worker never seems to have the correct permissions to copy from /run/gnome-initial-setup go a users ~/.config

Bug #2059121 reported by Matthew Hagemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-initial-setup (Ubuntu)
New
Undecided
Unassigned

Bug Description

There is a check in the copy worker that looks to see if the user running the copy worker owns the files it is trying to copy

```
if (!g_file_query_exists (src, NULL) ||
    !file_is_ours (src))
  exit (EXIT_SUCCESS);
```

From all my testing, the copy worker will always run as a newly created user, and thus not own the file in /run/gnome-initial-setup and always exit here.

My workaround in provd is to update the ownership of the file in /run/gnome-initial-setup to the newly created user before booting into their session, allowing this check to pass.

Without this workaround, several settings applied in the gnome-initial-setup new user flow (mainly a11y) are not persisted to the new user after the gis process concludes.

ProblemType: Bug
DistroRelease: Ubuntu 23.10
Package: gnome-initial-setup 45.0-1ubuntu3 [modified: usr/share/applications/gnome-initial-setup.desktop]
ProcVersionSignature: Ubuntu 6.5.0-26.26-generic 6.5.13
Uname: Linux 6.5.0-26-generic x86_64
ApportVersion: 2.28.0-0ubuntu1
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Tue Mar 26 14:31:52 2024
InstallationDate: Installed on 2024-03-02 (24 days ago)
InstallationMedia: Ubuntu 23.10.1 "Mantic Minotaur" - Release amd64 (20231016.1)
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/usr/bin/zsh
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: gnome-initial-setup
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Matthew Hagemann (matt-hagemann) wrote :
description: updated
description: updated
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Hi Matt, what do you mean with "the file in /run/gnome-initial-setup"? The code you quote is checking for the home directory of the user owning the process.

Revision history for this message
Matthew Hagemann (matt-hagemann) wrote :

Hi Nathan :)

Sorry, I meant folder, not file.

The code is checking the ownership of the home directory of gnome-initial-setup which is /run/gnome-initial-setup, which is where the files we are trying to copy live:

```
src = g_file_new_for_path (initial_setup_homedir);

if (!g_file_query_exists (src, NULL) ||
    !file_is_ours (src))
  exit (EXIT_SUCCESS);
```

They are all owned by the gnome-initial-setup user:

```
root@matt-pc-q35-8-0:/run/gnome-initial-setup# ls -ld .
drwx------ 6 gnome-initial-setup nogroup 120 Mar 27 16:49 .
root@matt-pc-q35-8-0:/run/gnome-initial-setup# ls -la .
total 0
drwx------ 6 gnome-initial-setup nogroup 120 Mar 27 16:49 .
drwxr-xr-x 36 root root 920 Mar 27 16:49 ..
drwx------ 6 gnome-initial-setup nogroup 120 Mar 27 16:49 .cache
drwx------ 6 gnome-initial-setup nogroup 140 Mar 27 16:49 .config
drwx------ 4 gnome-initial-setup nogroup 80 Mar 27 16:49 .local
drwx------ 3 gnome-initial-setup nogroup 60 Mar 27 16:49 snap

```

If I have understood the problem correctly:

The gnome-intial-setup-copy-worker is started in a user session, so it will be running as that user, not as the gnome-initial-setup user, and fail that check, preventing those files from being copied:

https://salsa.debian.org/gnome-team/gnome-initial-setup/-/blob/debian/latest/data/gnome-initial-setup-copy-worker.service.in?ref_type=heads

https://salsa.debian.org/gnome-team/gnome-initial-setup/-/blob/debian/latest/data/gnome-initial-setup-copy-worker.desktop.in.in?ref_type=heads

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.