The Samba-Bugzilla – Attachment 4032 Details for
Bug 6195
Migrating from 3.0.x to 3.3.x can fail to update passdb.tdb correctly.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Easy patch on top of current code.
look (text/plain), 1.76 KB, created by
Jeremy Allison
on 2009-03-27 13:47:58 UTC
(
hide
)
Description:
Easy patch on top of current code.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2009-03-27 13:47:58 UTC
Size:
1.76 KB
patch
obsolete
>diff --git a/source/include/dbwrap.h b/source/include/dbwrap.h >index 1f38816..329c191 100644 >--- a/source/include/dbwrap.h >+++ b/source/include/dbwrap.h >@@ -49,6 +49,8 @@ struct db_context { > bool persistent; > }; > >+bool db_is_local(const char *name); >+ > struct db_context *db_open(TALLOC_CTX *mem_ctx, > const char *name, > int hash_size, int tdb_flags, >diff --git a/source/lib/dbwrap.c b/source/lib/dbwrap.c >index 7fe1631..00182aa 100644 >--- a/source/lib/dbwrap.c >+++ b/source/lib/dbwrap.c >@@ -42,6 +42,33 @@ static int dbwrap_fallback_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, > return 0; > } > >+bool db_is_local(const char *name) >+{ >+#ifdef CLUSTER_SUPPORT >+ const char *sockname = lp_ctdbd_socket(); >+ >+ if(!sockname || !*sockname) { >+ sockname = CTDB_PATH; >+ } >+ >+ if (lp_clustering() && socket_exist(sockname)) { >+ const char *partname; >+ /* ctdb only wants the file part of the name */ >+ partname = strrchr(name, '/'); >+ if (partname) { >+ partname++; >+ } else { >+ partname = name; >+ } >+ /* allow ctdb for individual databases to be disabled */ >+ if (lp_parm_bool(-1, "ctdb", partname, True)) { >+ return false; >+ } >+ } >+#endif >+ return true; >+} >+ > /** > * If you need transaction support use db_open_trans() > */ >diff --git a/source/passdb/pdb_tdb.c b/source/passdb/pdb_tdb.c >index 9928768..f60517f 100644 >--- a/source/passdb/pdb_tdb.c >+++ b/source/passdb/pdb_tdb.c >@@ -921,7 +921,8 @@ static bool tdbsam_convert(struct db_context **pp_db, const char *name, int32 fr > struct db_context *db = NULL; > int ret; > >- if (!tdbsam_convert_backup(name, pp_db)) { >+ /* We only need the update backup for local db's. */ >+ if (db_is_local(name) && !tdbsam_convert_backup(name, pp_db)) { > DEBUG(0, ("tdbsam_convert: Could not backup %s\n", name)); > return false; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 6195
:
3998
|
4031
| 4032