Bug 31683 - No connection to LDAP server causes image to be always mounted read-writeable
No connection to LDAP server causes image to be always mounted read-writeable
Status: CLOSED FIXED
Product: Univention Corporate Client (UCC)
Classification: Unclassified
Component: initrd
unspecified
Other Linux
: P5 normal
: UCC 2.0
Assigned To: Erik Damrose
Felix Botner
: interim-3
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-10 12:03 CEST by Erik Damrose
Modified: 2014-12-10 12:09 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
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:
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 Erik Damrose univentionstaff 2013-06-10 12:03:07 CEST
The initramfs script ucc mounts the image RO or RW depending on several options. To get the correct setting it calls the script get_boot_mount_option.sh. This script checks the LDAP for a value, then the local ucr config, and returns 'RW' if nothing is configured otherwise.

The script however is executed with 'bash -e'. When trying to determine the LDAP value (by calling univention-ucc-boot-option) and the LDAP server cannot be reached (Because it is down, or because the local network is down, ...), univention-ucc-boot-option exits with an error value, which causes the shellscript to terminate immediately.

get_boot_mount_option.sh should not be started with bash -e.
Comment 1 Stefan Gohmann univentionstaff 2013-06-17 06:31:47 CEST
(In reply to Erik Damrose from comment #0)
> get_boot_mount_option.sh should not be started with bash -e.

The error could be handled and then bash -e is OK. I think we should use bash -e in these scripts, since we do a lot of stuff which can break the installation for example the partitioning or the detection if the partition should be repeated.
Comment 2 Erik Damrose univentionstaff 2014-04-28 17:14:15 CEST
univention-ucc-boot-option returns the requested value if everything works fine, and an error string otherwise. 
get_boot_mount_option.sh should always return something sensible, as its output is directly used for a variable value in the initramfs. 

The script now catches the following errors:
- univention-ucc-boot-option aborts with an error
- the UCR variable ucc/boot/mount is not set

The errors are logged to stderr.

If both errors occur, 'rw' is returned as a last resort. This is how the script should have worked to begin with.

r49671 univention-ucc-initramfs 3.0.0-17
r49672 Changelog
Comment 3 Felix Botner univentionstaff 2014-05-07 11:27:56 CEST
Works for tc (ro if ldap is available or not) and desktop image (rw if ldap is available or not).
Comment 4 Moritz Muehlenhoff univentionstaff 2014-06-12 09:19:46 CEST
UCC 2.0 has been released:
 http://docs.univention.de/release-notes-ucc-2.0.html

If this error occurs again, please use "Clone This Bug".