|
From: <he...@us...> - 2013-05-10 21:20:32
|
Revision: 178
http://sourceforge.net/p/pdbsql/code/178
Author: herwinw
Date: 2013-05-10 21:20:29 +0000 (Fri, 10 May 2013)
Log Message:
-----------
Make it possible to add users in pdb_pgsql
* Removed the PDB_CAP_STORE_RIDS capability, since we aren't interested in generating them ourselves. (This should probably happen to pdb_mysql too, but haven't had the time to test that)
* See PGRES_COMMAND_OK as a valid return value from libpq which means our query has succeeded
* Removed update of login_hours column. It failed using postgres (something about encoding)
Modified Paths:
--------------
branches/pdbsql_36/pdb_pgsql.c
branches/pdbsql_36/pdb_sql.c
Modified: branches/pdbsql_36/pdb_pgsql.c
===================================================================
--- branches/pdbsql_36/pdb_pgsql.c 2013-05-10 19:27:13 UTC (rev 177)
+++ branches/pdbsql_36/pdb_pgsql.c 2013-05-10 21:20:29 UTC (rev 178)
@@ -145,10 +145,13 @@
/* Will happen mostly because the server has been disconnected */
DEBUG(1, ("Error executing %s, %s (trying to recover with reconnect)\n", query, PQerrorMessage(data->handle)));
PQreset(data->handle);
- } else if (PQresultStatus(result) != PGRES_TUPLES_OK) {
- DEBUG(1, ("Error executing %s, %s\n", query, PQresultErrorMessage(result)));
- PQclear(result);
- result = NULL;
+ } else {
+ int status = PQresultStatus(result);
+ if (status != PGRES_TUPLES_OK && status != PGRES_COMMAND_OK) {
+ DEBUG(1, ("Error executing %s, %s\n", query, PQresultErrorMessage(result)));
+ PQclear(result);
+ result = NULL;
+ }
}
return result;
@@ -449,13 +452,9 @@
#else
static uint32_t pgsqlsam_capabilities(struct pdb_methods *pdb_methods)
{
- return PDB_CAP_STORE_RIDS | PDB_CAP_ADS;
+ return PDB_CAP_ADS;
}
#endif
-static bool pgsqlsam_new_rid(struct pdb_methods *pdb_methods, uint32 *rid)
-{
- return false;
-}
/* Iterate through search results, if a new entry is available: store in
* entry and return true. Otherwise: return false
@@ -604,7 +603,6 @@
#else
(*pdb_method)->capabilities = pgsqlsam_capabilities;
#endif
- (*pdb_method)->new_rid = pgsqlsam_new_rid;
data = talloc(*pdb_method, struct pdb_pgsql_data);
(*pdb_method)->private_data = data;
Modified: branches/pdbsql_36/pdb_sql.c
===================================================================
--- branches/pdbsql_36/pdb_sql.c 2013-05-10 19:27:13 UTC (rev 177)
+++ branches/pdbsql_36/pdb_sql.c 2013-05-10 21:20:29 UTC (rev 178)
@@ -536,6 +536,8 @@
CONFIG_NT_PW_DEFAULT), temp);
}
+/* FIXME This currently gives an error about encoding in postgres. Fix it */
+#if 0
if (!isupdate || IS_SAM_CHANGED(newpwd, PDB_HOURS)) {
some_field_affected = 1;
pdb_sql_string_field(query,
@@ -544,6 +546,7 @@
CONFIG_LOGON_HOURS_DEFAULT),
(const char *)pdb_get_hours(newpwd));
}
+#endif
if (!isupdate || IS_SAM_CHANGED(newpwd, PDB_PWHISTORY)) {
uint32 pw_history_len = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|