Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[rpm] Fixed uninstall script
Some versions of busybox evaluate ~$u/x as / and expand the rm command
into rm -fr / if the account has / as its home directory :O
  • Loading branch information
monich committed Jul 20, 2022
1 parent 3f37abe commit 1f0b799
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rpm/openrepos-mybackup.spec
Expand Up @@ -42,8 +42,10 @@ desktop-file-install --delete-original \

%postun
if [ "$1" == 0 ] ; then
for u in $(getent passwd | cut -d: -f1); do
eval rm -fr ~$u/.local/share/openrepos-mybackup ||:
for d in $(getent passwd | cut -d: -f6) ; do
if [ "$d" != "" ] && [ "$d" != "/" ] && [ -d "$d/.local/share/openrepos-mybackup" ] ; then
rm -fr "$d/.local/share/openrepos-mybackup" ||:
fi
done
fi

Expand Down

0 comments on commit 1f0b799

Please sign in to comment.