Bug 47837 - SIGSEGV: src/change.c:315 - server/role not set
SIGSEGV: src/change.c:315 - server/role not set
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Listener (univention-directory-listener)
UCS 4.3
Other Linux
: P5 normal (vote)
: UCS 4.3-2-errata
Assigned To: Philipp Hahn
Felix Botner
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-09-19 15:31 CEST by Philipp Hahn
Modified: 2018-09-26 13:24 CEST (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 7: Crash: Bug causes crash or data loss
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.080
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 SIGSEGV wen UCRV server/role is unset (693 bytes, patch)
2018-09-19 15:31 CEST, 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 2018-09-19 15:31:42 CEST
Created attachment 9679 [details]
Fix SIGSEGV wen UCRV server/role is unset

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055bcf23b3ed8 in change_update_schema (lp=0x55bcf2bf6080) at change.c:315

warning: Source file is more recent than executable.
315             if (!strcmp(server_role, "domaincontroller_master")) {
[Current thread is 1 (LWP 31021)]
(gdb) print server_role
$1 = 0x0
(gdb) bt
#0  0x000055bcf23b3ed8 in change_update_schema (lp=0x55bcf2bf6080) at change.c:315
#1  0x000055bcf23b0cd3 in main (argc=<optimized out>, argv=<optimized out>) at main.c:600

src/change.c
  313 »···server_role = univention_config_get_string("server/role");
  314
  315 »···if (!strcmp(server_role, "domaincontroller_master")) {

univention_config_get_string() returns NULL when the UCRV is not set.

Bonus points for caching that value as it is read on every transaction again.
Comment 1 Philipp Hahn univentionstaff 2018-09-19 16:28:15 CEST
[4.3-2] cb5606dbee Bug #47837 UDL: Fix segmetation fault when UCRV server/role is unset
 management/univention-directory-listener/debian/changelog | 1 +
 management/univention-directory-listener/src/change.c     | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

Package: univention-directory-listener
Version: 12.0.0-24A~4.3.0.201809191626
Branch: ucs_4.3-0
Scope: errata4.3-2

[4.3-2] 0ebe21a0f1 Bug #47783: univention-directory-listener 12.0.0-24A~4.3.0.201809191626
 doc/errata/staging/univention-directory-listener.yaml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

QA: ucr unset server/role ; service univention-directory-listener restart
Comment 2 Felix Botner univentionstaff 2018-09-20 15:28:06 CEST
hmm, i get 


Program received signal SIGSEGV, Segmentation fault.
0x000055555555ee4d in select_server (lp=0x555555782720) at select_server.c:94
94	select_server.c: Datei oder Verzeichnis nicht gefunden.


on my master (without server/role)

Maybe better to exit with error if server/role is not set?
Comment 3 Philipp Hahn univentionstaff 2018-09-20 22:20:29 CEST
[4.3-2] fdf277ebc7 Bug #47837 UDL: Fix wrong debug level
 management/univention-directory-listener/debian/changelog    | 6 ++++++
 management/univention-directory-listener/src/select_server.c | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

[4.3-2] 317ecfb01d Bug #47837 UDL: Fix another segmetation fault when UCRVs is unset
 management/univention-directory-listener/debian/changelog    |  1 +
 management/univention-directory-listener/src/select_server.c | 12 ++++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

Package: univention-directory-listener
Version: 12.0.0-27A~4.3.0.201809202217
Branch: ucs_4.3-0
Scope: errata4.3-2

[4.3-2] 9f193b3562 Bug #47783: univention-directory-listener 12.0.0-27A~4.3.0.201809202217
 doc/errata/staging/univention-directory-listener.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 4 Philipp Hahn univentionstaff 2018-09-21 09:58:55 CEST
[4.3-2] a9ef579cbf Bug #47837 UDL: Fix copy-paste-error in error message
 management/univention-directory-listener/debian/changelog    | 6 ++++++
 management/univention-directory-listener/src/select_server.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

Package: univention-directory-listener
Version: 12.0.0-28A~4.3.0.201809210953
Branch: ucs_4.3-0
Scope: errata4.3-2

[4.3-2] 83cdc0c53a Bug #47837 UDL: Fix copy-paste-error in error message
 doc/errata/staging/univention-directory-listener.yaml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Comment 5 Felix Botner univentionstaff 2018-09-21 10:20:16 CEST
OK - univention-directory-listener
OK - YAML
Comment 6 Erik Damrose univentionstaff 2018-09-26 13:24:50 CEST
<http://errata.software-univention.de/ucs/4.3/242.html>