init.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. /* init.c - initialize various things */
  13. #include <stdio.h>
  14. #include <string.h>
  15. #include <sys/types.h>
  16. #include <sys/time.h>
  17. #include <netinet/in.h>
  18. #include <sys/socket.h>
  19. #include <arpa/inet.h>
  20. #include <netdb.h>
  21. #include "slap.h"
  22. #include "fe.h"
  23. void
  24. slapd_init()
  25. {
  26. /* We don't worry about free'ing this stuff
  27. * since the only time we want to do that is when
  28. * the process is exiting. */
  29. num_conns = slapi_counter_new();
  30. g_set_current_conn_count_mutex( PR_NewLock() );
  31. if ( g_get_current_conn_count_mutex() == NULL )
  32. {
  33. LDAPDebug( LDAP_DEBUG_ANY,
  34. "init: PR_NewLock failed\n", 0, 0, 0 );
  35. exit( -1 );
  36. }
  37. /* Add PSEUDO_ATTR_UNHASHEDUSERPASSWORD to the protected attribute list */
  38. set_attr_to_protected_list(PSEUDO_ATTR_UNHASHEDUSERPASSWORD, 0);
  39. #ifndef HAVE_TIME_R
  40. if ((time_func_mutex = PR_NewLock()) == NULL ) {
  41. LDAPDebug( LDAP_DEBUG_ANY,
  42. "init: PR_NewLock failed\n", 0, 0, 0 );
  43. exit(-1);
  44. }
  45. #endif /* HAVE_TIME_R */
  46. }