[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm dbhelp.c, 1.7, 1.8 dblayer.c, 1.18, 1.19

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Thu Aug 16 19:29:00 UTC 2007


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29502/ldapserver/ldap/servers/slapd/back-ldbm

Modified Files:
	dbhelp.c dblayer.c 
Log Message:
Resolves: bug 253047
Bug Description: Does not build on Fedora 8
Fix Description: If using the O_CREAT flag with open(), the file mode must also be given.  Also, the bdb calls to use ->open() must use parentheses around the function pointer access e.g. (DB->open)(args...) instead of just DB->open(args).
Platforms tested: RHEL4, Fedora 8
Flag Day: no
Doc impact: no



Index: dbhelp.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dbhelp.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- dbhelp.c	15 Nov 2006 17:47:58 -0000	1.7
+++ dbhelp.c	16 Aug 2007 19:28:58 -0000	1.8
@@ -74,7 +74,7 @@
 		LDAPDebug(LDAP_DEBUG_ANY, "dblayer_copy_file_keybykey, Create error %d: %s\n", retval, db_strerror(retval), 0);
 		goto error;
 	}
-	retval = source_file->open(source_file, NULL, source_file_name, NULL, DB_UNKNOWN, DB_RDONLY, 0);
+	retval = (source_file->open)(source_file, NULL, source_file_name, NULL, DB_UNKNOWN, DB_RDONLY, 0);
 	if (retval) {
 		LDAPDebug(LDAP_DEBUG_ANY, "dblayer_copy_file_keybykey, Open error %d: %s\n", retval, db_strerror(retval), 0);
 		goto error;
@@ -113,7 +113,7 @@
 		LDAPDebug(LDAP_DEBUG_ANY, "dblayer_copy_file_keybykey, set_pagesize error %d: %s\n", retval, db_strerror(retval), 0);
 		goto error;
 	}
-	retval = destination_file->open(destination_file, NULL, destination_file_name, NULL, dbtype, DB_CREATE | DB_EXCL, mode);
+	retval = (destination_file->open)(destination_file, NULL, destination_file_name, NULL, dbtype, DB_CREATE | DB_EXCL, mode);
 	if (retval) {
 		LDAPDebug(LDAP_DEBUG_ANY, "dblayer_copy_file_keybykey, Open error %d: %s\n", retval, db_strerror(retval), 0);
 		goto error;
@@ -260,7 +260,7 @@
 	}
 	dblayer_set_env_debugging(ret_env, priv);
 
-	retval = ret_env->open(ret_env,db_home_dir, DB_INIT_TXN | DB_RECOVER_FATAL | DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE,0);
+	retval = (ret_env->open)(ret_env,db_home_dir, DB_INIT_TXN | DB_RECOVER_FATAL | DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE,0);
 	if (0 == retval) {
 		*env = ret_env;
 	} else {
@@ -292,7 +292,7 @@
 		goto error;
 	}
 
-	retval = ret_env->open(ret_env,db_home_dir,DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE,0);
+	retval = (ret_env->open)(ret_env,db_home_dir,DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE,0);
 	if (0 == retval) {
 		*env = ret_env;
 	} else {


Index: dblayer.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dblayer.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- dblayer.c	15 Mar 2007 21:34:32 -0000	1.18
+++ dblayer.c	16 Aug 2007 19:28:58 -0000	1.19
@@ -102,11 +102,11 @@
 {                                                                              \
     if (((oflags) & DB_INIT_TXN) && ((oflags) & DB_INIT_LOG))                  \
     {                                                                          \
-        (rval) = (db)->open((db), (txnid), (file), (database), (type), (flags)|DB_AUTO_COMMIT, (mode)); \
+        (rval) = ((db)->open)((db), (txnid), (file), (database), (type), (flags)|DB_AUTO_COMMIT, (mode)); \
     }                                                                          \
     else                                                                       \
     {                                                                          \
-        (rval) = (db)->open((db), (txnid), (file), (database), (type), (flags), (mode)); \
+        (rval) = ((db)->open)((db), (txnid), (file), (database), (type), (flags), (mode)); \
     }                                                                          \
 }
 /* 608145: db4.1 and newer does not require exclusive lock for checkpointing 
@@ -1556,7 +1556,7 @@
             }
         }
 
-        return_value = pEnv->dblayer_DB_ENV->open(
+        return_value = (pEnv->dblayer_DB_ENV->open)(
                         pEnv->dblayer_DB_ENV,
                         region_dir,
                         recover_flags,
@@ -1612,7 +1612,7 @@
     if (!((DBLAYER_IMPORT_MODE|DBLAYER_INDEX_MODE) & dbmode))
     {
         pEnv->dblayer_openflags = open_flags;
-        return_value = pEnv->dblayer_DB_ENV->open(
+        return_value = (pEnv->dblayer_DB_ENV->open)(
             pEnv->dblayer_DB_ENV,
             region_dir,
             open_flags,
@@ -1940,7 +1940,7 @@
             mypEnv->dblayer_openflags = oflags;
             data_directories[0] = inst->inst_parent_dir_name;
             dblayer_set_data_dir(priv, mypEnv, data_directories);
-            return_value = mypEnv->dblayer_DB_ENV->open(mypEnv->dblayer_DB_ENV,
+            return_value = (mypEnv->dblayer_DB_ENV->open)(mypEnv->dblayer_DB_ENV,
                                                        inst_dirp,
                                                        oflags,
                                                        priv->dblayer_file_mode);
@@ -2220,7 +2220,7 @@
     mypEnv->dblayer_openflags = envflags;
     data_directories[0] = inst->inst_parent_dir_name;
     dblayer_set_data_dir(priv, mypEnv, data_directories);
-    rval = mypEnv->dblayer_DB_ENV->open(mypEnv->dblayer_DB_ENV,
+    rval = (mypEnv->dblayer_DB_ENV->open)(mypEnv->dblayer_DB_ENV,
             priv->dblayer_home_directory, envflags, priv->dblayer_file_mode);
     if (rval != 0)
     {




More information about the Fedora-directory-commits mailing list