|
Lines 1-295
Link Here
|
| 1 |
--- configure.ac.orig 2009-10-17 20:09:01.000000000 +0400 |
|
|
| 2 |
+++ configure.ac 2009-12-20 19:58:24.000000000 +0300 |
| 3 |
@@ -160,6 +160,20 @@ |
| 4 |
AC_DEFINE(ENABLE_CONFIGFILE_CHECKING,1,[Whether to check configfile options.]) |
| 5 |
fi |
| 6 |
|
| 7 |
+# check whether nss_compat options should be checked |
| 8 |
+AC_MSG_CHECKING([whether to check nss_compat option]) |
| 9 |
+AC_ARG_ENABLE(nss_compat_checking, |
| 10 |
+ AS_HELP_STRING([--enable-nss_compat], |
| 11 |
+ [check nss_compat option [[default=no]]]), |
| 12 |
+ [nss_compat_checking=$enableval], |
| 13 |
+ [nss_compat_checking="no"]) |
| 14 |
+AC_MSG_RESULT($nss_compat_checking) |
| 15 |
+if test "x$nss_compat_checking" = "xyes" |
| 16 |
+then |
| 17 |
+ AC_CHECK_HEADERS([libgen.h], [], [AC_MSG_ERROR([libgen.h is required for nss_compat])]) |
| 18 |
+ AC_DEFINE(ENABLE_NSS_COMPAT,1,[Whether to check nss_compat options.]) |
| 19 |
+fi |
| 20 |
+ |
| 21 |
# check the name of the configuration file |
| 22 |
AC_ARG_WITH(ldap-conf-file, |
| 23 |
AS_HELP_STRING([--with-ldap-conf-file=PATH], |
| 24 |
--- nslcd/cfg.c.orig 2009-10-05 21:47:47.000000000 +0400 |
| 25 |
+++ nslcd/cfg.c 2009-12-20 18:10:37.000000000 +0300 |
| 26 |
@@ -33,6 +33,9 @@ |
| 27 |
#include <sys/types.h> |
| 28 |
#include <sys/stat.h> |
| 29 |
#include <unistd.h> |
| 30 |
+#ifdef ENABLE_NSS_COMPAT |
| 31 |
+#include <libgen.h> |
| 32 |
+#endif |
| 33 |
#include <errno.h> |
| 34 |
#include <netdb.h> |
| 35 |
#include <sys/socket.h> |
| 36 |
@@ -665,6 +668,25 @@ |
| 37 |
int rc; |
| 38 |
char *value; |
| 39 |
#endif |
| 40 |
+#ifdef ENABLE_NSS_COMPAT |
| 41 |
+ /* get secret password */ |
| 42 |
+ snprintf(linebuf, sizeof(linebuf), "%s/nss_ldap.secret", dirname(filename)); |
| 43 |
+ if ((fp=fopen(linebuf,"r"))==NULL) |
| 44 |
+ { |
| 45 |
+ log_log(LOG_ERR,"cannot open secret file (%s): %s",linebuf,strerror(errno)); |
| 46 |
+ /* exit(EXIT_FAILURE); */ |
| 47 |
+ } |
| 48 |
+ else if (fgets(linebuf,MAX_LINE_LENGTH,fp)!=NULL) |
| 49 |
+ { |
| 50 |
+ i=strlen(linebuf); |
| 51 |
+ if (i>0) |
| 52 |
+ linebuf[i-1]='\0'; |
| 53 |
+ cfg->ldc_bindpw=strdup(linebuf); |
| 54 |
+ } |
| 55 |
+ if (fp!=NULL) |
| 56 |
+ fclose(fp); |
| 57 |
+#endif |
| 58 |
+ |
| 59 |
/* open config file */ |
| 60 |
if ((fp=fopen(filename,"r"))==NULL) |
| 61 |
{ |
| 62 |
@@ -733,13 +755,20 @@ |
| 63 |
get_int(filename,lnr,keyword,&line,&cfg->ldc_version); |
| 64 |
get_eol(filename,lnr,keyword,&line); |
| 65 |
} |
| 66 |
+#ifdef ENABLE_NSS_COMPAT |
| 67 |
+ else if (strcasecmp(keyword,"rootbinddn")==0) |
| 68 |
+#else |
| 69 |
else if (strcasecmp(keyword,"binddn")==0) |
| 70 |
+#endif |
| 71 |
{ |
| 72 |
get_restdup(filename,lnr,keyword,&line,&cfg->ldc_binddn); |
| 73 |
} |
| 74 |
else if (strcasecmp(keyword,"bindpw")==0) |
| 75 |
{ |
| 76 |
- get_restdup(filename,lnr,keyword,&line,&cfg->ldc_bindpw); |
| 77 |
+#ifdef ENABLE_NSS_COMPAT |
| 78 |
+ if (cfg->ldc_bindpw == NULL) |
| 79 |
+#endif |
| 80 |
+ get_restdup(filename,lnr,keyword,&line,&cfg->ldc_bindpw); |
| 81 |
} |
| 82 |
/* SASL authentication options */ |
| 83 |
else if (strcasecmp(keyword,"sasl_authcid")==0) |
| 84 |
--- config.h.in.orig 2009-12-20 17:49:41.000000000 +0300 |
| 85 |
+++ config.h.in 2009-12-20 17:41:46.000000000 +0300 |
| 86 |
@@ -3,6 +3,9 @@ |
| 87 |
/* Whether to check configfile options. */ |
| 88 |
#undef ENABLE_CONFIGFILE_CHECKING |
| 89 |
|
| 90 |
+/* Whether to check nss_compat options. */ |
| 91 |
+#undef ENABLE_NSS_COMPAT |
| 92 |
+ |
| 93 |
/* Define to 1 if you have the <aliases.h> header file. */ |
| 94 |
#undef HAVE_ALIASES_H |
| 95 |
|
| 96 |
--- configure.orig 2010-02-27 09:17:45.000000000 -0600 |
| 97 |
+++ configure 2010-04-29 07:28:11.044647697 -0500 |
| 98 |
@@ -738,6 +738,7 @@ |
| 99 |
enable_sasl |
| 100 |
enable_kerberos |
| 101 |
enable_configfile_checking |
| 102 |
+enable_nss_compat |
| 103 |
with_ldap_conf_file |
| 104 |
with_bindpw_file |
| 105 |
with_nslcd_pidfile |
| 106 |
@@ -1386,6 +1387,7 @@ |
| 107 |
--disable-kerberos disable Kerberos support [[default=enabled]] |
| 108 |
--disable-configfile-checking |
| 109 |
check configfile options [[default=enabled]] |
| 110 |
+ --enable-nss_compat check nss_compat option [[default=disabled]] |
| 111 |
|
| 112 |
Optional Packages: |
| 113 |
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes] |
| 114 |
@@ -4782,6 +4784,181 @@ |
| 115 |
|
| 116 |
fi |
| 117 |
|
| 118 |
+# check whether nss_compat options should be checked |
| 119 |
+{ $as_echo "$as_me:$LINENO: checking whether to check nss_compat option" >&5 |
| 120 |
+$as_echo_n "checking whether to check nss_compat option... " >&6; } |
| 121 |
+# Check whether --enable-nss_compat was given. |
| 122 |
+if test "${enable_nss_compat+set}" = set; then |
| 123 |
+ enableval=$enable_nss_compat; nss_compat=$enableval |
| 124 |
+else |
| 125 |
+ nss_compat="no" |
| 126 |
+fi |
| 127 |
+ |
| 128 |
+{ $as_echo "$as_me:$LINENO: result: $nss_compat" >&5 |
| 129 |
+$as_echo "$nss_compat" >&6; } |
| 130 |
+if test "x$nss_compat" = "xyes" |
| 131 |
+then |
| 132 |
+ |
| 133 |
+for ac_header in libgen.h |
| 134 |
+do |
| 135 |
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` |
| 136 |
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then |
| 137 |
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 |
| 138 |
+$as_echo_n "checking for $ac_header... " >&6; } |
| 139 |
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then |
| 140 |
+ $as_echo_n "(cached) " >&6 |
| 141 |
+fi |
| 142 |
+ac_res=`eval 'as_val=${'$as_ac_Header'} |
| 143 |
+ $as_echo "$as_val"'` |
| 144 |
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 |
| 145 |
+$as_echo "$ac_res" >&6; } |
| 146 |
+else |
| 147 |
+ # Is the header compilable? |
| 148 |
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 |
| 149 |
+$as_echo_n "checking $ac_header usability... " >&6; } |
| 150 |
+cat >conftest.$ac_ext <<_ACEOF |
| 151 |
+/* confdefs.h. */ |
| 152 |
+_ACEOF |
| 153 |
+cat confdefs.h >>conftest.$ac_ext |
| 154 |
+cat >>conftest.$ac_ext <<_ACEOF |
| 155 |
+/* end confdefs.h. */ |
| 156 |
+$ac_includes_default |
| 157 |
+#include <$ac_header> |
| 158 |
+_ACEOF |
| 159 |
+rm -f conftest.$ac_objext |
| 160 |
+if { (ac_try="$ac_compile" |
| 161 |
+case "(($ac_try" in |
| 162 |
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; |
| 163 |
+ *) ac_try_echo=$ac_try;; |
| 164 |
+esac |
| 165 |
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" |
| 166 |
+$as_echo "$ac_try_echo") >&5 |
| 167 |
+ (eval "$ac_compile") 2>conftest.er1 |
| 168 |
+ ac_status=$? |
| 169 |
+ grep -v '^ *+' conftest.er1 >conftest.err |
| 170 |
+ rm -f conftest.er1 |
| 171 |
+ cat conftest.err >&5 |
| 172 |
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
| 173 |
+ (exit $ac_status); } && { |
| 174 |
+ test -z "$ac_c_werror_flag" || |
| 175 |
+ test ! -s conftest.err |
| 176 |
+ } && test -s conftest.$ac_objext; then |
| 177 |
+ ac_header_compiler=yes |
| 178 |
+else |
| 179 |
+ $as_echo "$as_me: failed program was:" >&5 |
| 180 |
+sed 's/^/| /' conftest.$ac_ext >&5 |
| 181 |
+ |
| 182 |
+ ac_header_compiler=no |
| 183 |
+fi |
| 184 |
+ |
| 185 |
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
| 186 |
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 |
| 187 |
+$as_echo "$ac_header_compiler" >&6; } |
| 188 |
+ |
| 189 |
+# Is the header present? |
| 190 |
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 |
| 191 |
+$as_echo_n "checking $ac_header presence... " >&6; } |
| 192 |
+cat >conftest.$ac_ext <<_ACEOF |
| 193 |
+/* confdefs.h. */ |
| 194 |
+_ACEOF |
| 195 |
+cat confdefs.h >>conftest.$ac_ext |
| 196 |
+cat >>conftest.$ac_ext <<_ACEOF |
| 197 |
+/* end confdefs.h. */ |
| 198 |
+#include <$ac_header> |
| 199 |
+_ACEOF |
| 200 |
+if { (ac_try="$ac_cpp conftest.$ac_ext" |
| 201 |
+case "(($ac_try" in |
| 202 |
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; |
| 203 |
+ *) ac_try_echo=$ac_try;; |
| 204 |
+esac |
| 205 |
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" |
| 206 |
+$as_echo "$ac_try_echo") >&5 |
| 207 |
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 |
| 208 |
+ ac_status=$? |
| 209 |
+ grep -v '^ *+' conftest.er1 >conftest.err |
| 210 |
+ rm -f conftest.er1 |
| 211 |
+ cat conftest.err >&5 |
| 212 |
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
| 213 |
+ (exit $ac_status); } >/dev/null && { |
| 214 |
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || |
| 215 |
+ test ! -s conftest.err |
| 216 |
+ }; then |
| 217 |
+ ac_header_preproc=yes |
| 218 |
+else |
| 219 |
+ $as_echo "$as_me: failed program was:" >&5 |
| 220 |
+sed 's/^/| /' conftest.$ac_ext >&5 |
| 221 |
+ |
| 222 |
+ ac_header_preproc=no |
| 223 |
+fi |
| 224 |
+ |
| 225 |
+rm -f conftest.err conftest.$ac_ext |
| 226 |
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 |
| 227 |
+$as_echo "$ac_header_preproc" >&6; } |
| 228 |
+ |
| 229 |
+# So? What about this header? |
| 230 |
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in |
| 231 |
+ yes:no: ) |
| 232 |
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 |
| 233 |
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} |
| 234 |
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 |
| 235 |
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} |
| 236 |
+ ac_header_preproc=yes |
| 237 |
+ ;; |
| 238 |
+ no:yes:* ) |
| 239 |
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 |
| 240 |
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} |
| 241 |
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 |
| 242 |
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} |
| 243 |
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 |
| 244 |
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} |
| 245 |
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 |
| 246 |
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} |
| 247 |
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 |
| 248 |
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} |
| 249 |
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 |
| 250 |
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} |
| 251 |
+ ( cat <<\_ASBOX |
| 252 |
+## -------------------------------------- ## |
| 253 |
+## Report this to arthur@arthurdejong.org ## |
| 254 |
+## -------------------------------------- ## |
| 255 |
+_ASBOX |
| 256 |
+ ) | sed "s/^/$as_me: WARNING: /" >&2 |
| 257 |
+ ;; |
| 258 |
+esac |
| 259 |
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 |
| 260 |
+$as_echo_n "checking for $ac_header... " >&6; } |
| 261 |
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then |
| 262 |
+ $as_echo_n "(cached) " >&6 |
| 263 |
+else |
| 264 |
+ eval "$as_ac_Header=\$ac_header_preproc" |
| 265 |
+fi |
| 266 |
+ac_res=`eval 'as_val=${'$as_ac_Header'} |
| 267 |
+ $as_echo "$as_val"'` |
| 268 |
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 |
| 269 |
+$as_echo "$ac_res" >&6; } |
| 270 |
+ |
| 271 |
+fi |
| 272 |
+if test `eval 'as_val=${'$as_ac_Header'} |
| 273 |
+ $as_echo "$as_val"'` = yes; then |
| 274 |
+ cat >>confdefs.h <<_ACEOF |
| 275 |
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 |
| 276 |
+_ACEOF |
| 277 |
+ |
| 278 |
+else |
| 279 |
+ { { $as_echo "$as_me:$LINENO: error: libgen.h is required for nss_compat" >&5 |
| 280 |
+$as_echo "$as_me: error: libgen.h is required for nss_compat" >&2;} |
| 281 |
+ { (exit 1); exit 1; }; } |
| 282 |
+fi |
| 283 |
+ |
| 284 |
+done |
| 285 |
+ |
| 286 |
+ |
| 287 |
+cat >>confdefs.h <<\_ACEOF |
| 288 |
+#define ENABLE_NSS_COMPAT 1 |
| 289 |
+_ACEOF |
| 290 |
+ |
| 291 |
+fi |
| 292 |
+ |
| 293 |
# check the name of the configuration file |
| 294 |
|
| 295 |
# Check whether --with-ldap-conf-file was given. |