workarounds.c 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #ident "ldclt @(#)workarounds.c 1.5 00/12/01"
  2. /** BEGIN COPYRIGHT BLOCK
  3. * This Program is free software; you can redistribute it and/or modify it under
  4. * the terms of the GNU General Public License as published by the Free Software
  5. * Foundation; version 2 of the License.
  6. *
  7. * This Program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  10. *
  11. * You should have received a copy of the GNU General Public License along with
  12. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  13. * Place, Suite 330, Boston, MA 02111-1307 USA.
  14. *
  15. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  16. * right to link the code of this Program with code not covered under the GNU
  17. * General Public License ("Non-GPL Code") and to distribute linked combinations
  18. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  19. * permitted under this exception must only link to the code of this Program
  20. * through those well defined interfaces identified in the file named EXCEPTION
  21. * found in the source code files (the "Approved Interfaces"). The files of
  22. * Non-GPL Code may instantiate templates or use macros or inline functions from
  23. * the Approved Interfaces without causing the resulting work to be covered by
  24. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  25. * additions to the list of Approved Interfaces. You must obey the GNU General
  26. * Public License in all respects for all of the Program code and other code used
  27. * in conjunction with the Program except the Non-GPL Code covered by this
  28. * exception. If you modify this file, you may extend this exception to your
  29. * version of the file, but you are not obligated to do so. If you do not wish to
  30. * provide this exception without modification, you must delete this exception
  31. * statement from your version and license this file solely under the GPL without
  32. * exception.
  33. *
  34. *
  35. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  36. * Copyright (C) 2006 Red Hat, Inc.
  37. * All rights reserved.
  38. * END COPYRIGHT BLOCK **/
  39. #ifdef HAVE_CONFIG_H
  40. # include <config.h>
  41. #endif
  42. /*
  43. FILE : workarounds.c
  44. AUTHOR : Jean-Luc SCHWING
  45. VERSION : 1.0
  46. DATE : 15 December 1998
  47. DESCRIPTION :
  48. This file contains special work-arounds targetted to
  49. fix, or work-around, the various bugs that may appear
  50. in Solaris 2.7 libldap.
  51. LOCAL : None.
  52. HISTORY :
  53. ---------+--------------+------------------------------------------------------
  54. dd/mm/yy | Author | Comments
  55. ---------+--------------+------------------------------------------------------
  56. 15/12/98 | JL Schwing | Creation
  57. ---------+--------------+------------------------------------------------------
  58. 19/09/00 | JL Schwing | 1.2: Port on Netscape's libldap. This is realized in
  59. | such a way that this library become the default
  60. | way so a ifdef for Solaris will be used...
  61. ---------+--------------+------------------------------------------------------
  62. 16/11/00 | JL Schwing | 1.3 : lint cleanup.
  63. -----------------------------------------------------------------------------
  64. 29/11/00 | JL Schwing | 1.4 : Port on NT 4.
  65. ---------+--------------+------------------------------------------------------
  66. 01/12/00 | JL Schwing | 1.5 : Port on Linux.
  67. ---------+--------------+------------------------------------------------------
  68. */
  69. #include <stdio.h>
  70. #include <string.h>
  71. #include <stdlib.h> /* exit(), ... */ /*JLS 16-11-00*/
  72. #include "lber.h"
  73. #include "ldap.h"
  74. #ifdef SOLARIS_LIBLDAP /*JLS 19-09-00*/
  75. #include "ldap-private.h"
  76. #else /*JLS 19-09-00*/
  77. #ifndef _WIN32 /*JLS 01-12-00*/
  78. #include <pthread.h> /*JLS 01-12-00*/
  79. #endif /*JLS 01-12-00*/
  80. #include "port.h" /* Portability definitions */ /*JLS 29-11-00*/
  81. #include "ldclt.h" /*JLS 19-09-00*/
  82. #endif /*JLS 19-09-00*/
  83. /* ****************************************************************************
  84. FUNCTION : getFdFromLdapSession
  85. PURPOSE : This function is a work-around for the bug 4197228
  86. that is not expected to be fixed soon...
  87. INPUT : ld = ldap session to process.
  88. OUTPUT : fd = the corresponding fd.
  89. RETURN : -1 if error, 0 else.
  90. DESCRIPTION :
  91. *****************************************************************************/
  92. int getFdFromLdapSession (
  93. LDAP *ld,
  94. int *fd)
  95. {
  96. #ifdef SOLARIS_LIBLDAP /*JLS 19-09-00*/
  97. *fd = ld->ld_sb.sb_sd;
  98. return (0);
  99. #else /*JLS 19-09-00*/
  100. printf("Error : getFdFromLdapSession() not implemented...\n");/*JLS 19-09-00*/
  101. exit (EXIT_OTHER); /*JLS 19-09-00*/
  102. #endif /*JLS 19-09-00*/
  103. }
  104. /* End of file */