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>
This commit is contained in:
Dmitry Baryshkov
2023-07-08 17:12:21 +03:00
parent 5164ca9234
commit 926ca248fd

4
shell/cdba-shell Normal file → Executable file
View File

@@ -1,10 +1,10 @@
#!/bin/sh
user=$1
export CDBA_USER="$1"
cmd=${SSH_ORIGINAL_COMMAND%% *}
if [ "$cmd" = "git-upload-pack" -o "$cmd" = "git-receive-pack" ]; then
if grep -Fxq $user $HOME/admins ; then
if grep -Fxq $CDBA_USER $HOME/admins ; then
exec sh -c "$SSH_ORIGINAL_COMMAND"
fi