Bug 45440 - (ucs-test) Rejoin of UCS@school 4.2 slave purges GPOs from LDAP
(ucs-test) Rejoin of UCS@school 4.2 slave purges GPOs from LDAP
Status: RESOLVED WONTFIX
Product: UCS@school
Classification: Unclassified
Component: ucs-test
UCS@school 4.2
Other Linux
: P5 major (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on: 45439 45452
Blocks:
  Show dependency treegraph
 
Reported: 2017-09-22 15:05 CEST by Florian Best
Modified: 2020-07-14 11:17 CEST (History)
4 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2017-09-22 15:05:29 CEST
At least the large environment jenkins test should have a test for assigning GPOs and doing a rejoin.

+++ This bug was initially created as a clone of Bug #45439 +++

The joinscript 97univention-s4-connector.inst of UCS 4.2 seems to contain defect logic when syncing GPOs during (re)join of UCS@school slaves.

The relevant part of 97univention-s4-connector.inst looks like this:

if ! is_ucr_true 'connector/s4/allow/secondary'; then
    s4connector_dc=$(get_available_s4connector_dc) || exit $?

fi
if [ -z "$s4connector_dc" ] \
    || [ "$s4connector_dc" = "$hostname" ]; then

    if [ $JS_LAST_EXECUTED_VERSION -le 0 ] && is_ucr_true connector/s4/mapping/gpo; then
        /etc/init.d/univention-s4-connector stop

        if [ -z "$s4connector_dc" ] \
            || [ "$s4connector_dc" = "$hostname" ]; then
            # First or only Sama 4 server
            /usr/share/univention-s4-connector/msgpo.py --write2ucs "$@"
        elif ! is_ucr_true 'connector/s4/allow/secondary'; then
            # Normal Samba 4 DC
            /usr/share/univention-s4-connector/msgpo.py --write2ucs "$@"
        else
            # Slave PDC
            /usr/share/univention-s4-connector/msgpo.py --write2samba4 "$@"
        fi
    fi
fi

In school environments on the school slave connector/s4/allow/secondary=yes ist set, therefore s4connector_dc is not set. Even if the UCRV is not set or set to "no", the hostname of the school slave is stored in s4connector_dc via  get_available_s4connector_dc().
So the condition [ -z "$s4connector_dc" ] || [ "$s4connector_dc" = "$hostname" ]
is always met and therefore the branch "First or only Sama 4 server" is always executed on UCS@school slaves, which results in a
/usr/share/univention-s4-connector/msgpo.py --write2ucs "$@"

In UCS 4.1-4 the query for the s4connector host looked quite different:

        s4connectorservicehost_dns="$(univention-directory-manager computers/computer list "$@" --filter "(&(univentionService=${NAME})(!(cn=$hostname)))" | sed -ne 's|^DN: ||p')"

        if [ -z "$s4connectorservicehost_dns" ]; then
            # First Sama 4 server
            /usr/share/univention-s4-connector/msgpo.py --write2ucs "$@"
        elif ! is_ucr_true 'connector/s4/allow/secondary'; then
            # Normal Samba 4 DC
            /usr/share/univention-s4-connector/msgpo.py --write2ucs "$@"
        else
            # Slave PDC
            /usr/share/univention-s4-connector/msgpo.py --write2samba4 "$@"
        fi
Comment 1 Stefan Gohmann univentionstaff 2017-09-28 08:42:17 CEST
We decided to create a new Jenkins Multienv Job "UCSschool 4.2 Setup Jobs" where we could add job for checking single setup environments. In this case, the setup process will create gpo links and it will be checked whether the gpo link is overwritten. Additionally, the ucs-test-checks will be executed.
Comment 2 Michel Smidt 2020-07-14 11:17:43 CEST
This issue has been filed against UCS@school 4.2.

UCS@school 4.2 is out of maintenance and many UCS@school components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS@school versions, please reopen it and update the UCS@school version. In this case please provide detailed information on how this issue is affecting you.