From: Dave H. <hel...@us...> - 2013-11-16 19:37:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "cmpi-base - Base OS CMPI Providers". The branch, master has been updated via 3f41cf1d3ea50eb0563c6422f7919c19330c96f0 (commit) from e37b7403daad73ae928be1915f53fa6178f25e9d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3f41cf1d3ea50eb0563c6422f7919c19330c96f0 Author: Dave Heller <hel...@us...> Date: Sat Nov 16 14:35:30 2013 -0500 Fixed SBLIM-2698: system name might have empty domainname ----------------------------------------------------------------------- Summary of changes: ChangeLog | 7 +++++++ NEWS | 1 + OSBase_Common.c | 14 +++++++++++++- contributions.txt | 4 ++++ 4 files changed, 25 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index f86db38..dd1fe2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-11-16 Dave Heller <hel...@us...> + + * NEWS, contributions.txt, OSBase_Common.c: + + Fixed SBLIM-2698: system name might have empty domainname + (patch by Klaus Kämpf) + 2013-06-11 Dave Heller <hel...@us...> * NEWS, contributions.txt, OSBase_UnixProcess.c: diff --git a/NEWS b/NEWS index 84680d1..6c77e35 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ Changes in Version 1.6.3 Bugs Fixed: - SBLIM-2634: incorrect max cpu frequency - SBLIM-2644: wrong UserModeTime and KernelModeTime +- SBLIM-2698: system name might have empty domainname Changes in Version 1.6.2 ======================== diff --git a/OSBase_Common.c b/OSBase_Common.c index e10a407..46c76e8 100644 --- a/OSBase_Common.c +++ b/OSBase_Common.c @@ -174,11 +174,23 @@ void _init_system_name() { } freeresultbuf(hdout); } + if (!domain || *domain == 0) { /* /bin/dnsdomainname might return empty */ + /* get domain name */ + rc=runcommand("/bin/domainname",NULL,&hdout,NULL); + if (rc == 0 && hdout != NULL) { + if (hdout[0] && *hdout[0] != '(') { /* might return "(none)" */ + domain = strdup(hdout[0]); + ptr = strchr(domain, '\n'); + *ptr = '\0'; + } + freeresultbuf(hdout); + } + } } /* initializes CIM_HOST_NAME */ if( strlen(host) ) { - if( !domain ) { + if(!domain || *domain == 0) { CIM_HOST_NAME = calloc(1,(strlen(host)+1)); strcpy( CIM_HOST_NAME, host); } diff --git a/contributions.txt b/contributions.txt index 5834f5a..241b249 100644 --- a/contributions.txt +++ b/contributions.txt @@ -26,3 +26,7 @@ Henning Sackewitz, ----------------------- 05/28/2013 [ SBLIM-2634 ] incorrect max cpu frequency 06/11/2013 [ SBLIM-2644 ] wrong UserModeTime and KernelModeTime + +Klaus Kämpf, Novell +----------------------- +11/16/2013 [ SBLIM-2698 ] system name might have empty domainname hooks/post-receive -- cmpi-base - Base OS CMPI Providers |