Skip to content

Commit

Permalink
Fix mkproject
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-ntrf committed Dec 18, 2023
1 parent fffeed7 commit d72ab3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions site/profile/templates/accounts/mkproject.sh.epp
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ while read CONN OP GROUP; do

# We support three operations : ADD, MOD or DEL
if [[ "$OP" == "ADD" ]]; then
mkproject $GROUP <%= $with_folder %>
mkproject $GROUP <%= $manage_folder %>
elif [[ "$OP" == "MOD" ]]; then
# One or more groups have been modified
# We grep the log for all operations related to request $CONN that contain a uid
USERNAMES=$(grep -oP "conn=${CONN} op=[0-9]* SRCH base=\"uid=\K([a-z0-9A-Z_-]*)(?=,cn=users)" /var/log/dirsrv/slapd-*/access | sort | uniq)
# We grep all unique groups that have been modified
MOD_GROUPS=$(grep -oP "conn=${CONN} op=[0-9]* MOD dn=\"cn=\K${PROJECT_REGEX}" /var/log/dirsrv/slapd-*/access | uniq)
for GROUP in $MOD_GROUPS; do
modproject $GROUP <%= $with_folder %> $USERNAMES
modproject $GROUP <%= $manage_folder %> $USERNAMES
done
elif [[ "$OP" == "DEL" ]]; then
delproject $GROUP <%= $with_folder %>
delproject $GROUP <%= $manage_folder %>
fi
PREV_CONN="$CONN"
done

0 comments on commit d72ab3c

Please sign in to comment.