Bug 48512 - /usr/share/univention-lib/ldap.sh ucs_registerLDAPExtension does not accept --packagename and --packageversion parameters
/usr/share/univention-lib/ldap.sh ucs_registerLDAPExtension does not accept -...
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 4.3
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-01-22 18:26 CET by Philipp Hahn
Modified: 2021-05-14 16:38 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
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
variables need to be (767 bytes, patch)
2019-01-22 18:26 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 2019-01-22 18:26:57 CET
Created attachment 9815 [details]
variables need to be

+ PKG=univention-ldap-server
+ dpkg-query -f ${Version} -W univention-ldap-server
+ VER=14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec
+ ucs_registerLDAPExtension --packagename univention-ldap-server --packageversion 14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec --schema /usr/share/univention-ldap/schema/univention-translog.schema
+ local SH_FUNCNAME
+ SH_FUNCNAME=ucs_registerLDAPExtension
+ package_options_are_passed --packagename univention-ldap-server --packageversion 14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec --schema /usr/share/univention-ldap/schema/univention-translog.schema
+ local opttemp
+ getopt -q -o  --longoptions packagename:,packageversion: --name ucs_registerLDAPExtension -- --packagename univention-ldap-server --packageversion 14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec --schema /usr/share/univention-ldap/schema/univention-translog.schema
+ opttemp= --packagename 'univention-ldap-server' --packageversion '14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec' -- '/usr/share/univention-ldap/schema/univention-translog.schema'
+ eval set --  --packagename 'univention-ldap-server' --packageversion '14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec' -- '/usr/share/univention-ldap/schema/univention-translog.schema'
+ set -- --packagename univention-ldap-server --packageversion 14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec -- /usr/share/univention-ldap/schema/univention-translog.schema
+ local package_name
+ local package_version
+ [ 6 -gt 0 ]
+ package_name=univention-ldap-server
+ shift 2
+ [ 4 -gt 0 ]
+ package_version=14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec
+ shift 2
+ [ 2 -gt 0 ]
+ shift
+ break
+ [ -n univention-ldap-server ]
+ [ -n 14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec ]
+ return 0
+ local rc
/usr/share/univention-ldap/setup-translog: 395: /usr/share/univention-ldap/setup-translog: package_name: parameter not set
Comment 1 Arvid Requate univentionstaff 2019-01-22 19:37:22 CET
Hmm, I used it jesterday and also there is this test case which uses it:

ucs-test/tests/71_udm-settings/51_register_data


We usually only use these two options for test purposes. When ucs_registerLDAPExtensio is called from a join or postinst script it will detect the values automatically. But the patch is good anyways.
Comment 2 Philipp Hahn univentionstaff 2019-01-23 11:18:46 CET
(In reply to Arvid Requate from comment #1)
> Hmm, I used it jesterday and also there is this test case which uses it:
> 
> ucs-test/tests/71_udm-settings/51_register_data

ldap.sh is not "set -u" safe.
It works by shear luck as "$@" is still passed on with contains those 2 parameters. 

> We usually only use these two options for test purposes.

They are documented as the stable API at <http://docs.software-univention.de/developer-reference-4.3.html#join:libraries:shell>

> When
> ucs_registerLDAPExtensio is called from a join or postinst script it will
> detect the values automatically.

but fails if the code is not in the join script itself, but in another shell script being called from the join script and debian/$pkg.postinst
Comment 3 Ingo Steuwer univentionstaff 2021-05-14 16:38:14 CEST
This issue has been filed against UCS 4.3.

UCS 4.3 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.

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