|
From: <co...@us...> - 2008-07-07 08:50:19
|
Revision: 129
http://pdbsql.svn.sourceforge.net/pdbsql/?rev=129&view=rev
Author: collen
Date: 2008-07-07 01:50:28 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
Clean up
Modified Paths:
--------------
branches/pdbsql_3_2/AUTHORS
branches/pdbsql_3_2/pdb_mysql.c
branches/pdbsql_3_2/pdb_pgsql.c
branches/pdbsql_3_2/pdb_sql.c
Modified: branches/pdbsql_3_2/AUTHORS
===================================================================
--- branches/pdbsql_3_2/AUTHORS 2008-07-06 15:26:26 UTC (rev 128)
+++ branches/pdbsql_3_2/AUTHORS 2008-07-07 08:50:28 UTC (rev 129)
@@ -1,5 +1,6 @@
Current maintainer:
Collen Blijenberg
+Herwin Weststrate
original authors:
Jelmer Vernooij <je...@sa...> (pdbsql core / pdb_mysql / pdb_multi)
Modified: branches/pdbsql_3_2/pdb_mysql.c
===================================================================
--- branches/pdbsql_3_2/pdb_mysql.c 2008-07-06 15:26:26 UTC (rev 128)
+++ branches/pdbsql_3_2/pdb_mysql.c 2008-07-07 08:50:28 UTC (rev 129)
@@ -166,99 +166,6 @@
return NT_STATUS_OK;
}
-//static NTSTATUS mysqlsam_setsampwent(struct pdb_methods *methods, bool update, uint32 acb_mask)
-//{
-// struct pdb_mysql_data *data =
-// (struct pdb_mysql_data *) methods->private_data;
-// char *query;
-// int mysql_ret;
-//
-// if (!data || !(data->handle)) {
-// DEBUG(0, ("invalid handle!\n"));
-// return NT_STATUS_INVALID_HANDLE;
-// }
-//
-// query = sql_account_query_select(NULL, data->location, update, SQL_SEARCH_NONE, NULL);
-//
-// mysql_ret = mysql_query(data->handle, query);
-//
-// /* [SYN] If the server has gone away, reconnect and retry */
-// if (mysql_ret && mysql_errno(data->handle) == CR_SERVER_GONE_ERROR) {
-// DEBUG(5, ("MySQL server has gone away, reconnecting and retrying.\n"));
-//
-// /* [SYN] Reconnect */
-// if (!NT_STATUS_IS_OK(pdb_mysql_connect(data))) {
-// DEBUG(0, ("Error: Lost connection to MySQL server\n"));
-// talloc_free(query);
-// return NT_STATUS_UNSUCCESSFUL;
-// }
-// /* [SYN] Retry */
-// mysql_ret = mysql_query(data->handle, query);
-// }
-//
-// talloc_free(query);
-//
-// if (mysql_ret) {
-// DEBUG(0,
-// ("Error executing MySQL query %s\n", mysql_error(data->handle)));
-// return NT_STATUS_UNSUCCESSFUL;
-// }
-//
-// data->pwent = mysql_store_result(data->handle);
-//
-// if (data->pwent == NULL) {
-// DEBUG(0,
-// ("Error storing results: %s\n", mysql_error(data->handle)));
-// return NT_STATUS_UNSUCCESSFUL;
-// }
-//
-// DEBUG(5,
-// ("mysqlsam_setsampwent succeeded(%llu results)!\n",
-// mysql_num_rows(data->pwent)));
-//
-// return NT_STATUS_OK;
-//}
-
-/***************************************************************
- End enumeration of the passwd list.
- ****************************************************************/
-
-//static void mysqlsam_endsampwent(struct pdb_methods *methods)
-//{
-// struct pdb_mysql_data *data =
-// (struct pdb_mysql_data *) methods->private_data;
-//
-// if (data == NULL) {
-// DEBUG(0, ("invalid handle!\n"));
-// return;
-// }
-//
-// if (data->pwent != NULL)
-// mysql_free_result(data->pwent);
-//
-// data->pwent = NULL;
-//
-// DEBUG(5, ("mysql_endsampwent called\n"));
-//}
-
-/*****************************************************************
- Get one struct samu from the list (next in line)
- *****************************************************************/
-
-//static NTSTATUS mysqlsam_getsampwent(struct pdb_methods *methods, struct samu * user)
-//{
-// struct pdb_mysql_data *data;
-//
-// SET_DATA(data, methods);
-//
-// if (data->pwent == NULL) {
-// DEBUG(0, ("invalid pwent\n"));
-// return NT_STATUS_INVALID_PARAMETER;
-// }
-//
-// return row_to_sam_account(data->pwent, user);
-//}
-
static NTSTATUS mysqlsam_select_by_field(struct pdb_methods * methods, struct samu * user,
enum sql_search_field field, const char *sname)
{
@@ -533,7 +440,6 @@
return False;
}
-/****************************/
struct mysqlsam_search_state {
uint32_t acct_flags;
@@ -541,6 +447,7 @@
uint32_t num_entries;
uint32_t current;
};
+
/****************************/
static void mysqlsam_search_end(struct pdb_search *search)
{
@@ -573,7 +480,7 @@
state->current += 1;
return true;
}
-/****************************/
+/* Enum user list*/
static bool mysqlsam_search_users(struct pdb_methods *methods,
struct pdb_search *search,
uint32 acct_flags)
@@ -625,8 +532,6 @@
("Error storing results: %s\n", mysql_error(data->handle)));
return false;
}
-// state->methods = methods;
-// db_sam->traverse_read(db_sam, tdbsam_collect_rids, state);
state->num_entries = mysql_num_rows(state->pwent);
DEBUG(5, ("Found %d results\n", state->num_entries));
@@ -663,18 +568,6 @@
(*pdb_method)->rid_algorithm = mysqlsam_rid_algorithm;
(*pdb_method)->new_rid = mysqlsam_new_rid;
-/* (*pdb_method)->rename_sam_account = mysqlsam_rename_sam_account; */
-/* (*pdb_method)->getgrsid = mysqlsam_getgrsid; */
-/* (*pdb_method)->getgrgid = mysqlsam_getgrgid; */
-/* (*pdb_method)->getgrnam = mysqlsam_getgrnam; */
-/* (*pdb_method)->add_group_mapping_entry = mysqlsam_add_group_mapping_entry; */
-/* (*pdb_method)->update_group_mapping_entry = mysqlsam_update_group_mapping_entry; */
-/* (*pdb_method)->delete_group_mapping_entry = mysqlsam_delete_group_mapping_entry; */
-/* (*pdb_method)->enum_group_mapping = mysqlsam_enum_group_mapping; */
-/* (*pdb_method)->get_account_policy = mysqlsam_get_account_policy; */
-/* (*pdb_method)->set_account_policy = mysqlsam_set_account_policy; */
-/* (*pdb_method)->get_seq_num = mysqlsam_get_seq_num; */
-
data = talloc(*pdb_method, struct pdb_mysql_data);
(*pdb_method)->private_data = data;
data->handle = NULL;
@@ -721,4 +614,3 @@
{
return init_samba_module();
}
-
Modified: branches/pdbsql_3_2/pdb_pgsql.c
===================================================================
--- branches/pdbsql_3_2/pdb_pgsql.c 2008-07-06 15:26:26 UTC (rev 128)
+++ branches/pdbsql_3_2/pdb_pgsql.c 2008-07-07 08:50:28 UTC (rev 129)
@@ -236,87 +236,6 @@
return NT_STATUS_OK;
}
-//static NTSTATUS pgsqlsam_setsampwent(struct pdb_methods *methods, bool update, uint32 acb_mask)
-//{
-// struct pdb_pgsql_data *data;
-// PGconn *handle;
-// char *query;
-// NTSTATUS retval;
-//
-// SET_DATA(data, methods);
-//
-// /* Connect to the DB. */
-// handle = choose_connection(data);
-// if (handle == NULL) {
-// return NT_STATUS_UNSUCCESSFUL;
-// }
-// DEBUG(5, ("CONNECTING pgsqlsam_setsampwent\n"));
-//
-// query = sql_account_query_select(NULL, data->location, update, SQL_SEARCH_NONE, NULL);
-//
-// /* Execute query */
-// DEBUG(5, ("Executing query %s\n", query));
-// data->pwent = PQexec(handle, query);
-// data->currow = 0;
-//
-// /* Result? */
-// if (data->pwent == NULL) {
-// DEBUG(0, ("Error executing %s, %s\n", query, PQerrorMessage(handle)));
-// retval = NT_STATUS_UNSUCCESSFUL;
-// } else if (PQresultStatus(data->pwent) != PGRES_TUPLES_OK) {
-// DEBUG(0, ("Error executing %s, %s\n", query, PQresultErrorMessage(data->pwent)));
-// retval = NT_STATUS_UNSUCCESSFUL;
-// } else {
-// DEBUG(5, ("pgsqlsam_setsampwent succeeded(%d results)!\n", PQntuples(data->pwent)));
-// retval = NT_STATUS_OK;
-// }
-//
-// talloc_free(query);
-// return retval;
-//}
-
-/***************************************************************
- End enumeration of the passwd list.
- ****************************************************************/
-
-//static void pgsqlsam_endsampwent(struct pdb_methods *methods)
-//{
-// struct pdb_pgsql_data *data;
-//
-// SET_DATA_QUIET(data, methods);
-//
-// if (data->pwent != NULL) {
-// PQclear(data->pwent);
-// }
-//
-// data->pwent = NULL;
-// data->currow = 0;
-//
-// DEBUG(5, ("pgsql_endsampwent called\n"));
-//}
-
-/*****************************************************************
- Get one struct samu from the list (next in line)
- *****************************************************************/
-
-//static NTSTATUS pgsqlsam_getsampwent(struct pdb_methods *methods, struct samu *user)
-//{
-// struct pdb_pgsql_data *data;
-// NTSTATUS retval;
-//
-// SET_DATA(data, methods);
-//
-// if (data->pwent == NULL) {
-// DEBUG(0, ("invalid pwent\n"));
-// return NT_STATUS_INVALID_PARAMETER;
-// }
-//
-// retval = row_to_sam_account(data->pwent, data->currow, user);
-// data->currow++;
-//
-// return retval;
-//}
-
static NTSTATUS pgsqlsam_select_by_field(struct pdb_methods *methods, struct samu *user, enum sql_search_field field, const char *sname)
{
struct pdb_pgsql_data *data;
@@ -700,18 +619,6 @@
(*pdb_method)->rid_algorithm = pgsqlsam_rid_algorithm;
(*pdb_method)->new_rid = pgsqlsam_new_rid;
-/* (*pdb_method)->rename_sam_account = pgsqlsam_rename_sam_account; */
-/* (*pdb_method)->getgrsid = pgsqlsam_getgrsid; */
-/* (*pdb_method)->getgrgid = pgsqlsam_getgrgid; */
-/* (*pdb_method)->getgrnam = pgsqlsam_getgrnam; */
-/* (*pdb_method)->add_group_mapping_entry = pgsqlsam_add_group_mapping_entry; */
-/* (*pdb_method)->update_group_mapping_entry = pgsqlsam_update_group_mapping_entry; */
-/* (*pdb_method)->delete_group_mapping_entry = pgsqlsam_delete_group_mapping_entry; */
-/* (*pdb_method)->enum_group_mapping = pgsqlsam_enum_group_mapping; */
-/* (*pdb_method)->get_account_policy = pgsqlsam_get_account_policy; */
-/* (*pdb_method)->set_account_policy = pgsqlsam_set_account_policy; */
-/* (*pdb_method)->get_seq_num = pgsqlsam_get_seq_num; */
-
data = talloc(*pdb_method, struct pdb_pgsql_data);
(*pdb_method)->private_data = data;
Modified: branches/pdbsql_3_2/pdb_sql.c
===================================================================
--- branches/pdbsql_3_2/pdb_sql.c 2008-07-06 15:26:26 UTC (rev 128)
+++ branches/pdbsql_3_2/pdb_sql.c 2008-07-07 08:50:28 UTC (rev 129)
@@ -422,7 +422,6 @@
config_value_write(location, "group sid column",
CONFIG_GROUP_SID_DEFAULT),
sid_to_fstring(sid_str,
-// sid_string_dbg(sid,
pdb_get_group_sid(newpwd)));
}
@@ -582,7 +581,6 @@
"user sid column",
CONFIG_USER_SID_DEFAULT),
sid_to_fstring(sid_str, pdb_get_user_sid (newpwd)));
-// sid_string_dbg(pdb_get_user_sid (newpwd)));
} else {
query->part2[strlen(query->part2) - 1] = ')';
query->part1[strlen(query->part1) - 1] = ')';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|