xdg-user-dirs-update does not take care of $HOME

Bug #1754356 reported by Marco Trevisan (Treviño)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xdg-user-dirs (Ubuntu)
Fix Released
High
Marco Trevisan (Treviño)
Xenial
Fix Released
Undecided
Marco Trevisan (Treviño)

Bug Description

[ Impact ]

When setting an user dir to a folder that is subfolder of $HOME (and when $HOME does not match the /etc/passwd defined home for the user), the ~/.config/user-dirs.dirs is wrongly generated.

[ Test case ]

 1) env HOME=/tmp/temp-home xdg-user-dirs-update
 2) find /tmp/temp-home/
 3) should list generated XDG user directories
 4) /tmp/temp-home/.config/user-dirs.dirs should mention them

Launching something like:
 - env HOME=/tmp/temp-home ./xdg-user-dirs-update --set DOWNLOADS "/tmp/temp-home/sub/folder/of/it/Downloads"

Should modify /tmp/temp-home/.config/user-dirs.dirs so that it contains:
  XDG_DOWNLOADS_DIR="$HOME/sub/folder/of/it/Downloads"

[ Regression potential ]

Xdg folders could be generated in wrong locations.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :
tags: added: patch
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "xenial SRU debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

Jeremy Bícha (jbicha)
Changed in xdg-user-dirs (Ubuntu Xenial):
status: New → Triaged
Revision history for this message
Iain Lane (laney) wrote :

xenial is uploaded, for bionic I asked for a review from seb128 which is pending and I'll upload shortly

Changed in xdg-user-dirs (Ubuntu Xenial):
status: Triaged → In Progress
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdg-user-dirs - 0.17-1ubuntu1

---------------
xdg-user-dirs (0.17-1ubuntu1) bionic; urgency=low

  * Merge with Debian. Remaining change:
    - Add launchpad_translation_export.patch:
      + update translations from Launchpad
  * Fixes xdg-user-dirs-update not respecting $HOME (LP: #1754356), thanks
    Trevinho.

xdg-user-dirs (0.17-1) unstable; urgency=medium

  * New upstream release (LP: #1754356)
  * Update Vcs fields for migration to https://salsa.debian.org/

xdg-user-dirs (0.16-1) unstable; urgency=medium

  * New upstream release
  * Drop 01_add-autostart-file.patch: Applied in new release
  * Update Vcs fields for conversion to git
  * Add debian/gbp.conf
  * Bump Standards-Version to 4.1.2
  * Bump debhelper compat to 11

 -- Iain Lane <email address hidden> Fri, 23 Mar 2018 15:58:57 +0000

Changed in xdg-user-dirs (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Marco, or anyone else affected,

Accepted xdg-user-dirs into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/xdg-user-dirs/0.15-2ubuntu6.16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in xdg-user-dirs (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-xenial
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Can confirm it works.

marco@tricky:/tmp:✓ $ apt-cache policy xdg-user-dirs
xdg-user-dirs:
  Installato: 0.15-2ubuntu6.16.04.1
  Candidato: 0.15-2ubuntu6.16.04.1
  Tabella versione:
 *** 0.15-2ubuntu6.16.04.1 100

Before upgrading:

marco@tricky:/tmp:✓ $ env HOME=/tmp/temp-home xdg-user-dirs-update
marco@tricky:/tmp:✓ $ find /tmp/temp-home/
find: '/tmp/temp-home': No such file or directory

After:

marco@tricky:/tmp:✓ $ env HOME=/tmp/temp-home xdg-user-dirs-update
marco@tricky:/tmp:✓ $ find temp-home/
temp-home/
temp-home/Video
temp-home/Modelli
temp-home/.config
temp-home/.config/user-dirs.locale
temp-home/.config/user-dirs.dirs
temp-home/Documenti
temp-home/Immagini
temp-home/Scaricati
temp-home/Pubblici
temp-home/Scrivania
temp-home/Musica

marco@tricky:/tmp:✓ $ env HOME=/tmp/temp-home xdg-user-dirs-update --set DOWNLOADS \
                     "/tmp/temp-home/sub/folder/of/it/Downloads"
marco@tricky:/tmp:✓ $ cat temp-home/.config/user-dirs.dirs
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Scrivania"
XDG_DOWNLOAD_DIR="$HOME/Scaricati"
XDG_TEMPLATES_DIR="$HOME/Modelli"
XDG_PUBLICSHARE_DIR="$HOME/Pubblici"
XDG_DOCUMENTS_DIR="$HOME/Documenti"
XDG_MUSIC_DIR="$HOME/Musica"
XDG_PICTURES_DIR="$HOME/Immagini"
XDG_VIDEOS_DIR="$HOME/Video"
XDG_DOWNLOADS_DIR="$HOME/sub/folder/of/it/Downloads"

tags: added: verification-done verification-done-xenial
removed: verification-needed verification-needed-xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdg-user-dirs - 0.15-2ubuntu6.16.04.1

---------------
xdg-user-dirs (0.15-2ubuntu6.16.04.1) xenial; urgency=medium

  * debian/patches/xdg-user-dirs-update-give-priority-to-HOME.patch:
    - use $HOME as preferred before using getpw (LP: #1754356)

 -- Marco Trevisan (Treviño) <email address hidden> Fri, 23 Mar 2018 16:16:45 +0000

Changed in xdg-user-dirs (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for xdg-user-dirs has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.