Bug 39045

Summary: ssl/host/extensions example doesn't work
Product: UCS Reporter: Tim Petersen <petersen>
Component: SSLAssignee: Philipp Hahn <hahn>
Status: CLOSED FIXED QA Contact: Janek Walkenhorst <walkenhorst>
Severity: normal    
Priority: P5 CC: gohmann, grandjean, hahn
Version: UCS 4.0   
Target Milestone: UCS 4.1-2-errata   
Hardware: Other   
OS: Linux   
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:

Description Tim Petersen univentionstaff 2015-07-30 11:23:57 CEST
The example uses something like:
hostname=${fqdn/.*/}

This does not work in dash (which is used there via /bin/sh symlink if executed via listener).

We could either identify why this is executed with /bin/sh (dash) or adjust the example to something ugly like:
hostname=$(echo $fqdn | cut -d "." -f1)

;)
Comment 1 Tim Petersen univentionstaff 2015-07-30 11:24:34 CEST
2015072821000494
Comment 2 Philipp Hahn univentionstaff 2015-08-11 15:56:42 CEST
(In reply to Tim Petersen from comment #0)
> The example uses something like:
> hostname=${fqdn/.*/}
> 
> This does not work in dash (which is used there via /bin/sh symlink if
> executed via listener).
> 
> We could either identify why this is executed with /bin/sh (dash) or adjust
> the example to something ugly like:
> hostname=$(echo $fqdn | cut -d "." -f1)

Use "${fqdn%%.*}", which is POSIX - no need for fork() / pipe() / ...

$ (fqdn=`hostname -f`;hostname=${fqdn%%.*};echo "fqdn=$fqdn hostname=$hostname";)
fqdn=stave.knut.univention.de hostname=stave
Comment 3 Philipp Hahn univentionstaff 2016-06-23 14:18:11 CEST
r70560 | Bug #39045 ssl: Fix extensions-example.sh to work with POSIX shell

Package: univention-ssl
Version: 10.0.0-12.169.201606231402
Branch: ucs_4.1-0
Scope: errata4.1-2

r70578 | Bug #39045 ssl: YAML
 univention-ssl.yaml
Comment 4 Janek Walkenhorst univentionstaff 2016-07-13 16:39:29 CEST
Code review: OK
Advisory: OK
Comment 5 Janek Walkenhorst univentionstaff 2016-07-21 15:16:08 CEST
<http://errata.software-univention.de/ucs/4.1/213.html>