|
From: <he...@us...> - 2013-05-02 16:58:08
|
Revision: 174
http://sourceforge.net/p/pdbsql/code/174
Author: herwinw
Date: 2013-05-02 16:58:05 +0000 (Thu, 02 May 2013)
Log Message:
-----------
Added branch for samba 3.6
This has not been tested in any way, it just compiles with these changes and that's about it.
Modified Paths:
--------------
branches/pdbsql_36/pdb_multi.c
branches/pdbsql_36/pdb_mysql.c
branches/pdbsql_36/pdb_pgsql.c
branches/pdbsql_36/pdb_sql.h
Added Paths:
-----------
branches/pdbsql_36/
Modified: branches/pdbsql_36/pdb_multi.c
===================================================================
--- branches/pdbsql_34/pdb_multi.c 2010-02-18 19:49:59 UTC (rev 173)
+++ branches/pdbsql_36/pdb_multi.c 2013-05-02 16:58:05 UTC (rev 174)
@@ -20,13 +20,14 @@
* TODO
* * Volker commited Trust domain passwords to be included in the pdb.
* These need to be added here:
- * bool get_trusteddom_pw(struct pdb_methods *methods, const char *domain, char **pwd, DOM_SID *sid, time_t *pass_last_set_time)
- * bool set_trusteddom_pw(struct pdb_methods *methods, const char *domain, const char *pwd, const DOM_SID *sid)
+ * bool get_trusteddom_pw(struct pdb_methods *methods, const char *domain, char **pwd, struct dom_sid *sid, time_t *pass_last_set_time)
+ * bool set_trusteddom_pw(struct pdb_methods *methods, const char *domain, const char *pwd, const struct dom_sid *sid)
* bool del_trusteddom_pw(struct pdb_methods *methods, const char *domain)
* NTSTATUS enum_trusteddoms(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, uint32 *num_domains, struct trustdom_info ***domains)
*/
#include "includes.h"
+#include "passdb.h"
static int multisam_debug_level = DBGC_ALL;
@@ -172,7 +173,7 @@
static bool multisam_search_aliases(struct pdb_methods *methods,
struct pdb_search *search,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
return false;
}
@@ -222,7 +223,7 @@
/* Tries gid_to_sid on every backend until one succeeds, returns true on success */
static bool multisam_gid_to_sid(struct pdb_methods *methods, gid_t gid,
- DOM_SID *sid)
+ struct dom_sid *sid)
{
short i;
struct multisam_data *data;
@@ -244,7 +245,7 @@
/* Tries sid_to_id on every backend until one succeeds, returns true on success */
static bool multisam_sid_to_id(struct pdb_methods *methods,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
union unid_t *id, enum lsa_SidType *type)
{
short i;
@@ -324,7 +325,7 @@
static NTSTATUS multisam_enum_group_memberships(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
struct samu *user,
- DOM_SID **pp_sids,
+ struct dom_sid **pp_sids,
gid_t **pp_gids,
size_t *p_num_groups)
{
@@ -335,7 +336,7 @@
static NTSTATUS multisam_enum_group_members(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- const DOM_SID *group,
+ const struct dom_sid *group,
uint32 **pp_member_rids,
size_t *p_num_members)
{
@@ -360,7 +361,7 @@
}
static NTSTATUS multisam_getgrsid(struct pdb_methods *methods, GROUP_MAP *map,
- DOM_SID sid)
+ struct dom_sid sid)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
@@ -420,7 +421,7 @@
}
static NTSTATUS multisam_delete_group_mapping_entry(struct pdb_methods *methods,
- DOM_SID sid)
+ struct dom_sid sid)
{
short i;
struct multisam_data *data;
@@ -441,7 +442,7 @@
#if 0
static NTSTATUS multisam_enum_group_mapping(struct pdb_methods *methods,
- const DOM_SID *sid, enum SID_NAME_USE sid_name_use,
+ const struct dom_sid *sid, enum SID_NAME_USE sid_name_use,
GROUP_MAP **pp_rmap, size_t *p_num_entries,
bool unix_only)
{
@@ -450,7 +451,7 @@
}
static NTSTATUS multisam_find_alias(struct pdb_methods *methods,
- const char *name, DOM_SID *sid)
+ const char *name, struct dom_sid *sid)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
@@ -464,14 +465,14 @@
}
static NTSTATUS multisam_delete_alias(struct pdb_methods *methods,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS multisam_get_aliasinfo(struct pdb_methods *methods,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct acct_info *info)
{
DEBUG(1, ("This function is not implemented yet\n"));
@@ -479,7 +480,7 @@
}
static NTSTATUS multisam_set_aliasinfo(struct pdb_methods *methods,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct acct_info *info)
{
DEBUG(1, ("This function is not implemented yet\n"));
@@ -487,21 +488,21 @@
}
static NTSTATUS multisam_add_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias, const DOM_SID *member)
+ const struct dom_sid *alias, const struct dom_sid *member)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS multisam_del_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias, const DOM_SID *member)
+ const struct dom_sid *alias, const struct dom_sid *member)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
}
NTSTATUS multisam_enum_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias, DOM_SID **pp_members,
+ const struct dom_sid *alias, struct dom_sid **pp_members,
size_t *p_num_members)
{
DEBUG(1, ("This function is not implemented yet\n"));
@@ -510,8 +511,8 @@
static NTSTATUS multisam_alias_memberships(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
- const DOM_SID *members,
+ const struct dom_sid *domain_sid,
+ const struct dom_sid *members,
size_t num_members,
uint32 **pp_alias_rids,
size_t *p_num_alias_rids)
@@ -615,7 +616,7 @@
**************************************************************************/
/* Tries to find the account in all backends until it succeeds or runs out of backends */
static NTSTATUS multisam_getsampwsid(struct pdb_methods *methods, struct samu * user,
- const DOM_SID * sid)
+ const struct dom_sid * sid)
{
short i;
struct multisam_data *data;
@@ -703,7 +704,7 @@
#if 0
static NTSTATUS multisam_lookup_rids(struct pdb_methods *methods,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_rids,
uint32 *rids,
const char **names,
Modified: branches/pdbsql_36/pdb_mysql.c
===================================================================
--- branches/pdbsql_34/pdb_mysql.c 2010-02-18 19:49:59 UTC (rev 173)
+++ branches/pdbsql_36/pdb_mysql.c 2013-05-02 16:58:05 UTC (rev 174)
@@ -20,13 +20,14 @@
* TODO
* * Volker commited Trust domain passwords to be included in the pdb.
* These need to be added here:
- * bool get_trusteddom_pw(struct pdb_methods *methods, const char *domain, char **pwd, DOM_SID *sid, time_t *pass_last_set_time)
- * bool set_trusteddom_pw(struct pdb_methods *methods, const char *domain, const char *pwd, const DOM_SID *sid)
+ * bool get_trusteddom_pw(struct pdb_methods *methods, const char *domain, char **pwd, struct dom_sid *sid, time_t *pass_last_set_time)
+ * bool set_trusteddom_pw(struct pdb_methods *methods, const char *domain, const char *pwd, const struct dom_sid *sid)
* bool del_trusteddom_pw(struct pdb_methods *methods, const char *domain)
* NTSTATUS enum_trusteddoms(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, uint32 *num_domains, struct trustdom_info ***domains)
*/
#include "pdb_sql.h"
+#include "libcli/security/dom_sid.h"
#include <mysql.h>
#include <errmsg.h>
@@ -123,10 +124,8 @@
{
MYSQL_ROW row;
unsigned char pwd[16];
- unsigned int num_fields;
- DOM_SID sid;
+ struct dom_sid sid;
- num_fields = mysql_num_fields(r);
row = mysql_fetch_row(r);
if (!row) {
DEBUG(10, ("empty result"));
@@ -179,7 +178,7 @@
pdb_set_bad_password_count(u, xatol(row[26]), PDB_SET);
pdb_set_logon_count(u, xatol(row[27]), PDB_SET);
pdb_set_unknown_6(u, xatol(row[28]), PDB_SET);
- pdb_set_hours(u, (uint8 *)row[29], PDB_SET);
+ pdb_set_hours(u, (uint8 *)row[29], xatol(row[25]), PDB_SET);
if (row[30]) {
uint8 pwhist[MAX_PW_HISTORY_LEN * PW_HISTORY_ENTRY_LEN];
@@ -284,7 +283,7 @@
**************************************************************************/
static NTSTATUS mysqlsam_getsampwsid(struct pdb_methods *methods, struct samu * user,
- const DOM_SID * sid)
+ const struct dom_sid * sid)
{
struct pdb_mysql_data *data;
fstring sid_str;
@@ -436,7 +435,7 @@
struct mysqlsam_search_state *state = talloc_get_type_abort(
search->private_data, struct mysqlsam_search_state);
MYSQL_ROW row;
- DOM_SID sid;
+ struct dom_sid sid;
if (state->current >= state->num_entries) {
return false;
Modified: branches/pdbsql_36/pdb_pgsql.c
===================================================================
--- branches/pdbsql_34/pdb_pgsql.c 2010-02-18 19:49:59 UTC (rev 173)
+++ branches/pdbsql_36/pdb_pgsql.c 2013-05-02 16:58:05 UTC (rev 174)
@@ -21,13 +21,14 @@
* TODO
* * Volker commited Trust domain passwords to be included in the pdb.
* These need to be added here:
- * bool get_trusteddom_pw(struct pdb_methods *methods, const char *domain, char **pwd, DOM_SID *sid, time_t *pass_last_set_time)
- * bool set_trusteddom_pw(struct pdb_methods *methods, const char *domain, const char *pwd, const DOM_SID *sid)
+ * bool get_trusteddom_pw(struct pdb_methods *methods, const char *domain, char **pwd, struct dom_sid *sid, time_t *pass_last_set_time)
+ * bool set_trusteddom_pw(struct pdb_methods *methods, const char *domain, const char *pwd, const struct dom_sid *sid)
* bool del_trusteddom_pw(struct pdb_methods *methods, const char *domain)
* NTSTATUS enum_trusteddoms(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, uint32 *num_domains, struct trustdom_info ***domains)
*/
#include "pdb_sql.h"
+#include "libcli/security/dom_sid.h"
#include <libpq-fe.h>
/* To prevent duplicate defines */
@@ -165,7 +166,7 @@
static NTSTATUS row_to_sam_account (PGresult *r, long row, struct samu *u)
{
unsigned char temp[16];
- DOM_SID sid;
+ struct dom_sid sid;
unsigned char *hours;
size_t hours_len = 0;
@@ -203,7 +204,7 @@
if (hours != NULL) {
hours = PQunescapeBytea(hours, &hours_len);
if (hours_len > 0) {
- pdb_set_hours(u, hours, PDB_SET);
+ pdb_set_hours(u, hours, PQgetlong(r, row, 25), PDB_SET);
}
}
@@ -318,7 +319,8 @@
lowercasename = talloc_strdup(data, sname);
l = strlen(lowercasename);
for(i = 0; i < l; i++) {
- lowercasename[i] = tolower_ascii(lowercasename[i]);
+ smb_ucs2_t uc = tolower_w(UCS2_CHAR(lowercasename[i]));
+ lowercasename[i] = UCS2_TO_CHAR(uc);
}
result = pgsqlsam_select_by_field(methods, user, SQL_SEARCH_USER_NAME, lowercasename);
@@ -333,13 +335,10 @@
Search by sid
**************************************************************************/
-static NTSTATUS pgsqlsam_getsampwsid(struct pdb_methods *methods, struct samu *user, const DOM_SID *sid)
+static NTSTATUS pgsqlsam_getsampwsid(struct pdb_methods *methods, struct samu *user, const struct dom_sid *sid)
{
- struct pdb_pgsql_data *data;
fstring sid_str;
- SET_DATA(data, methods);
-
sid_to_fstring(sid_str, sid);
return pgsqlsam_select_by_field(methods, user, SQL_SEARCH_USER_SID, sid_str);
@@ -465,7 +464,7 @@
struct samr_displayentry *entry)
{
struct pdb_pgsql_search_state *search_state;
- DOM_SID sid;
+ struct dom_sid sid;
PGresult *r;
long row;
Modified: branches/pdbsql_36/pdb_sql.h
===================================================================
--- branches/pdbsql_34/pdb_sql.h 2010-02-18 19:49:59 UTC (rev 173)
+++ branches/pdbsql_36/pdb_sql.h 2013-05-02 16:58:05 UTC (rev 174)
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "passdb.h"
#ifndef _PDB_SQL_H
#define _PDB_SQL_H
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|