Bug 18444 - Fehlendes Escaping für eval "$(ucr shell)" — ucs-test
Fehlendes Escaping für eval "$(ucr shell)" — ucs-test
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: ucslint
UCS 4.1
All Linux
: P4 normal (vote)
: ---
Assigned To: UCS maintainers
:
Depends on:
Blocks: 18594
  Show dependency treegraph
 
Reported: 2010-05-20 10:51 CEST by Sönke Schwardt-Krummrich
Modified: 2019-01-03 07:22 CET (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:
hahn: Patch_Available+


Attachments
ucs-test-Skript für eval "$(ucr shell)" (2.37 KB, text/plain)
2010-05-25 08:06 CEST, Philipp Hahn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2010-05-20 10:51:28 CEST
Es sollte ein ucs-test-Modul dafür geben.

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

In vielen Skripten wird nur
 eval $(ucr shell)
statt
 eval "$(ucr shell)"
verwendet. Dies führt dazu, daß nach der Expansion von "ucr shell" die
Variablenzuweisungen nochmals durch die Shell expandiert werden. Das folgende
Beispiel zeigt das Problem:
# echo *
sources.list
# ucr set test="* * *"
Create test
# ucr shell test
test="* * *"
# eval $(ucr shell test)
# echo "$test"
* sources.list *
# eval "$(ucr shell test)"
# echo "$test"
* * *

Das ist insbesondere UCR-Variablen mit Shell-Metazeichen kritisch:
# ucr search --brief --value '[*?$`]'
ldap/connection/check: */3 * * * *
ldap/policy/cron: 5 * * * *
mrtg/cron: */15 * * * *

Siehe Bug #8417 Comment 7 für weitere Informationen.
Ggf. ist Bug #17269 auch auf diese Problematik zurückzuführen.

Alle Skripte sollten korrigiert werden und ggf. ein ucs-test-Test oder
ucs-lint-Check eingebaut werden, der fehlerhaften Verwendung anprangert.
Comment 1 Philipp Hahn univentionstaff 2010-05-25 08:06:54 CEST
Created attachment 2417 [details]
ucs-test-Skript für eval "$(ucr shell)"

Für "univention-config-registry shell" und "univention-policy-result -s"
Comment 2 Stefan Gohmann univentionstaff 2012-07-18 06:53:44 CEST
Gibt es dafür nicht bereits eine ucslint Prüfung?
Comment 3 Philipp Hahn univentionstaff 2012-07-18 09:21:22 CEST
(In reply to comment #2)
> Gibt es dafür nicht bereits eine ucslint Prüfung?

Ja, für UCR; aber nur in Join-Skripten und debian/*{pre,post}{inst,rm}:
0001-CheckJoinScript.py
0006-CheckPostinst.py

Was fehlt ist univention-policy-result und der Test in allen Programmen.
Comment 4 Stefan Gohmann univentionstaff 2012-10-10 08:43:11 CEST
Kein Blocker für das 3.1 Release.
Comment 5 Stefan Gohmann univentionstaff 2019-01-03 07:22:35 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.