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

[backup/restore] unescaped environment variables #894

Closed
shutterfreak opened this issue Mar 19, 2019 · 1 comment · Fixed by #1018
Closed

[backup/restore] unescaped environment variables #894

shutterfreak opened this issue Mar 19, 2019 · 1 comment · Fixed by #1018

Comments

@shutterfreak
Copy link
Contributor

The backup script doesn't escape some environment variables when invoked without arguments. See https://community.openhab.org/t/backup-restore-scripts-for-linux-and-macos/34491/44?u=shutterfreak

Offending code:

    echo "Set $OPENHAB_BACKUPS to change the default backup directory."
    echo "Set $OPENHAB_BACKUPS_TEMP to change the default backup temporary directory."

Suggested fix:

    echo "Default backup directory: '$OPENHAB_BACKUPS'"
    echo "Set \$OPENHAB_BACKUPS to change the default backup directory."
    echo "Default backup temporary directory: '$OPENHAB_BACKUPS_TEMP'"
    echo "Set \$OPENHAB_BACKUPS_TEMP to change the default backup temporary directory."

I'd also add that the backup script must be run as root (can be checked with $UID (0 for root) when the script is run without arguments.

@shutterfreak
Copy link
Contributor Author

Can't get to comply with DCO checks in my PR though.

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

Successfully merging a pull request may close this issue.

1 participant