package gitolite3 3.6.11-2 failed to install/upgrade: installed gitolite3 package post-installation script subprocess returned error exit status 1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gitolite3 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Attempt to install gitolite3 fails.
Directory path set in debconf for gitolite3/adminkey prior to install attempt.
ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: gitolite3 3.6.11-2
ProcVersionSign
Uname: Linux 5.10.0-1034-oem x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckM
CasperMD5CheckR
Date: Mon Jul 5 07:05:53 2021
ErrorMessage: installed gitolite3 package post-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2021-07-05 (0 days ago)
InstallationMedia: Ubuntu-Server 20.04.2 LTS "Focal Fossa" - Release amd64 (20210627)
PackageArchitec
Python3Details: /usr/bin/python3.8, Python 3.8.10, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: N/A
RelatedPackageV
dpkg 1.19.7ubuntu3
apt 2.0.6
SourcePackage: gitolite3
Title: package gitolite3 3.6.11-2 failed to install/upgrade: installed gitolite3 package post-installation script subprocess returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)
tags: | removed: need-duplicate-check |
It looks like the root cause of this issue is that the post-install script uses the mktemp command when the current user is root and the default Ubuntu configuration sets $TMPDIR to /tmp/user/uid# so the temporary file that gets created is in /tmp/user/0. Later, the script switches to the gitolite3 user and tries to read the file that was created with mktemp (as the gitolite3 user, but that read fails because the gitolite3 user doesn't have permission to navigate the parent directories of the file. Changing permissions on the parent directories is a security problem, so the best solution is probably to set the $TMPDIR environment variable to some world-readable directory, such as /tmp, at the start of the post-install script. So, a one-line addition to the debian/postinst script probably fixes the issue.