]> git.pld-linux.org Git - packages/autofs.git/blame - autofs-hesiod-bind.patch
- BuildRequires openldap-devel
[packages/autofs.git] / autofs-hesiod-bind.patch
CommitLineData
d6e0b7c9
PG
1--- ./modules/Makefile.orig Sat Jun 23 14:16:40 2001
2+++ ./modules/Makefile Sat Jun 23 14:17:51 2001
be85a188 3@@ -24,6 +24,9 @@
4 endif
5
6 ifeq ($(HESIOD), 1)
7+ ifeq ($(HESIOD_BIND), 1)
d6e0b7c9 8+ CFLAGS += -DHESIOD_BIND
be85a188 9+ endif
10 SRCS += lookup_hesiod.c parse_hesiod.c
11 MODS += lookup_hesiod.so parse_hesiod.so
12 endif
d6e0b7c9
PG
13--- ./modules/lookup_hesiod.c.orig Sat Jun 23 14:18:07 2001
14+++ ./modules/lookup_hesiod.c Sat Jun 23 14:22:42 2001
be85a188 15@@ -28,6 +28,9 @@
16
17 struct lookup_context {
18 struct parse_mod *parser;
19+#ifdef HESIOD_BIND
20+ void *hesiod_context;
21+#endif
22 };
23
24 int lookup_version = AUTOFS_LOOKUP_VERSION; /* Required by protocol */
25@@ -49,6 +52,14 @@
26 /* Initialize the resolver. */
27 res_init();
28
29+#ifdef HESIOD_BIND
30+ /* Initialize the hesiod context. */
31+ if(hesiod_init(&(ctxt->hesiod_context)) != 0) {
d6e0b7c9
PG
32+ syslog(LOG_CRIT, MODPREFIX "hesiod_init(): %m");
33+ return 1;
be85a188 34+ }
35+#endif
d6e0b7c9 36+
be85a188 37 /* If a map type isn't explicitly given, parse it as hesiod entries. */
38 if ( !mapfmt )
39 mapfmt = MAPFMT_DEFAULT;
d6e0b7c9
PG
40@@ -72,8 +83,11 @@
41
be85a188 42 chdir("/"); /* If this is not here the filesystem stays
43 busy, for some reason... */
d6e0b7c9 44-
be85a188 45+#ifdef HESIOD_BIND
46+ hes_result = hesiod_resolve(ctxt->hesiod_context, name, "filsys");
47+#else
48 hes_result = hes_resolve(name, "filsys");
49+#endif
50
51 if ( !hes_result ) {
52 syslog(LOG_NOTICE, MODPREFIX "entry \"%s\" not found in map\n", name);
d6e0b7c9 53@@ -83,7 +97,11 @@
be85a188 54 syslog(LOG_DEBUG, MODPREFIX "lookup for \"%s\" gave \"%s\"",
55 name, hes_result[0]);
56 rv = ctxt->parser->parse_mount(root,name,name_len,hes_result[0],ctxt->parser->context);
57+#ifdef HESIOD_BIND
58+ hesiod_free_list(ctxt->hesiod_context, hes_result);
59+#else
60 free(hes_result);
61+#endif
62 return rv;
63 }
64
d6e0b7c9 65@@ -93,6 +111,9 @@
be85a188 66 {
67 struct lookup_context *ctxt = (struct lookup_context *) context;
68 int rv = close_parse(ctxt->parser);
69+#ifdef HESIOD_BIND
70+ hesiod_end(ctxt->hesiod_context);
71+#endif
72 free(ctxt);
73 return rv;
74 }
d6e0b7c9
PG
75--- ./Makefile.conf.in.orig Sat Jun 23 14:12:16 2001
76+++ ./Makefile.conf.in Sat Jun 23 14:12:43 2001
77@@ -12,6 +12,7 @@
78
79 # Hesiod support: yes (1) no (0)
80 HESIOD = @HAVE_HESIOD@
81+HESIOD_BIND = @HAVE_HESIOD_BIND@
82 LIBHESIOD = @LIBHESIOD@
83 HESIOD_FLAGS = @HESIOD_FLAGS@
84
85--- ./configure.in.orig Sat Jun 23 14:12:58 2001
86+++ ./configure.in Sat Jun 23 14:16:32 2001
87@@ -78,10 +78,10 @@
88 if test -z "$HAVE_HESIOD"
89 then
90 HAVE_HESIOD=0
91- AC_CHECK_LIB(hesiod, hes_resolve, HAVE_HESIOD=1 LIBHESIOD="$LIBHESIOD -lhesiod", ,
92- $LIBRESOLV)
93+ AC_CHECK_LIB(bind, hesiod_resolve, HAVE_HESIOD=1 HAVE_HESIOD_BIND=1 LIBHESIOD="$LIBHESIOD -lbind", , $LIBRESOLV)
94 fi
95 AC_SUBST(HAVE_HESIOD)
96+AC_SUBST(HAVE_HESIOD_BIND)
97 AC_SUBST(LIBHESIOD)
98 AC_SUBST(HESIOD_FLAGS)
99 LDFLAGS="${AF_tmp_ldflags}"
This page took 0.113814 seconds and 4 git commands to generate.