deluser --backup fails because tar --no-unquote option should be used

Bug #1738673 reported by jimav
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
adduser (Ubuntu)
New
Undecided
Unassigned

Bug Description

deluser --backup --remove-home (or --remove-all-files) USER
aborts if it encounters certain file names, for example the ubiquitous
'C:\nppdf32Log\debuglog.txt' left in Linux home directories by Firefox.

The root cause is that 'tar' helpfully "interprets escape sequences" in its filename arguments, so file names containing a backslash followed by 'n' are changed to contain a newline character, and other similar cases.

The tar --no-unquote option prevents this. So 'deluser' should pass --no-unquote to 'tar' when creating the backup archive.

I'll attach a demo/regression-test script, but in brief:

STEPS TO REPRODUCE:

1. touch '/home/testuser/C:\nppdf32Log\debuglog.txt'
2. deluser --backup --remove-home testuser

RESULTS:

/bin/tar: /home/.../C\:\nppdf32Log\\debuglog.txt: Cannot stat: No such file or directory
(deluser aborts without doing anything except creating an empty archive file)

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: adduser 3.113+nmu3ubuntu5
ProcVersionSignature: Ubuntu 4.13.0-19.22-generic 4.13.13
Uname: Linux 4.13.0-19-generic x86_64
ApportVersion: 2.20.7-0ubuntu3.6
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Sun Dec 17 15:20:16 2017
InstallationDate: Installed on 2017-12-13 (4 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20171018)
PackageArchitecture: all
SourcePackage: adduser
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
jimav (james-avera) wrote :
Revision history for this message
jimav (james-avera) wrote :
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.