diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2007-08-17 02:12:37 +0000 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2007-08-17 02:12:37 +0000 |
commit | 7afaf4974625c0d80d81cfbedbfe9635f21d5a57 (patch) | |
tree | 511777a52148580fd1f2100f4725cf7ced32dd53 /ldap/servers/slapd/libglobs.c | |
parent | 750fa2c4c2b3a570ffbbdb5b3e8aabf95a28c597 (diff) | |
download | ds-7afaf4974625c0d80d81cfbedbfe9635f21d5a57.tar.gz ds-7afaf4974625c0d80d81cfbedbfe9635f21d5a57.tar.xz ds-7afaf4974625c0d80d81cfbedbfe9635f21d5a57.zip |
Resolves: #253069
Summary: cyclic dependency from getpwnam() in log rotation code
Description: Moved getpwnam call to the startup time, store the info in
slapdFrontendConfig to reuse.
Diffstat (limited to 'ldap/servers/slapd/libglobs.c')
-rw-r--r-- | ldap/servers/slapd/libglobs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index 2e03e297..f91d1551 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -2500,9 +2500,20 @@ config_set_localuser( const char *attrname, char *value, char *errorbuf, int app } if (apply) { + struct passwd *pw = NULL; CFG_LOCK_WRITE(slapdFrontendConfig); slapi_ch_free ( (void **) &slapdFrontendConfig->localuser ); slapdFrontendConfig->localuser = slapi_ch_strdup ( value ); + if (slapdFrontendConfig->localuserinfo != NULL) { + slapi_ch_free ( (void **) &(slapdFrontendConfig->localuserinfo) ); + } + pw = getpwnam( value ); + if ( pw ) { + slapdFrontendConfig->localuserinfo = + (struct passwd *)slapi_ch_malloc(sizeof(struct passwd)); + memcpy(slapdFrontendConfig->localuserinfo, pw, sizeof(struct passwd)); + } + CFG_UNLOCK_WRITE(slapdFrontendConfig); } return retVal; |