|
From: <he...@us...> - 2013-05-10 19:27:17
|
Revision: 177
http://sourceforge.net/p/pdbsql/code/177
Author: herwinw
Date: 2013-05-10 19:27:13 +0000 (Fri, 10 May 2013)
Log Message:
-----------
Lot of whitespace fixes
* Removed trailing whitespace (which will be great if we ever want to import the project into git)
* Uniformized on tabs instead of a mix of tabs and spaces
* Some reindenting (mainly just a gg=G in vim)
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.c
branches/pdbsql_36/pdb_sql.h
Modified: branches/pdbsql_36/pdb_multi.c
===================================================================
--- branches/pdbsql_36/pdb_multi.c 2013-05-03 17:26:24 UTC (rev 176)
+++ branches/pdbsql_36/pdb_multi.c 2013-05-10 19:27:13 UTC (rev 177)
@@ -66,7 +66,7 @@
if (res == true)
return true;
}
-
+
return false;
}
@@ -86,8 +86,8 @@
}
static bool multisam_search_users(struct pdb_methods *methods,
- struct pdb_search *search,
- uint32 acct_flags)
+ struct pdb_search *search,
+ uint32 acct_flags)
{
struct multisam_search_state *state;
struct multisam_data *data;
@@ -136,16 +136,16 @@
static bool multisam_new_rid(struct pdb_methods *methods,
uint32 *rid,
- short backend)
+ short backend)
{
short i;
struct multisam_data *data;
-
+
if (!methods) return false;
data = (struct multisam_data *)methods->private_data;
if (!data) return false;
-
-
+
+
/* 250 tries.. Andrew Bartlett picked the number. */
for (i = 0; *rid == 0 && i < 250; i++) {
if (!data->methods[backend]->new_rid(data->methods[backend], rid)) {
@@ -156,24 +156,24 @@
*rid = 0;
} */
}
-
+
if (*rid == 0) {
return false;
}
-
+
return true;
}
#if 0
static bool multisam_search_groups(struct pdb_methods *methods,
- struct pdb_search *search)
+ struct pdb_search *search)
{
return false;
}
static bool multisam_search_aliases(struct pdb_methods *methods,
- struct pdb_search *search,
- const struct dom_sid *sid)
+ struct pdb_search *search,
+ const struct dom_sid *sid)
{
return false;
}
@@ -200,76 +200,76 @@
#if PASSDB_INTERFACE_VERSION < 19
/* Tries uid_to_rid on every backend until one succeeds, returns true on success */
static bool multisam_uid_to_rid(struct pdb_methods *methods, uid_t uid,
- uint32 *rid)
+ uint32 *rid)
{
short i;
struct multisam_data *data;
bool rv;
-
+
if (!methods) return false;
data = (struct multisam_data *)methods->private_data;
if (!data) return false;
-
+
for (i = 0; i < data->num_backends; i++) {
rv = data->methods[i]->uid_to_rid(data->methods[i], uid, rid);
if (rv == true) {
return true;
}
}
-
+
return false;
}
#endif
/* 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,
- struct dom_sid *sid)
+ struct dom_sid *sid)
{
short i;
struct multisam_data *data;
bool rv;
-
+
if (!methods) return false;
data = (struct multisam_data *)methods->private_data;
if (!data) return false;
-
+
for (i = 0; i < data->num_backends; i++) {
rv = data->methods[i]->gid_to_sid(data->methods[i], gid, sid);
if (rv == true) {
return true;
}
}
-
+
return false;
}
/* 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 struct dom_sid *sid,
- union unid_t *id, enum lsa_SidType *type)
+ const struct dom_sid *sid,
+ union unid_t *id, enum lsa_SidType *type)
{
short i;
struct multisam_data *data;
bool rv;
-
+
if (!methods) return false;
data = (struct multisam_data *)methods->private_data;
if (!data) return false;
-
+
for (i = 0; i < data->num_backends; i++) {
rv = data->methods[i]->sid_to_id(data->methods[i], sid, id, type);
if (rv == true) {
return true;
}
}
-
+
return false;
}
#if 0
static NTSTATUS multisam_set_unix_primary_group(struct pdb_methods *methods,
- TALLOC_CTX *mem_ctx,
- struct samu *sampass)
+ TALLOC_CTX *mem_ctx,
+ struct samu *sampass)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
@@ -281,9 +281,9 @@
uint32 acb_info, uint32 *rid)
{
struct multisam_data *data;
-
+
SET_DATA(data, methods);
-
+
DEBUG(0, ("Creating user in first multisam backend\n"));
/* XXX Might be nice to allow separations of machine accounts here? */
@@ -299,8 +299,8 @@
multisam_new_rid(methods, rid, 0);
}
#endif
-
- return data->methods[0]->create_user(data->methods[0], tmp_ctx, name, acb_info, rid);
+
+ return data->methods[0]->create_user(data->methods[0], tmp_ctx, name, acb_info, rid);
}
static NTSTATUS multisam_delete_user(struct pdb_methods *methods,
@@ -311,7 +311,7 @@
struct multisam_data *data;
SET_DATA(data, methods);
-
+
for (i = 0; i < data->num_backends; i++) {
if (NT_STATUS_IS_OK(data->methods[i]->delete_user(data->methods[i], mem_ctx, sam_acct))) {
return NT_STATUS_OK;
@@ -323,11 +323,11 @@
#if 0
static NTSTATUS multisam_enum_group_memberships(struct pdb_methods *methods,
- TALLOC_CTX *mem_ctx,
- struct samu *user,
- struct dom_sid **pp_sids,
- gid_t **pp_gids,
- size_t *p_num_groups)
+ TALLOC_CTX *mem_ctx,
+ struct samu *user,
+ struct dom_sid **pp_sids,
+ gid_t **pp_gids,
+ size_t *p_num_groups)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
@@ -346,8 +346,8 @@
static NTSTATUS multisam_delete_dom_group(struct pdb_methods *methods,
- TALLOC_CTX *mem_ctx,
- uint32 rid)
+ TALLOC_CTX *mem_ctx,
+ uint32 rid)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
@@ -361,21 +361,21 @@
}
static NTSTATUS multisam_getgrsid(struct pdb_methods *methods, GROUP_MAP *map,
- struct dom_sid sid)
+ struct dom_sid sid)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS multisam_getgrgid(struct pdb_methods *methods, GROUP_MAP *map,
- gid_t gid)
+ gid_t gid)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS multisam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map,
- const char *name)
+ const char *name)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
@@ -396,12 +396,12 @@
return data->methods[i]->add_group_mapping_entry(data->methods[i], map);
}
}
-
+
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS multisam_update_group_mapping_entry(struct pdb_methods *methods,
- GROUP_MAP *map)
+ GROUP_MAP *map)
{
short i;
struct multisam_data *data;
@@ -421,7 +421,7 @@
}
static NTSTATUS multisam_delete_group_mapping_entry(struct pdb_methods *methods,
- struct dom_sid sid)
+ struct dom_sid sid)
{
short i;
struct multisam_data *data;
@@ -442,9 +442,9 @@
#if 0
static NTSTATUS multisam_enum_group_mapping(struct pdb_methods *methods,
- const struct dom_sid *sid, enum SID_NAME_USE sid_name_use,
- GROUP_MAP **pp_rmap, size_t *p_num_entries,
- bool unix_only)
+ const struct dom_sid *sid, enum SID_NAME_USE sid_name_use,
+ GROUP_MAP **pp_rmap, size_t *p_num_entries,
+ bool unix_only)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
@@ -458,64 +458,64 @@
}
static NTSTATUS multisam_create_alias(struct pdb_methods *methods,
- const char *name, uint32 *rid)
+ const char *name, uint32 *rid)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS multisam_delete_alias(struct pdb_methods *methods,
- const struct 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 struct dom_sid *sid,
- struct acct_info *info)
+ const struct dom_sid *sid,
+ struct acct_info *info)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS multisam_set_aliasinfo(struct pdb_methods *methods,
- const struct dom_sid *sid,
- struct acct_info *info)
+ const struct dom_sid *sid,
+ struct acct_info *info)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS multisam_add_aliasmem(struct pdb_methods *methods,
- const struct dom_sid *alias, const struct 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 struct dom_sid *alias, const struct 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 struct dom_sid *alias, struct dom_sid **pp_members,
- size_t *p_num_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"));
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS multisam_alias_memberships(struct pdb_methods *methods,
- TALLOC_CTX *mem_ctx,
- 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)
+ TALLOC_CTX *mem_ctx,
+ 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)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
@@ -531,7 +531,7 @@
NTSTATUS ret;
SET_DATA(data, methods);
-
+
DEBUG(1, ("Setsampwent executing..\n"));
for (i = 0; i < data->num_backends; i++) {
@@ -540,7 +540,7 @@
return ret;
}
}
-
+
return NT_STATUS_OK;
}
@@ -558,7 +558,7 @@
if (!data) return;
DEBUG(1, ("Freeing pwent results on multisam backends\n"));
-
+
for (i = 0; i < data->num_backends; i++) {
data->methods[i]->endsampwent(data->methods[i]);
}
@@ -573,16 +573,16 @@
short i;
struct multisam_data *data;
NTSTATUS ret;
-
+
SET_DATA(data, methods);
-
+
for (i = 0; i < data->num_backends; i++) {
ret = data->methods[i]->getsampwent(data->methods[i], user);
if (NT_STATUS_IS_OK(ret)) {
return ret;
}
}
-
+
return NT_STATUS_INVALID_PARAMETER;
}
#endif
@@ -592,14 +592,14 @@
******************************************************************/
/* Tries to find the account in all backends until it succeeds or runs out of backends */
static NTSTATUS multisam_getsampwnam(struct pdb_methods *methods, struct samu * user,
- const char *sname)
+ const char *sname)
{
short i;
struct multisam_data *data;
NTSTATUS ret;
SET_DATA(data, methods);
-
+
for (i = 0; i < data->num_backends; i++) {
DEBUG(5, ("Looking for user in %s\n", data->names[i]));
if (NT_STATUS_IS_OK(ret = data->methods[i]->getsampwnam(data->methods[i], user, sname))) {
@@ -616,14 +616,14 @@
**************************************************************************/
/* 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 struct dom_sid * sid)
+ const struct dom_sid * sid)
{
short i;
struct multisam_data *data;
NTSTATUS ret;
SET_DATA(data, methods);
-
+
for (i = 0; i < data->num_backends; i++) {
DEBUG(5, ("Looking for user in %s\n", data->names[i]));
if (NT_STATUS_IS_OK(ret = data->methods[i]->getsampwsid(data->methods[i], user, sid))) {
@@ -635,9 +635,9 @@
}
/***************************************************************************
- Delete a sam account
+ Delete a sam account
****************************************************************************/
-/* Tries to delete the user from all backends, if one succeeds we're happy */
+/* Tries to delete the user from all backends, if one succeeds we're happy */
static NTSTATUS multisam_delete_sam_account(struct pdb_methods *methods,
struct samu * sam_pass)
{
@@ -645,7 +645,7 @@
struct multisam_data *data;
SET_DATA(data, methods);
-
+
for (i = 0; i < data->num_backends; i++) {
if (NT_STATUS_IS_OK(data->methods[i]->delete_sam_account(data->methods[i], sam_pass))) {
return NT_STATUS_OK;
@@ -659,9 +659,9 @@
static NTSTATUS multisam_add_sam_account(struct pdb_methods *methods, struct samu * newpwd)
{
struct multisam_data *data;
-
+
SET_DATA(data, methods);
-
+
DEBUG(0, ("Creating sam account in first multisam backend\n"));
return data->methods[0]->add_sam_account(data->methods[0], newpwd);
}
@@ -673,7 +673,7 @@
short i;
struct multisam_data *data;
NTSTATUS ret;
-
+
SET_DATA(data, methods);
DEBUG(5, ("Updating sam account.\n"));
for (i = 0; i < data->num_backends; i++) {
@@ -689,7 +689,7 @@
short i;
struct multisam_data *data;
NTSTATUS ret;
-
+
SET_DATA(data, methods);
DEBUG(5, ("Renaming sam account.\n"));
for (i = 0; i < data->num_backends; i++) {
@@ -704,37 +704,37 @@
#if 0
static NTSTATUS multisam_lookup_rids(struct pdb_methods *methods,
- const struct dom_sid *domain_sid,
- int num_rids,
- uint32 *rids,
- const char **names,
- uint32 *attrs)
+ const struct dom_sid *domain_sid,
+ int num_rids,
+ uint32 *rids,
+ const char **names,
+ uint32 *attrs)
{
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS multisam_create_dom_group(struct pdb_methods *methods,
- TALLOC_CTX *mem_ctx,
- const char *name,
- uint32 *rid)
+ TALLOC_CTX *mem_ctx,
+ const char *name,
+ uint32 *rid)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS multisam_add_groupmem(struct pdb_methods *methods,
- TALLOC_CTX *mem_ctx,
- uint32 group_rid,
- uint32 member_rid)
+ TALLOC_CTX *mem_ctx,
+ uint32 group_rid,
+ uint32 member_rid)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS multisam_del_groupmem(struct pdb_methods *methods,
- TALLOC_CTX *mem_ctx,
- uint32 group_rid,
- uint32 member_rid)
+ TALLOC_CTX *mem_ctx,
+ uint32 group_rid,
+ uint32 member_rid)
{
DEBUG(1, ("This function is not implemented yet\n"));
return NT_STATUS_NOT_IMPLEMENTED;
@@ -771,7 +771,7 @@
if (multisam_debug_level == -1) {
multisam_debug_level = DBGC_ALL;
DEBUG(0,
- ("multisam: Couldn't register custom debugging class!\n"));
+ ("multisam: Couldn't register custom debugging class!\n"));
}
if ( !NT_STATUS_IS_OK(nt_status = make_pdb_method( pdb_method )) ) {
@@ -786,7 +786,7 @@
DEBUG(0, ("Could not create default pdb_method\n"));
return nt_status;
}
-
+
(*pdb_method)->name = "multisam";
/* Mandatory implementation */
@@ -814,8 +814,8 @@
#endif
(*pdb_method)->gid_to_sid = multisam_gid_to_sid;
(*pdb_method)->sid_to_id = multisam_sid_to_id;
-
+
/* Not yet implemented here */
#if 0
(*pdb_method)->update_login_attempts = multisam_update_login_attempts;
@@ -879,10 +879,10 @@
DEBUG(0, ("Unable to find multisam backend %d: %s\n", i, data->names[i]));
return NT_STATUS_UNSUCCESSFUL;
}
-
+
DEBUG(2, ("Found entry point. Loading multisam backend %d: %s\n", i, data->names[i]));
nt_status = entry->init(&data->methods[i], data->locations[i]);
-
+
if (NT_STATUS_IS_ERR(nt_status)) {
return nt_status;
}
@@ -893,11 +893,11 @@
(*pdb_method)->update_group_mapping_entry = multisam_update_group_mapping_entry;
if (!IS_DEFAULT(data->methods[i], delete_group_mapping_entry))
(*pdb_method)->delete_group_mapping_entry = multisam_delete_group_mapping_entry;
- }
+ }
return NT_STATUS_OK;
}
-NTSTATUS init_samba_module(void)
+NTSTATUS init_samba_module(void)
{
return smb_register_passdb(PASSDB_INTERFACE_VERSION, "multi", multisam_init);
}
Modified: branches/pdbsql_36/pdb_mysql.c
===================================================================
--- branches/pdbsql_36/pdb_mysql.c 2013-05-03 17:26:24 UTC (rev 176)
+++ branches/pdbsql_36/pdb_mysql.c 2013-05-10 19:27:13 UTC (rev 177)
@@ -31,11 +31,11 @@
#include <mysql.h>
#include <errmsg.h>
-#define CONFIG_HOST_DEFAULT "localhost"
-#define CONFIG_USER_DEFAULT "samba"
-#define CONFIG_PASS_DEFAULT ""
-#define CONFIG_PORT_DEFAULT "3306"
-#define CONFIG_DB_DEFAULT "samba"
+#define CONFIG_HOST_DEFAULT "localhost"
+#define CONFIG_USER_DEFAULT "samba"
+#define CONFIG_PASS_DEFAULT ""
+#define CONFIG_PORT_DEFAULT "3306"
+#define CONFIG_DB_DEFAULT "samba"
static int mysqlsam_debug_level = DBGC_ALL;
@@ -51,17 +51,17 @@
#define SET_DATA(data,methods) { \
if(!methods){ \
DEBUG(0, ("invalid methods!\n")); \
- return NT_STATUS_INVALID_PARAMETER; \
+ return NT_STATUS_INVALID_PARAMETER; \
} \
data = (struct pdb_mysql_data *)methods->private_data; \
if(!data || !(data->handle)){ \
DEBUG(0, ("invalid handle!\n")); \
- return NT_STATUS_INVALID_HANDLE; \
+ return NT_STATUS_INVALID_HANDLE; \
} \
}
#define config_value( data, name, default_value ) \
- lp_parm_const_string( GLOBAL_SECTION_SNUM, (data)->location, name, default_value )
+ lp_parm_const_string( GLOBAL_SECTION_SNUM, (data)->location, name, default_value )
static long xatol(const char *d)
{
@@ -76,16 +76,16 @@
config_value(data, "mysql user", CONFIG_USER_DEFAULT),
config_value(data, "mysql password", CONFIG_PASS_DEFAULT),
config_value(data, "mysql database", CONFIG_DB_DEFAULT),
- xatol(config_value (data, "mysql port", CONFIG_PORT_DEFAULT)),
+ xatol(config_value (data, "mysql port", CONFIG_PORT_DEFAULT)),
NULL, 0)) {
DEBUG(0,
- ("Failed to connect to mysql database: error: %s\n",
- mysql_error(data->handle)));
+ ("Failed to connect to mysql database: error: %s\n",
+ mysql_error(data->handle)));
return NT_STATUS_UNSUCCESSFUL;
}
-
+
DEBUG(5, ("Connected to mysql db\n"));
-
+
return NT_STATUS_OK;
}
@@ -95,7 +95,7 @@
DEBUG(5, ("Executing query %s\n", query));
res = mysql_query(data->handle, query);
-
+
/* [SYN] If the server has gone away, reconnect and retry */
if (res && mysql_errno(data->handle) == CR_SERVER_GONE_ERROR) {
DEBUG(5, ("MySQL server has gone away, reconnecting and retrying.\n"));
@@ -112,7 +112,7 @@
if (res)
{
DEBUG(0,
- ("Error while executing MySQL query %s\n",
+ ("Error while executing MySQL query %s\n",
mysql_error(data->handle)));
}
@@ -179,15 +179,15 @@
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], xatol(row[25]), PDB_SET);
-
+
if (row[30]) {
uint8 pwhist[MAX_PW_HISTORY_LEN * PW_HISTORY_ENTRY_LEN];
int i;
-
+
memset(&pwhist, 0, MAX_PW_HISTORY_LEN * PW_HISTORY_ENTRY_LEN);
for (i = 0; i < MAX_PW_HISTORY_LEN && i < strlen(row[30])/64; i++) {
pdb_gethexpwd(&(row[30])[i*64], &pwhist[i*PW_HISTORY_ENTRY_LEN]);
- pdb_gethexpwd(&(row[30])[i*64+32],
+ pdb_gethexpwd(&(row[30])[i*64+32],
&pwhist[i*PW_HISTORY_ENTRY_LEN+PW_HISTORY_SALT_LEN]);
}
pdb_set_pw_history(u, pwhist, strlen(row[30])/64, PDB_SET);
@@ -197,7 +197,7 @@
}
static NTSTATUS mysqlsam_select_by_field(struct pdb_methods * methods, struct samu * user,
- enum sql_search_field field, const char *sname)
+ enum sql_search_field field, const char *sname)
{
char *esc_sname;
char *query;
@@ -213,14 +213,14 @@
esc_sname = talloc_array(mem_ctx, char, strlen(sname) * 2 + 1);
if (!esc_sname) {
talloc_free(mem_ctx);
- return NT_STATUS_NO_MEMORY;
+ return NT_STATUS_NO_MEMORY;
}
tmp_sname = talloc_strdup(mem_ctx, sname);
-
+
/* Escape sname */
mysql_real_escape_string(data->handle, esc_sname, tmp_sname,
- strlen(tmp_sname));
+ strlen(tmp_sname));
talloc_free(tmp_sname);
@@ -240,7 +240,7 @@
talloc_free(mem_ctx);
return NT_STATUS_UNSUCCESSFUL;
}
-
+
talloc_free(query);
res = mysql_store_result(data->handle);
if (res == NULL) {
@@ -249,7 +249,7 @@
talloc_free(mem_ctx);
return NT_STATUS_UNSUCCESSFUL;
}
-
+
ret = row_to_sam_account(res, user);
mysql_free_result(res);
talloc_free(mem_ctx);
@@ -262,7 +262,7 @@
******************************************************************/
static NTSTATUS mysqlsam_getsampwnam(struct pdb_methods *methods, struct samu * user,
- const char *sname)
+ const char *sname)
{
struct pdb_mysql_data *data;
@@ -283,7 +283,7 @@
**************************************************************************/
static NTSTATUS mysqlsam_getsampwsid(struct pdb_methods *methods, struct samu * user,
- const struct dom_sid * sid)
+ const struct dom_sid * sid)
{
struct pdb_mysql_data *data;
fstring sid_str;
@@ -292,12 +292,12 @@
sid_to_fstring(sid_str, sid);
/* sid_string_dbg(sid); */
-
+
return mysqlsam_select_by_field(methods, user, SQL_SEARCH_USER_SID, sid_str);
}
/***************************************************************************
- Delete a sam account
+ Delete a sam account
****************************************************************************/
static NTSTATUS mysqlsam_delete_sam_account(struct pdb_methods *methods,
@@ -329,18 +329,18 @@
}
mem_ctx = talloc_init("mysqlsam_delete_sam_account");
-
+
/* Escape sname */
esc = talloc_array(mem_ctx, char, strlen(sname) * 2 + 1);
if (!esc) {
DEBUG(0, ("Can't allocate memory to store escaped name\n"));
return NT_STATUS_NO_MEMORY;
}
-
+
tmp_sname = talloc_strdup(mem_ctx, sname);
-
+
mysql_real_escape_string(data->handle, esc, tmp_sname,
- strlen(tmp_sname));
+ strlen(tmp_sname));
talloc_free(tmp_sname);
@@ -363,7 +363,7 @@
}
static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
- struct samu * newpwd, char isupdate)
+ struct samu * newpwd, char isupdate)
{
struct pdb_mysql_data *data;
char *query;
@@ -384,8 +384,8 @@
query = sql_account_query_update(NULL, data->location, newpwd, isupdate);
if ( query == NULL ) /* Nothing to update. */
return NT_STATUS_OK;
-
-
+
+
if (pdb_mysql_query(data, query, &mysql_ret) == false)
{
talloc_free(query);
@@ -451,7 +451,7 @@
entry->account_name = talloc_strdup(search, row[6]);
entry->fullname = talloc_strdup(search, row[9]);
entry->description = talloc_strdup(search, row[14]);
-
+
state->current += 1;
if ((entry->account_name == NULL)) {
@@ -533,10 +533,10 @@
DEBUG(0,("mysqlsam: Couldn't register custom debugging class!\n"));
}
- if (!NT_STATUS_IS_OK(nt_status = make_pdb_method( pdb_method ))) {
+ if (!NT_STATUS_IS_OK(nt_status = make_pdb_method( pdb_method ))) {
return nt_status;
- }
-
+ }
+
(*pdb_method)->name = "mysqlsam";
(*pdb_method)->search_users = mysqlsam_search_users;
@@ -565,11 +565,11 @@
data->location = talloc_strdup(data, location);
DEBUG(1,
- ("Connecting to database server, host: %s, user: %s, database: %s, port: %ld\n",
- config_value(data, "mysql host", CONFIG_HOST_DEFAULT),
- config_value(data, "mysql user", CONFIG_USER_DEFAULT),
- config_value(data, "mysql database", CONFIG_DB_DEFAULT),
- xatol(config_value(data, "mysql port", CONFIG_PORT_DEFAULT))));
+ ("Connecting to database server, host: %s, user: %s, database: %s, port: %ld\n",
+ config_value(data, "mysql host", CONFIG_HOST_DEFAULT),
+ config_value(data, "mysql user", CONFIG_USER_DEFAULT),
+ config_value(data, "mysql database", CONFIG_DB_DEFAULT),
+ xatol(config_value(data, "mysql port", CONFIG_PORT_DEFAULT))));
/* Do the mysql initialization */
data->handle = mysql_init(NULL);
@@ -581,7 +581,7 @@
if(!sql_account_config_valid(data->location)) {
return NT_STATUS_INVALID_PARAMETER;
}
-
+
if (!NT_STATUS_IS_OK(pdb_mysql_connect(data))) {
return NT_STATUS_UNSUCCESSFUL;
}
@@ -589,7 +589,7 @@
return NT_STATUS_OK;
}
-NTSTATUS init_samba_module(void)
+NTSTATUS init_samba_module(void)
{
return smb_register_passdb(PASSDB_INTERFACE_VERSION, "mysql", mysqlsam_init);
}
Modified: branches/pdbsql_36/pdb_pgsql.c
===================================================================
--- branches/pdbsql_36/pdb_pgsql.c 2013-05-03 17:26:24 UTC (rev 176)
+++ branches/pdbsql_36/pdb_pgsql.c 2013-05-10 19:27:13 UTC (rev 177)
@@ -39,11 +39,11 @@
#undef PACKAGE_TARNAME
#include <pg_config.h>
-#define CONFIG_HOST_DEFAULT "localhost"
-#define CONFIG_USER_DEFAULT "samba"
-#define CONFIG_PASS_DEFAULT ""
-#define CONFIG_PORT_DEFAULT DEF_PGPORT_STR
-#define CONFIG_DB_DEFAULT "samba"
+#define CONFIG_HOST_DEFAULT "localhost"
+#define CONFIG_USER_DEFAULT "samba"
+#define CONFIG_PASS_DEFAULT ""
+#define CONFIG_PORT_DEFAULT DEF_PGPORT_STR
+#define CONFIG_DB_DEFAULT "samba"
static int pgsqlsam_debug_level = DBGC_ALL;
@@ -76,7 +76,7 @@
#define SET_DATA(data,methods) { \
if(!methods){ \
DEBUG(0, ("invalid methods!\n")); \
- return NT_STATUS_INVALID_PARAMETER; \
+ return NT_STATUS_INVALID_PARAMETER; \
} \
data = (struct pdb_pgsql_data *)methods->private_data; \
}
@@ -85,7 +85,7 @@
#define SET_DATA_QUIET(data,methods) { \
if(!methods){ \
DEBUG(0, ("invalid methods!\n")); \
- return; \
+ return; \
} \
data = (struct pdb_pgsql_data *)methods->private_data; \
}
@@ -97,10 +97,10 @@
static PGconn *pgsqlsam_connect(struct pdb_pgsql_data *data)
{
PGconn *handle;
-
+
DEBUG(1, ("Connecting to database server, host: %s, user: %s, password: XXXXXX, database: %s, port: %s\n",
- data->host, data->user, data->db, data->port));
-
+ data->host, data->user, data->db, data->port));
+
/* Do the pgsql initialization */
handle = PQsetdbLogin(
data->host,
@@ -110,13 +110,13 @@
data->db,
data->user,
data->pass);
-
+
if (handle != NULL && PQstatus(handle) != CONNECTION_OK) {
DEBUG(0, ("Failed to connect to pgsql database: error: %s\n",
(handle != NULL ? PQerrorMessage(handle) : "")));
return NULL;
}
-
+
DEBUG(5, ("Connected to pgsql database\n"));
return handle;
}
@@ -159,7 +159,7 @@
if (PQgetisnull(r, row, col)) {
return 0;
}
-
+
return atol(PQgetvalue(r, row, col));
}
@@ -169,7 +169,7 @@
struct dom_sid sid;
unsigned char *hours;
size_t hours_len = 0;
-
+
if (row >= PQntuples(r)) {
return NT_STATUS_INVALID_PARAMETER;
}
@@ -192,14 +192,14 @@
pdb_set_workstations (u, PQgetvalue(r, row, 15), PDB_SET);
pdb_set_comment (u, PQgetvalue(r, row, 16), PDB_SET);
pdb_set_munged_dial (u, PQgetvalue(r, row, 17), PDB_SET);
-
+
pdb_set_acct_ctrl (u, PQgetlong (r, row, 23), PDB_SET);
pdb_set_logon_divs (u, PQgetlong (r, row, 24), PDB_SET);
pdb_set_hours_len (u, PQgetlong (r, row, 25), PDB_SET);
pdb_set_bad_password_count (u, PQgetlong (r, row, 26), PDB_SET);
pdb_set_logon_count (u, PQgetlong (r, row, 27), PDB_SET);
pdb_set_unknown_6 (u, PQgetlong (r, row, 28), PDB_SET);
-
+
hours = (unsigned char *) PQgetvalue (r, row, 29);
if (hours != NULL) {
hours = PQunescapeBytea(hours, &hours_len);
@@ -207,8 +207,8 @@
pdb_set_hours(u, hours, PQgetlong(r, row, 25), PDB_SET);
}
}
-
-
+
+
if (!PQgetisnull(r, row, 18)) {
string_to_sid(&sid, PQgetvalue(r, row, 18));
pdb_set_user_sid(u, &sid, PDB_SET);
@@ -218,7 +218,7 @@
string_to_sid(&sid, PQgetvalue(r, row, 19));
pdb_set_group_sid(u, &sid, PDB_SET);
}
-
+
if (pdb_gethexpwd(PQgetvalue(r, row, 20), temp)) {
pdb_set_lanman_passwd(u, temp, PDB_SET);
}
@@ -230,32 +230,32 @@
uint8 pwhist[MAX_PW_HISTORY_LEN * PW_HISTORY_ENTRY_LEN];
int i;
char *history_string = PQgetvalue(r, row, 30);
-
+
memset(&pwhist, 0, MAX_PW_HISTORY_LEN * PW_HISTORY_ENTRY_LEN);
for (i = 0; i < MAX_PW_HISTORY_LEN && i < strlen(history_string)/64; i++) {
pdb_gethexpwd(&(history_string)[i*64], &pwhist[i*PW_HISTORY_ENTRY_LEN]);
- pdb_gethexpwd(&(history_string)[i*64+32],
+ pdb_gethexpwd(&(history_string)[i*64+32],
&pwhist[i*PW_HISTORY_ENTRY_LEN+PW_HISTORY_SALT_LEN]);
}
pdb_set_pw_history(u, pwhist, strlen(history_string)/64, PDB_SET);
}
-
+
/* Only use plaintext password storage when lanman and nt are NOT used */
if (PQgetisnull(r, row, 20) || PQgetisnull(r, row, 21)) {
pdb_set_plaintext_passwd(u, PQgetvalue(r, row, 22));
}
-
+
return NT_STATUS_OK;
}
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;
-
+
char *esc;
char *query;
-
+
PGresult *result;
NTSTATUS retval;
@@ -265,22 +265,22 @@
DEBUG(0, ("pdb_getsampwnam: struct samu is NULL.\n"));
return NT_STATUS_INVALID_PARAMETER;
}
-
+
DEBUG(5, ("pgsqlsam_select_by_field: getting data where %d = %s(nonescaped)\n", field, sname));
-
+
/* Escape sname */
esc = talloc_array(NULL, char, strlen(sname) * 2 + 1);
if (!esc) {
DEBUG(0, ("Can't allocate memory to store escaped name\n"));
- return NT_STATUS_NO_MEMORY;
+ return NT_STATUS_NO_MEMORY;
}
-
+
/* tmp_sname = smb_xstrdup(sname); */
PQescapeString(esc, sname, strlen(sname));
query = sql_account_query_select(NULL, data->location, true, field, esc);
result = pdb_pgsql_query(data, query);
-
+
/* Result? */
if (result == NULL)
{
@@ -289,12 +289,12 @@
else
{
retval = row_to_sam_account(result, 0, user);
- PQclear(result);
+ PQclear(result);
}
-
+
talloc_free(esc);
talloc_free(query);
-
+
return retval;
}
@@ -308,9 ...
[truncated message content] |
|
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.
|
|
From: <he...@us...> - 2013-05-11 07:28:19
|
Revision: 179
http://sourceforge.net/p/pdbsql/code/179
Author: herwinw
Date: 2013-05-11 07:28:13 +0000 (Sat, 11 May 2013)
Log Message:
-----------
Removed compatibility ifdefs for samba 3.4
This version is not supposed to run on samba 3.4, so we probably shouldn't bother keeping them in the codebase.
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.c
Modified: branches/pdbsql_36/pdb_multi.c
===================================================================
--- branches/pdbsql_36/pdb_multi.c 2013-05-10 21:20:29 UTC (rev 178)
+++ branches/pdbsql_36/pdb_multi.c 2013-05-11 07:28:13 UTC (rev 179)
@@ -197,30 +197,6 @@
}
#endif
-#if PASSDB_INTERFACE_VERSION < 19
-/* Tries uid_to_rid on every backend until one succeeds, returns true on success */
-static bool multisam_uid_to_rid(struct pdb_methods *methods, uid_t uid,
- uint32 *rid)
-{
- short i;
- struct multisam_data *data;
- bool rv;
-
- if (!methods) return false;
- data = (struct multisam_data *)methods->private_data;
- if (!data) return false;
-
- for (i = 0; i < data->num_backends; i++) {
- rv = data->methods[i]->uid_to_rid(data->methods[i], uid, rid);
- if (rv == true) {
- return true;
- }
- }
-
- return false;
-}
-#endif
-
/* 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,
struct dom_sid *sid)
@@ -290,15 +266,9 @@
/* Get a new free rid if necessary */
-#if PASSDB_INTERFACE_VERSION < 19
- if (data->methods[0]->rid_algorithm(data->methods[0])) {
- multisam_new_rid(methods, rid, 0);
- }
-#else
if (data->methods[0]->capabilities(data->methods[0])) {
multisam_new_rid(methods, rid, 0);
}
-#endif
return data->methods[0]->create_user(data->methods[0], tmp_ctx, name, acb_info, rid);
}
@@ -741,19 +711,13 @@
}
#endif
-#if PASSDB_INTERFACE_VERSION < 19
-/* The rid algorithm of the first backend is used. */
-static bool multisam_rid_algorithm (struct pdb_methods *methods)
-{
- return true;
-}
-#else
/* The capabilities of the first backend is used. */
+/* FIXME This should combine the capabilities from all the backends */
static uint32_t multisam_capabilities (struct pdb_methods *methods)
{
return PDB_CAP_STORE_RIDS | PDB_CAP_ADS;
}
-#endif
+
/* This function is a fallback for errors */
static bool multisam_dummy_new_rid (struct pdb_methods *methods, uint32 *rid)
{
@@ -800,18 +764,11 @@
(*pdb_method)->update_sam_account = multisam_update_sam_account;
(*pdb_method)->delete_sam_account = multisam_delete_sam_account;
(*pdb_method)->rename_sam_account = multisam_rename_sam_account;
-#if PASSDB_INTERFACE_VERSION < 19
- (*pdb_method)->rid_algorithm = multisam_rid_algorithm;
-#else
(*pdb_method)->capabilities = multisam_capabilities;
-#endif
(*pdb_method)->new_rid = multisam_dummy_new_rid;
(*pdb_method)->create_user = multisam_create_user;
(*pdb_method)->delete_user = multisam_delete_user;
-#if PASSDB_INTERFACE_VERSION < 19
- (*pdb_method)->uid_to_rid = multisam_uid_to_rid;
-#endif
(*pdb_method)->gid_to_sid = multisam_gid_to_sid;
(*pdb_method)->sid_to_id = multisam_sid_to_id;
Modified: branches/pdbsql_36/pdb_mysql.c
===================================================================
--- branches/pdbsql_36/pdb_mysql.c 2013-05-10 21:20:29 UTC (rev 178)
+++ branches/pdbsql_36/pdb_mysql.c 2013-05-11 07:28:13 UTC (rev 179)
@@ -407,15 +407,10 @@
return mysqlsam_replace_sam_account(methods, newpwd, 1);
}
-#if PASSDB_INTERFACE_VERSION < 19
-static bool mysqlsam_rid_algorithm (struct pdb_methods *pdb_methods) {
- return true;
-}
-#else
static uint32_t mysqlsam_capabilities (struct pdb_methods *pdb_methods) {
return PDB_CAP_STORE_RIDS | PDB_CAP_ADS;
}
-#endif
+
static bool mysqlsam_new_rid (struct pdb_methods *pdb_methods, uint32 *rid) {
return false;
}
@@ -545,11 +540,7 @@
(*pdb_method)->add_sam_account = mysqlsam_add_sam_account;
(*pdb_method)->update_sam_account = mysqlsam_update_sam_account;
(*pdb_method)->delete_sam_account = mysqlsam_delete_sam_account;
-#if PASSDB_INTERFACE_VERSION < 19
- (*pdb_method)->rid_algorithm = mysqlsam_rid_algorithm;
-#else
(*pdb_method)->capabilities = mysqlsam_capabilities;
-#endif
(*pdb_method)->new_rid = mysqlsam_new_rid;
data = talloc(*pdb_method, struct pdb_mysql_data);
Modified: branches/pdbsql_36/pdb_pgsql.c
===================================================================
--- branches/pdbsql_36/pdb_pgsql.c 2013-05-10 21:20:29 UTC (rev 178)
+++ branches/pdbsql_36/pdb_pgsql.c 2013-05-11 07:28:13 UTC (rev 179)
@@ -444,17 +444,10 @@
return pgsqlsam_replace_sam_account(methods, newpwd, 1);
}
-#if PASSDB_INTERFACE_VERSION < 19
-static bool pgsqlsam_rid_algorithm(struct pdb_methods *pdb_methods)
-{
- return true;
-}
-#else
static uint32_t pgsqlsam_capabilities(struct pdb_methods *pdb_methods)
{
return PDB_CAP_ADS;
}
-#endif
/* Iterate through search results, if a new entry is available: store in
* entry and return true. Otherwise: return false
@@ -598,11 +591,7 @@
(*pdb_method)->add_sam_account = pgsqlsam_add_sam_account;
(*pdb_method)->update_sam_account = pgsqlsam_update_sam_account;
(*pdb_method)->delete_sam_account = pgsqlsam_delete_sam_account;
-#if PASSDB_INTERFACE_VERSION < 19
- (*pdb_method)->rid_algorithm = pgsqlsam_rid_algorithm;
-#else
(*pdb_method)->capabilities = pgsqlsam_capabilities;
-#endif
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 21:20:29 UTC (rev 178)
+++ branches/pdbsql_36/pdb_sql.c 2013-05-11 07:28:13 UTC (rev 179)
@@ -556,11 +556,7 @@
pwhist = pdb_get_pw_history(newpwd, &pw_history_len);
-#if PASSDB_INTERFACE_VERSION < 19
- pdb_get_account_policy(AP_PASSWORD_HISTORY, &max_history_len);
-#else
pdb_get_account_policy(PDB_POLICY_PASSWORD_HISTORY, &pw_history_len);
-#endif
some_field_affected = 1;
for (i = 0; i < max_history_len && i < pw_history_len; i++) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2013-05-11 07:53:38
|
Revision: 181
http://sourceforge.net/p/pdbsql/code/181
Author: herwinw
Date: 2013-05-11 07:53:35 +0000 (Sat, 11 May 2013)
Log Message:
-----------
Added some dummy search functions
See bug 11. Code provided by Gary Mills.
Modified Paths:
--------------
branches/pdbsql_36/pdb_mysql.c
branches/pdbsql_36/pdb_pgsql.c
Modified: branches/pdbsql_36/pdb_mysql.c
===================================================================
--- branches/pdbsql_36/pdb_mysql.c 2013-05-11 07:40:03 UTC (rev 180)
+++ branches/pdbsql_36/pdb_mysql.c 2013-05-11 07:53:35 UTC (rev 181)
@@ -517,6 +517,23 @@
return true;
}
+/* Dummy search_ functions. Maybe they should really work XXXX */
+/* Courtesy of Gary Mills */
+static bool mysqlsam_search_groups(struct pdb_methods *methods,
+ struct pdb_search *search)
+{
+ talloc_set_destructor(search, NULL);
+ return false;
+}
+
+static bool mysqlsam_search_aliases(struct pdb_methods *methods,
+ struct pdb_search *search,
+ const struct dom_sid *sid)
+{
+ talloc_set_destructor(search, NULL);
+ return false;
+}
+
static NTSTATUS mysqlsam_init(struct pdb_methods **pdb_method, const char *location)
{
NTSTATUS nt_status;
@@ -535,6 +552,8 @@
(*pdb_method)->name = "mysqlsam";
(*pdb_method)->search_users = mysqlsam_search_users;
+ (*pdb_method)->search_groups = mysqlsam_search_groups;
+ (*pdb_method)->search_aliases = mysqlsam_search_aliases;
(*pdb_method)->getsampwnam = mysqlsam_getsampwnam;
(*pdb_method)->getsampwsid = mysqlsam_getsampwsid;
(*pdb_method)->add_sam_account = mysqlsam_add_sam_account;
Modified: branches/pdbsql_36/pdb_pgsql.c
===================================================================
--- branches/pdbsql_36/pdb_pgsql.c 2013-05-11 07:40:03 UTC (rev 180)
+++ branches/pdbsql_36/pdb_pgsql.c 2013-05-11 07:53:35 UTC (rev 181)
@@ -564,6 +564,24 @@
return true;
}
+/* Dummy search_ functions. Maybe they should really work XXXX */
+/* Courtesy of Gary Mills */
+static bool pgsqlsam_search_groups(struct pdb_methods *methods,
+ struct pdb_search *search)
+{
+ talloc_set_destructor(search, NULL);
+ return false;
+}
+
+static bool pgsqlsam_search_aliases(struct pdb_methods *methods,
+ struct pdb_search *search,
+ const struct dom_sid *sid)
+{
+ talloc_set_destructor(search, NULL);
+ return false;
+}
+
+
static NTSTATUS pgsqlsam_init (struct pdb_methods **pdb_method, const char *location)
{
NTSTATUS nt_status;
@@ -585,6 +603,8 @@
(*pdb_method)->name = "pgsqlsam";
(*pdb_method)->search_users = pgsqlsam_search_users;
+ (*pdb_method)->search_groups = pgsqlsam_search_groups;
+ (*pdb_method)->search_aliases = pgsqlsam_search_aliases;
(*pdb_method)->getsampwnam = pgsqlsam_getsampwnam;
(*pdb_method)->getsampwsid = pgsqlsam_getsampwsid;
(*pdb_method)->add_sam_account = pgsqlsam_add_sam_account;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2013-06-12 18:25:03
|
Revision: 185
http://sourceforge.net/p/pdbsql/code/185
Author: herwinw
Date: 2013-06-12 18:25:00 +0000 (Wed, 12 Jun 2013)
Log Message:
-----------
Removed extraneous parentheses
Now we can compile with clang without errors.
Modified Paths:
--------------
branches/pdbsql_36/pdb_mysql.c
branches/pdbsql_36/pdb_pgsql.c
Modified: branches/pdbsql_36/pdb_mysql.c
===================================================================
--- branches/pdbsql_36/pdb_mysql.c 2013-05-24 10:21:44 UTC (rev 184)
+++ branches/pdbsql_36/pdb_mysql.c 2013-06-12 18:25:00 UTC (rev 185)
@@ -445,7 +445,7 @@
state->current += 1;
- if ((entry->account_name == NULL)) {
+ if (entry->account_name == NULL) {
DEBUG(0, ("talloc_strdup failed\n"));
return false;
}
Modified: branches/pdbsql_36/pdb_pgsql.c
===================================================================
--- branches/pdbsql_36/pdb_pgsql.c 2013-05-24 10:21:44 UTC (rev 184)
+++ branches/pdbsql_36/pdb_pgsql.c 2013-06-12 18:25:00 UTC (rev 185)
@@ -489,7 +489,7 @@
search_state->currow++;
- if ((entry->account_name == NULL)) {
+ if (entry->account_name == NULL) {
DEBUG(0, ("talloc_strdup failed\n"));
return false;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|