+/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2004-2006 The OpenLDAP Foundation.
+ * Copyright 2004-2011 The OpenLDAP Foundation.
* Portions Copyright 2004 Pierangelo Masarati.
* All rights reserved.
*
#include "slapcommon.h"
+#ifndef S_IWRITE
+#define S_IWRITE S_IWUSR
+#endif
+
static int
test_file( const char *fname, const char *ftype )
{
switch ( stat( fname, &st ) ) {
case 0:
- if ( !( st.st_mode & S_IWUSR ) ) {
+ if ( !( st.st_mode & S_IWRITE ) ) {
Debug( LDAP_DEBUG_ANY, "%s file "
"\"%s\" exists, but user does not have access\n",
ftype, fname, 0 );
return -1;
}
+ fclose( fp );
unlink( fname );
break;
}
}
}
- fprintf( stderr, "config file testing succeeded\n");
+ if ( !quiet ) {
+ fprintf( stderr, "config file testing succeeded\n");
+ }
- slap_tool_destroy();
+ if ( slap_tool_destroy())
+ rc = EXIT_FAILURE;
return rc;
}