svn commit: samba r9303 - branches/SAMBA_3_0/source/include
branches/SAMBA_3_0/source/passdb trunk/source/include
trunk/source/passdb
jpeach at samba.org
jpeach at samba.org
Sat Aug 13 12:05:54 GMT 2005
Author: jpeach
Date: 2005-08-13 12:05:54 +0000 (Sat, 13 Aug 2005)
New Revision: 9303
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9303
Log:
Clobber compiler warnings. Patch from Jason Mader <jason at ncac.gwu.edu> plus
some extra function declarations. Bugzilla bug #2523.
Modified:
branches/SAMBA_3_0/source/include/smbldap.h
branches/SAMBA_3_0/source/passdb/pdb_nds.c
trunk/source/include/smbldap.h
trunk/source/passdb/pdb_nds.c
Changeset:
Modified: branches/SAMBA_3_0/source/include/smbldap.h
===================================================================
--- branches/SAMBA_3_0/source/include/smbldap.h 2005-08-13 09:43:12 UTC (rev 9302)
+++ branches/SAMBA_3_0/source/include/smbldap.h 2005-08-13 12:05:54 UTC (rev 9303)
@@ -22,6 +22,8 @@
#ifndef _SMBLDAP_H
#define _SMBLDAP_H
+struct smbldap_state;
+
#ifdef HAVE_LDAP
/* specify schema versions between 2.2. and 3.0 */
@@ -119,6 +121,10 @@
/* Function declarations -- not included in proto.h so we don't
have to worry about LDAP structure types */
+NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx,
+ const char *location,
+ struct smbldap_state **smbldap_state);
+
const char* get_attr_key2string( ATTRIB_MAP_ENTRY table[], int key );
const char** get_attr_list( ATTRIB_MAP_ENTRY table[] );
void free_attr_list( const char **list );
@@ -131,6 +137,10 @@
int max_len);
BOOL smbldap_get_single_pstring (LDAP * ldap_struct, LDAPMessage * entry,
const char *attribute, pstring value);
+char *smbldap_get_dn(LDAP *ld, LDAPMessage *entry);
+int smbldap_modify(struct smbldap_state *ldap_state,
+ const char *dn,
+ LDAPMod *attrs[]);
/**
* Struct to keep the state for all the ldap stuff
@@ -180,10 +190,22 @@
char *location;
};
+/* Functions shared between pdb_ldap.c and pdb_nds.c. */
+NTSTATUS pdb_init_ldapsam_compat(PDB_CONTEXT *pdb_context,
+ PDB_METHODS **pdb_method,
+ const char *location);
+void private_data_free_fn(void **result);
+int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state,
+ const char *user,
+ LDAPMessage ** result,
+ const char **attr);
+NTSTATUS pdb_init_ldapsam(PDB_CONTEXT *pdb_context,
+ PDB_METHODS **pdb_method,
+ const char *location);
+const char** get_userattr_list( int schema_ver );
+
#endif /* HAVE_LDAP */
-struct smbldap_state;
-
#define LDAP_CONNECT_DEFAULT_TIMEOUT 15
#define LDAP_PAGE_SIZE 1024
Modified: branches/SAMBA_3_0/source/passdb/pdb_nds.c
===================================================================
--- branches/SAMBA_3_0/source/passdb/pdb_nds.c 2005-08-13 09:43:12 UTC (rev 9302)
+++ branches/SAMBA_3_0/source/passdb/pdb_nds.c 2005-08-13 12:05:54 UTC (rev 9303)
@@ -227,7 +227,7 @@
size_t *retDataLen,
void *retData )
{
- int rc=0, err = 0;
+ int err = 0;
BerElement *replyBer = NULL;
char *retOctStr = NULL;
size_t retOctStrLen = 0;
@@ -248,7 +248,7 @@
goto Cleanup;
}
- if( (rc = ber_scanf(replyBer, "{iis}", serverVersion, &err, retOctStr, &retOctStrLen)) != -1)
+ if(ber_scanf(replyBer, "{iis}", serverVersion, &err, retOctStr, &retOctStrLen) != -1)
{
if (*retDataLen >= retOctStrLen)
{
@@ -268,7 +268,7 @@
}
else
{
- if( (rc = ber_scanf(replyBer, "{ii}", serverVersion, &err)) == -1)
+ if(ber_scanf(replyBer, "{ii}", serverVersion, &err) == -1)
{
if (!err)
{
@@ -663,7 +663,7 @@
int pdb_nds_get_password(
struct smbldap_state *ldap_state,
char *object_dn,
- int *pwd_len,
+ size_t *pwd_len,
char *pwd )
{
LDAP *ld = ldap_state->ldap_struct;
@@ -757,7 +757,7 @@
LDAPMessage *entry = NULL;
const char **attr_list;
size_t pwd_len;
- uchar clear_text_pw[512];
+ char clear_text_pw[512];
const char *p = NULL;
LDAP *ld = NULL;
int ldap_port = 0;
@@ -800,7 +800,7 @@
got_clear_text_pw = True;
}
} else {
- generate_random_buffer(clear_text_pw, 24);
+ generate_random_buffer((unsigned char *)clear_text_pw, 24);
clear_text_pw[24] = '\0';
DEBUG(5,("pdb_nds_update_login_attempts: using random password %s\n", clear_text_pw));
}
Modified: trunk/source/include/smbldap.h
===================================================================
--- trunk/source/include/smbldap.h 2005-08-13 09:43:12 UTC (rev 9302)
+++ trunk/source/include/smbldap.h 2005-08-13 12:05:54 UTC (rev 9303)
@@ -22,6 +22,8 @@
#ifndef _SMBLDAP_H
#define _SMBLDAP_H
+struct smbldap_state;
+
#ifdef HAVE_LDAP
/* specify schema versions between 2.2. and 3.0 */
@@ -124,6 +126,10 @@
/* Function declarations -- not included in proto.h so we don't
have to worry about LDAP structure types */
+NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx,
+ const char *location,
+ struct smbldap_state **smbldap_state);
+
const char* get_attr_key2string( ATTRIB_MAP_ENTRY table[], int key );
const char** get_attr_list( ATTRIB_MAP_ENTRY table[] );
void free_attr_list( const char **list );
@@ -136,6 +142,10 @@
int max_len);
BOOL smbldap_get_single_pstring (LDAP * ldap_struct, LDAPMessage * entry,
const char *attribute, pstring value);
+char *smbldap_get_dn(LDAP *ld, LDAPMessage *entry);
+int smbldap_modify(struct smbldap_state *ldap_state,
+ const char *dn,
+ LDAPMod *attrs[]);
/**
* Struct to keep the state for all the ldap stuff
@@ -185,10 +195,22 @@
char *location;
};
+/* Functions shared between pdb_ldap.c and pdb_nds.c. */
+NTSTATUS pdb_init_ldapsam_compat(PDB_CONTEXT *pdb_context,
+ PDB_METHODS **pdb_method,
+ const char *location);
+void private_data_free_fn(void **result);
+int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state,
+ const char *user,
+ LDAPMessage ** result,
+ const char **attr);
+NTSTATUS pdb_init_ldapsam(PDB_CONTEXT *pdb_context,
+ PDB_METHODS **pdb_method,
+ const char *location);
+const char** get_userattr_list( int schema_ver );
+
#endif /* HAVE_LDAP */
-struct smbldap_state;
-
#define LDAP_CONNECT_DEFAULT_TIMEOUT 15
#define LDAP_PAGE_SIZE 1024
Modified: trunk/source/passdb/pdb_nds.c
===================================================================
--- trunk/source/passdb/pdb_nds.c 2005-08-13 09:43:12 UTC (rev 9302)
+++ trunk/source/passdb/pdb_nds.c 2005-08-13 12:05:54 UTC (rev 9303)
@@ -227,7 +227,7 @@
size_t *retDataLen,
void *retData )
{
- int rc=0, err = 0;
+ int err = 0;
BerElement *replyBer = NULL;
char *retOctStr = NULL;
size_t retOctStrLen = 0;
@@ -248,7 +248,7 @@
goto Cleanup;
}
- if( (rc = ber_scanf(replyBer, "{iis}", serverVersion, &err, retOctStr, &retOctStrLen)) != -1)
+ if(ber_scanf(replyBer, "{iis}", serverVersion, &err, retOctStr, &retOctStrLen) != -1)
{
if (*retDataLen >= retOctStrLen)
{
@@ -268,7 +268,7 @@
}
else
{
- if( (rc = ber_scanf(replyBer, "{ii}", serverVersion, &err)) == -1)
+ if(ber_scanf(replyBer, "{ii}", serverVersion, &err) == -1)
{
if (!err)
{
@@ -663,7 +663,7 @@
int pdb_nds_get_password(
struct smbldap_state *ldap_state,
char *object_dn,
- int *pwd_len,
+ size_t *pwd_len,
char *pwd )
{
LDAP *ld = ldap_state->ldap_struct;
@@ -757,7 +757,7 @@
LDAPMessage *entry = NULL;
const char **attr_list;
size_t pwd_len;
- uchar clear_text_pw[512];
+ char clear_text_pw[512];
const char *p = NULL;
LDAP *ld = NULL;
int ldap_port = 0;
@@ -800,7 +800,7 @@
got_clear_text_pw = True;
}
} else {
- generate_random_buffer(clear_text_pw, 24);
+ generate_random_buffer((unsigned char *)clear_text_pw, 24);
clear_text_pw[24] = '\0';
DEBUG(5,("pdb_nds_update_login_attempts: using random password %s\n", clear_text_pw));
}
More information about the samba-cvs
mailing list