|
From: <co...@us...> - 2008-07-11 14:02:44
|
Revision: 130
http://pdbsql.svn.sourceforge.net/pdbsql/?rev=130&view=rev
Author: collen
Date: 2008-07-11 07:02:52 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
fix for net sam user (mysql only,sorry)
fix for net sam workstation (mysql only, sorry)
Modified Paths:
--------------
branches/pdbsql_3_2/pdb_mysql.c
Modified: branches/pdbsql_3_2/pdb_mysql.c
===================================================================
--- branches/pdbsql_3_2/pdb_mysql.c 2008-07-07 08:50:28 UTC (rev 129)
+++ branches/pdbsql_3_2/pdb_mysql.c 2008-07-11 14:02:52 UTC (rev 130)
@@ -444,21 +444,11 @@
uint32_t acct_flags;
MYSQL_RES *pwent;
+// struct samr_displayentry *entries;
uint32_t num_entries;
uint32_t current;
};
-
/****************************/
-static void mysqlsam_search_end(struct pdb_search *search)
-{
- struct mysqlsam_search_state *state = talloc_get_type_abort(
- search->private_data, struct mysqlsam_search_state);
- if (state->pwent != NULL) {
- mysql_free_result(state->pwent);
- }
- DEBUG(5, ("End of entries reached\n"));
-}
-/****************************/
static bool mysqlsam_search_next_entry(struct pdb_search *search,
struct samr_displayentry *entry)
{
@@ -466,20 +456,45 @@
search->private_data, struct mysqlsam_search_state);
MYSQL_ROW row;
DOM_SID sid;
+ struct samu *user = NULL;
if (state->current >= state->num_entries) {
return false;
}
+
+
row = mysql_fetch_row(state->pwent);
if (row[18]) {
string_to_sid(&sid, row[18]);
entry->rid = sid.sub_auths[4];
}
+ entry->acct_flags = talloc_strdup(search->mem_ctx,row[23]);
+ entry->account_name = talloc_strdup(search->mem_ctx,row[6]);
+ entry->fullname = talloc_strdup(search->mem_ctx,row[9]);
+ entry->description = talloc_strdup(search->mem_ctx,row[14]);
+
state->current += 1;
+ TALLOC_FREE(user);
+
+ if ((entry->account_name == NULL)) {
+ DEBUG(0, ("talloc_strdup failed\n"));
+ return false;
+ }
return true;
}
+/****************************/
+static void mysqlsam_search_end(struct pdb_search *search)
+{
+ struct mysqlsam_search_state *state = talloc_get_type_abort(
+ search->private_data, struct mysqlsam_search_state);
+ if (state->pwent != NULL) {
+ mysql_free_result(state->pwent);
+ }
+ DEBUG(5, ("End of entries reached\n"));
+}
+/****************************/
/* Enum user list*/
static bool mysqlsam_search_users(struct pdb_methods *methods,
struct pdb_search *search,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|