diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-12-18 22:23:11 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-12-18 23:07:56 -0500 |
commit | 055b10405ea02fb7adb3867141dc56464fda9a90 (patch) | |
tree | 88c3ca0cea58541d5915a921265021405ff0a1c5 /nslcd_systemd/disable_nss_module.go | |
parent | 379e4d7e4d2539f35d559d4b0752531e546238a9 (diff) |
use contexts for logging
Diffstat (limited to 'nslcd_systemd/disable_nss_module.go')
-rw-r--r-- | nslcd_systemd/disable_nss_module.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/nslcd_systemd/disable_nss_module.go b/nslcd_systemd/disable_nss_module.go index df22360..32b105a 100644 --- a/nslcd_systemd/disable_nss_module.go +++ b/nslcd_systemd/disable_nss_module.go @@ -23,7 +23,7 @@ import ( "fmt" "git.lukeshu.com/go/libgnulinux/dl" - "git.lukeshu.com/go/libsystemd/sd_daemon" + "git.lukeshu.com/go/libnslcd/nslcd_server" ) //static char *strary(char **ary, unsigned int n) { return ary[n]; } @@ -35,27 +35,27 @@ const ( nss_module_sym_enablelookups = "_nss_ldap_enablelookups" ) -func disable_nss_module() { +func disable_nss_module(log nslcd_server.Logger) { handle, err := dl.Open(nss_module_soname, dl.RTLD_LAZY|dl.RTLD_NODELETE) if err == nil { defer handle.Close() } else { - sd_daemon.Log.Warning(fmt.Sprintf("NSS module %s not loaded: %v", nss_module_soname, err)) + log.Warning(fmt.Sprintf("NSS module %s not loaded: %v", nss_module_soname, err)) return } c_version_info, err := handle.Sym(nss_module_sym_version) if err == nil { g_version_info := (**C.char)(c_version_info) - sd_daemon.Log.Debug(fmt.Sprintf("NSS module %s version %s %s", nss_module_soname, + log.Debug(fmt.Sprintf("NSS module %s version %s %s", nss_module_soname, C.GoString(C.strary(g_version_info, 0)), C.GoString(C.strary(g_version_info, 1)))) } else { - sd_daemon.Log.Warning(fmt.Sprintf("NSS module %s version missing: %v", nss_module_soname, err)) + log.Warning(fmt.Sprintf("NSS module %s version missing: %v", nss_module_soname, err)) } c_enable_flag, err := handle.Sym(nss_module_sym_enablelookups) if err != nil { - sd_daemon.Log.Warning(fmt.Sprintf("Unable to disable NSS ldap module for nslcd process: %v", err)) + log.Warning(fmt.Sprintf("Unable to disable NSS ldap module for nslcd process: %v", err)) return } g_enable_flag := (*C.int)(c_enable_flag) |