cloud mode can overwrite /etc/defaults/landscape-client and thus lose the non-root mode username

Bug #403754 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
Low
Thomas Herve

Bug Description

The landscape-client initscript, when in cloud mode, overwrites /etc/defaults/landscape-client:

if [ $RUN -eq 0 ]; then
    if [ $CLOUD -eq 1 ]; then
        if landscape-is-cloud-managed; then
            # Install the cloud default configuration file
            cp /usr/share/landscape/cloud-default.conf /etc/landscape/client.conf
            # Override default file for not going in this conditional again at
            # next startup
            echo "RUN=1" > $LANDSCAPE_DEFAULTS

That file, however, can also contain the name of the user to run as when in non-root mode, so the above echo would destroy that. It will also overwrite its own CLOUD=x setting in that file.

I suggest something like the following to change the RUN variable without touching the rest of the file:

sed -i "s/^RUN=.*/RUN=1/" $LANDSCAPE_DEFAULTS

Changed in landscape-client:
importance: Undecided → Low
milestone: none → 1.3.4
Thomas Herve (therve)
Changed in landscape-client:
assignee: nobody → Thomas Herve (therve)
milestone: 1.3.4 → 1.3.5
Revision history for this message
Thomas Herve (therve) wrote :

Fixed in r137.

Changed in landscape-client:
status: New → Fix Committed
tags: added: needs-testing
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Confirmed this is in staging.

tags: removed: needs-testing
Changed in landscape-client:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.