Files
cdba/shell/cdba-shell
Dmitry Baryshkov 926ca248fd cdba-shell: set the CDBA_USER variable
Set and export the CDBA_USER variable to enable ACL in cdba-server.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-09-23 16:50:11 +03:00

16 lines
277 B
Bash
Executable File

#!/bin/sh
export CDBA_USER="$1"
cmd=${SSH_ORIGINAL_COMMAND%% *}
if [ "$cmd" = "git-upload-pack" -o "$cmd" = "git-receive-pack" ]; then
if grep -Fxq $CDBA_USER $HOME/admins ; then
exec sh -c "$SSH_ORIGINAL_COMMAND"
fi
echo Permission denied
exit 1
fi
exec cdba-server