Bug 17354 - Security-Update deaktiviert apache2 und umc durch dpkg-statoverride
Security-Update deaktiviert apache2 und umc durch dpkg-statoverride
Status: CLOSED DUPLICATE of bug 17124
Product: UCS
Classification: Unclassified
Component: UMC - Software update
UCS 2.3
i386 Linux
: P5 critical (vote)
: ---
Assigned To: Bugzilla Mailingliste
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-14 12:24 CET by Philipp Hahn
Modified: 2017-09-15 14:06 CEST (History)
1 user (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:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
hahn: Patch_Available+


Attachments
Fix shell escaping error (1.23 KB, patch)
2010-01-14 17:54 CET, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2010-01-14 12:24:47 CET
Spielt man über die UMC -> Online-Updates das Security-Update 2.3-0-1 ein, funktioniert danach der Apache2 und UMC nicht mehr!
In ucs/base/univention-updater/modules/univention/management/console/handlers/update/__init__.py wird zum Einspielen folgender at-Job gestartet:

#!/bin/sh
# atrun uid=0 gid=0
# mail root 0
umask 22
PATH=/sbin:/bin:/usr/sbin:/usr/bin; export PATH
PWD=/etc/runit/univention-management-console-server; export PWD
SHLVL=1; export SHLVL
cd /etc/runit/univention\-management\-console\-server || {
	 echo 'Execution directory inaccessible' >&2
	 exit 1
}

dpkg-statoverride --add root root 0644 /usr/sbin/univention-management-console-server
dpkg-statoverride --add root root 0644 /usr/sbin/apache2
chmod -x /usr/sbin/univention-management-console-server /usr/sbin/apache2
univention-security-update net
if [ 0 -eq 0 ]; then
	univention-config-registry set update/reboot/required=yes
fi
dpkg-statoverride --remove /usr/sbin/univention-management-console-server
dpkg-statoverride --remove /usr/sbin/apache2
chmod +x /usr/sbin/univention-management-console-server /usr/sbin/apache2

Dieser bricht nach "univention-security-update net" aus unbekanntem Grund ab, so daß die Dateirechte danach falsch sind!

+ dpkg-statoverride --add root root 0644 /usr/sbin/univention-management-console-server
+ dpkg-statoverride --add root root 0644 /usr/sbin/apache2
+ chmod -x /usr/sbin/univention-management-console-server /usr/sbin/apache2
+ univention-security-update net
Update to Security Update 2.3-sec1
Comment 1 Philipp Hahn univentionstaff 2010-01-14 14:24:58 CET
Was mir gerade auffällt:
Das angegebene at-Skript wurde per /proc/$PID/fd/0 kopiert. Da es in Python per
  p1 = subprocess.Popen(['echo "%s" | at now' % script], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
erzeugt wurde, wurde das '$?' bereits bei der Generierung ausgewertet! Da muß auf jeden Fall das Quoting angepasst werden.
Comment 2 Philipp Hahn univentionstaff 2010-01-14 17:54:35 CET
Created attachment 2223 [details]
Fix shell escaping error

Bei 'echo "%s" | at now' passiert folgendes:
1. Es wird eine Shell gestartet, in der "%s" expandiert wird. Damit wird schon zu diesem Zeitpunkt das '$?' ausgewertet
2. 'at' generiert eine Datei, die der 'atd' PER PIPE (!) an eine Shell füttert, sowas wie 'cat | bash'
3. univention-security-update oder einer seiner Sub-Prozesse liest von STDIN und liest damit das Skript weg
4. Nach der Rückkehr von u-s-u ist die Shell schon am Dateiende angekommen, hat nichts mehr zu tun und beendet sich.
Comment 3 Stefan Gohmann univentionstaff 2010-01-15 06:56:45 CET
Das Problem sollte eigentlich bereits mit Bug #17124 gelöst sein. Wenn nicht, dann den Bug wieder öffnen.

*** This bug has been marked as a duplicate of bug 17124 ***
Comment 4 Stefan Gohmann univentionstaff 2017-09-15 14:06:27 CEST
Set status of old resolved issues to closed.