Browse Source

185811 - Fixed windows build failures when compiling slapd_chown_if_not_owner function

Nathan Kinder 19 years ago
parent
commit
977ab761b5
3 changed files with 6 additions and 0 deletions
  1. 2 0
      ldap/servers/slapd/log.c
  2. 2 0
      ldap/servers/slapd/proto-slap.h
  3. 2 0
      ldap/servers/slapd/util.c

+ 2 - 0
ldap/servers/slapd/log.c

@@ -3540,11 +3540,13 @@ log__open_errorlogfile(int logfile_state, int locked)
 		return LOG_UNABLE_TO_OPENFILE;
 	}
 
+#ifndef _WIN32
 	/* make sure the logfile is owned by the localuser.  If one of the
 	 * alternate ns-slapd modes, such as db2bak, tries to log an error
 	 * at startup, it will create the logfile as root! 
 	 */
 	slapd_chown_if_not_owner(loginfo.log_error_file, pw->pw_uid, -1);
+#endif
 
 	loginfo.log_error_fdes = fp;
 	if (logfile_state == LOGFILE_REOPENED) {

+ 2 - 0
ldap/servers/slapd/proto-slap.h

@@ -607,7 +607,9 @@ void g_set_accesslog_level(int val);
  */
 void slapd_nasty(char* str, int c, int err);
 int strarray2str( char **a, char *buf, size_t buflen, int include_quotes );
+#ifndef _WIN32
 int slapd_chown_if_not_owner(const char *filename, uid_t uid, gid_t gid);
+#endif
 int slapd_comp_path(char *p0, char *p1);
 
 

+ 2 - 0
ldap/servers/slapd/util.c

@@ -717,6 +717,7 @@ strarray2str( char **a, char *buf, size_t buflen, int include_quotes )
    Returns 0 upon success or non-zero otherwise, usually -1 if
    some system error occurred
 */
+#ifndef _WIN32
 int
 slapd_chown_if_not_owner(const char *filename, uid_t uid, gid_t gid)
 {
@@ -737,6 +738,7 @@ slapd_chown_if_not_owner(const char *filename, uid_t uid, gid_t gid)
 
         return result;
 }
+#endif
 
 /*
  * Compare 2 pathes