summaryrefslogtreecommitdiff
path: root/debian/patches/bdb-5.1.patch
blob: ef0fb07a86415d4e343c1b344801a7f4d972e957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Description: Reflect the fact that Berkeley DB 5.1 no longer supports RPC
 See docs/installation/changelog_4_8.html in src:db package.
 .
 This patch removes RPC support in BDB:DBE-CREATE. The function now fails with
 an error message if a remote host is given.
Bug-Debian: http://bugs.debian.org/621377
Forwarded: no
Author: Sébastien Villemot <sebastien.villemot@ens.fr>
Last-Update: 2012-02-17
--- a/modules/berkeley-db/bdb.c
+++ b/modules/berkeley-db/bdb.c
@@ -351,40 +351,10 @@
 DEFUN(BDB:DBE-CREATE,&key PASSWORD ENCRYPT :HOST CLIENT-TIMEOUT SERVER-TIMEOUT)
 { /* Create an environment handle */
   DB_ENV *dbe, *dbe_cl;
-  bool remote_p = boundp(STACK_2); /* host ==> remote */
+  if (boundp(STACK_2))       /* :HOST */
+    error(error_condition, GETTEXT("RPC support has been dropped in Berkeley DB 5.1"));
   int cl_timeout = 0, sv_timeout = 0;
-# if defined(DB_RPCCLIENT)      /* 4.2 and later */
-  SYSCALL(db_env_create,(&dbe,remote_p ? DB_RPCCLIENT : 0));
-# elif defined(DB_CLIENT)       /* 4.1 and before */
-  SYSCALL(db_env_create,(&dbe,remote_p ? DB_CLIENT : 0));
-# else
-#  error how does your Berkeley DB create a remote client?
-# endif
-  if (remote_p) {
-    if (uint_p(STACK_0)) sv_timeout = I_to_uint(STACK_0);
-    if (uint_p(STACK_1)) cl_timeout = I_to_uint(STACK_1);
-   host_restart:
-    if (stringp(STACK_2)) {     /* string host */
-      with_string_0(STACK_2,GLO(misc_encoding),hostz, {
-          SYSCALL(dbe->set_rpc_server,(dbe,NULL,hostz,cl_timeout,sv_timeout,0));
-        });
-    } else if ((dbe_cl = (DB_ENV*)bdb_handle(STACK_2,`BDB::DBE`,
-                                             BH_NIL_IS_NULL))) {
-      /* reuse client */
-      SYSCALL(dbe->set_rpc_server,(dbe,dbe_cl->cl_handle,NULL,
-                                   cl_timeout,sv_timeout,0));
-    } else {                    /* bad host */
-      pushSTACK(NIL);           /* no PLACE */
-      pushSTACK(STACK_(2+1));   /* TYPE-ERROR slot DATUM */
-      pushSTACK(`(OR STRING BDB::DBE)`); /* TYPE-ERROR slot EXPECTED-TYPE */
-      pushSTACK(STACK_2);                /* host */
-      pushSTACK(`BDB::DBE`); pushSTACK(S(string)); pushSTACK(S(Khost));
-      pushSTACK(TheSubr(subr_self)->name);
-      check_value(type_error,GETTEXT("~S: ~S should be a ~S or a ~S, not ~S"));
-      STACK_2 = value1;
-      goto host_restart;
-    }
-  }
+  SYSCALL(db_env_create,(&dbe,0));
   if (!missingp(STACK_4))       /* :PASSWD */
     dbe_set_encryption(dbe,&STACK_3,&STACK_4);
   skipSTACK(5);