Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make install uses absolute path without $(DEST) to delete files outside of the staging directory #1630

Closed
aryoda opened this issue Feb 2, 2024 · 4 comments · Fixed by #1633
Assignees
Labels

Comments

@aryoda
Copy link
Contributor

aryoda commented Feb 2, 2024

I have introduced a clean-up code in the Makefile to remove installed renamed files which could cause havoc when a new BiT version is installed via make install.

@uffe has now reported that make install may cause an unwanted side effect ("messing outside the staging dir"):

https://aur.archlinux.org/pkgbase/backintime#comment-954580

#clean-up installed old files that were renamed or moved in later BiT versions
rm -f /etc/dbus-1/system.d/net.launchpad.backintime.serviceHelper.conf
rm: cannot remove '/etc/dbus-1/system.d/net.launchpad.backintime.serviceHelper.conf': Permission denied
make: *** [Makefile:14: install] Error 1
@aryoda aryoda added the Bug label Feb 2, 2024
@aryoda aryoda self-assigned this Feb 2, 2024
@aryoda
Copy link
Contributor Author

aryoda commented Feb 2, 2024

The problematic part in qt/Makefile (generated via qt/configure) is:

backintime/qt/configure

Lines 150 to 154 in ffbf79c

# Migration
printf "\t#clean-up installed old files that were renamed or moved in later BiT versions\n" >> ${MAKEFILE}
printf "\trm -f /etc/dbus-1/system.d/net.launchpad.backintime.serviceHelper.conf\n" >> ${MAKEFILE}
printf "\trm -f \$(DEST)/share/backintime/plugins/qt4plugin.py\n" >> ${MAKEFILE}
addNewline

Makefile:

install:
	#clean-up installed old files that were renamed or moved in later BiT versions
	rm -f /etc/dbus-1/system.d/net.launchpad.backintime.serviceHelper.conf
	rm -f $(DEST)/share/backintime/plugins/qt4plugin.py

The problem is most probably only relevant if make is called a different installation destination (make DESTDIR=... install) where DESTDIR is part of $(DEST) then in the Makefile.

I suggest to change this line from

printf "\trm -f /etc/dbus-1/system.d/net.launchpad.backintime.serviceHelper.conf\n" >> ${MAKEFILE}

into

printf "\trm -f \$(DEST)/etc/dbus-1/system.d/net.launchpad.backintime.serviceHelper.conf\n" >> ${MAKEFILE}

@aryoda
Copy link
Contributor Author

aryoda commented Feb 2, 2024

I have prepared a fix (PR #1633) and tested it with make DESTDIR="/home/user/temp/bit" install before and after the fix and it works now (though using a DESTDIR makes it impossible to delete the installed file but this is the responsibility of the package maintainer then).

@ptilopteri
Copy link

ptilopteri commented Feb 2, 2024 via email

@aryoda
Copy link
Contributor Author

aryoda commented Feb 2, 2024

  • aryoda @.> [02-02-24 11:53]:
    I have prepared a fix (PR Fix #1630 (make install tries to remove old file using absolute path) #1633) and tested it with make DESTDIR="/home/user/temp/bit" install before and after the fix and it works now (though using a DESTDIR makes it impossible to delete the installed file but this is the responsibility of the package maintainer then). Message ID: @.
    >
ModuleNotFoundError: No module named 'pyfakefs'

@ptilopteri

I had this unit test failure too.

It is a build/test dependency and you need to install python311-pyfakefs (or whichever python version you are using)

**Edit: ** Our dependencies are documented here but we do not provide distro packages so the package names are listed only for Debian and you need to find the corresponding OpenSuse package somehow...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants