YunoHost-Apps / borgserver_ynh

Borg server package for YunoHost
https://www.borgbackup.org/
GNU Affero General Public License v3.0
9 stars 5 forks source link

Bad things can happen if admin choose an existing ssh user #14

Closed autra closed 4 years ago

autra commented 4 years ago

Description

If someone installs this app and choose an existing user as ssh user, it will attempt a userdel on remove (either by removing this app manually, or because the installation fails).

I propose to:

WDYT?

autra commented 4 years ago

Actually I realised that the script did fail if the user already exists. But then the remove script is executed to cleanup, which tries to userdel.

In this case, we want to cleanup, but avoid the userdel command if the reason we are cleaning up is because the user wasn't correctly chosen. Not sure how to achieve that tough.

zamentur commented 4 years ago

Thanks for reporting this Fixed with https://github.com/YunoHost-Apps/borgserver_ynh/pull/22

zamentur commented 4 years ago

Thanks for reporting this, it's fixed with https://github.com/YunoHost-Apps/borgserver_ynh/pull/24

narFnarF commented 2 months ago

Seems like the issue still occurs

How to reproduce:

  1. Install app using user "toto"
  2. Try to install the app again with the same user "toto"
  3. The install will fail and will undo the install

Current result: User "toto" gets deleted along with the app.

Expected result: borg_server is removed but user "toto" is kept.