Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
2560deec1e | |||
Jérémy Lecour | d01286e0b9 | ||
Jérémy Lecour | 2f2e723bc0 |
|
@ -15,6 +15,12 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
|
|||
|
||||
### Security
|
||||
|
||||
## [23.10.1] - 2023-10-09
|
||||
|
||||
### Fixed
|
||||
|
||||
* Use a special variable name since USER is always defined from the environment
|
||||
|
||||
## [23.10] - 2023-10-09
|
||||
|
||||
### Added
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
VERSION="23.10"
|
||||
VERSION="23.10.1"
|
||||
|
||||
show_version() {
|
||||
cat <<END
|
||||
|
@ -122,8 +122,8 @@ get_now() {
|
|||
}
|
||||
|
||||
get_user() {
|
||||
if [ -n "${USER}" ]; then
|
||||
echo "${USER}"
|
||||
if [ -n "${FORCE_USER}" ]; then
|
||||
echo "${FORCE_USER}"
|
||||
else
|
||||
logname
|
||||
fi
|
||||
|
@ -399,7 +399,7 @@ AUTO=${AUTO:-"0"}
|
|||
EVOCHECK=${EVOCHECK:-"0"}
|
||||
GIT_STATUS_MAX_LINES=${GIT_STATUS_MAX_LINES:-20}
|
||||
API_ENDPOINT=${API_ENDPOINT:-""}
|
||||
USER=${USER:-""}
|
||||
FORCE_USER=${FORCE_USER:-""}
|
||||
|
||||
# initialize variables
|
||||
MESSAGE=""
|
||||
|
@ -481,12 +481,12 @@ while :; do
|
|||
# Deprecated, backward compatibility
|
||||
# author change as autosysadmin
|
||||
printf 'WARNING: "--autosysadmin" is deprecated, use "--user autosysadmin".\n' >&2
|
||||
USER="autosysadmin"
|
||||
FORCE_USER="autosysadmin"
|
||||
;;
|
||||
-u|--user)
|
||||
# user options, with value speparated by space
|
||||
if [ -n "$2" ]; then
|
||||
USER=$2
|
||||
FORCE_USER=$2
|
||||
shift
|
||||
else
|
||||
printf 'ERROR: "--user" requires a non-empty option argument.\n' >&2
|
||||
|
@ -495,7 +495,7 @@ while :; do
|
|||
;;
|
||||
--user=?*)
|
||||
# message options, with value speparated by =
|
||||
USER=${1#*=}
|
||||
FORCE_USER=${1#*=}
|
||||
;;
|
||||
--user=)
|
||||
# message options, without value
|
||||
|
@ -581,7 +581,7 @@ GIT_REPOSITORIES="/etc /etc/bind /usr/share/scripts"
|
|||
|
||||
# Add /etc directories from lxc containers if they are git directories
|
||||
if [ -d /var/lib/lxc ]; then
|
||||
GIT_REPOSITORIES="${GIT_REPOSITORIES} $(find /var/lib/lxc/ -maxdepth 3 -name 'etc' | tr '\n' ' ' | sed 's/[[:space:]]\+$//')"
|
||||
GIT_REPOSITORIES="${GIT_REPOSITORIES} $(find -L /var/lib/lxc/ -maxdepth 3 -name 'etc' | tr '\n' ' ' | sed 's/[[:space:]]\+$//')"
|
||||
fi
|
||||
|
||||
# initialize variable
|
||||
|
|
Loading…
Reference in a new issue