1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

Remove smbldap_get_single_pstring() and all pstrings

from pdb_ldap.c. I don't have an LDAP passdb setup here,
so I'm going to need some help on testing this.
Jeremy.
(This used to be commit 00760451b6)
This commit is contained in:
Jeremy Allison 2007-11-14 16:05:42 -08:00
parent d07eabcb44
commit 51b46147f2
4 changed files with 835 additions and 484 deletions

View File

@ -292,14 +292,6 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
return True;
}
bool smbldap_get_single_pstring (LDAP * ldap_struct, LDAPMessage * entry,
const char *attribute, pstring value)
{
return smbldap_get_single_attribute(ldap_struct, entry,
attribute, value,
sizeof(pstring));
}
char * smbldap_talloc_single_attribute(LDAP *ldap_struct, LDAPMessage *entry,
const char *attribute,
TALLOC_CTX *mem_ctx)

View File

@ -1187,14 +1187,17 @@ void pstring_sub(char *s,const char *pattern,const char *insert)
}
/**
Similar to string_sub, but it will accept only allocated strings
Similar to string_sub2, but it will accept only allocated strings
and may realloc them so pay attention at what you pass on no
pointers inside strings, no pstrings or const may be passed
as string.
**/
char *realloc_string_sub(char *string, const char *pattern,
const char *insert)
char *realloc_string_sub2(char *string,
const char *pattern,
const char *insert,
bool remove_unsafe_characters,
bool allow_trailing_dollar)
{
char *p, *in;
char *s;
@ -1221,10 +1224,18 @@ char *realloc_string_sub(char *string, const char *pattern,
case '\'':
case ';':
case '$':
/* allow a trailing $
* (as in machine accounts) */
if (allow_trailing_dollar && (i == li - 1 )) {
break;
}
case '%':
case '\r':
case '\n':
in[i] = '_';
if ( remove_unsafe_characters ) {
in[i] = '_';
break;
}
default:
/* ok */
break;
@ -1254,6 +1265,13 @@ char *realloc_string_sub(char *string, const char *pattern,
return string;
}
char *realloc_string_sub(char *string,
const char *pattern,
const char *insert)
{
return realloc_string_sub2(string, pattern, insert, true, false);
}
/*
* Internal guts of talloc_string_sub and talloc_all_string_sub.
* 'filter' differentiates between them.

View File

@ -340,7 +340,7 @@ uint32 pdb_decode_acct_ctrl(const char *p)
Routine to set 32 hex password characters from a 16 byte array.
**************************************************************/
void pdb_sethexpwd(char *p, const unsigned char *pwd, uint32 acct_ctrl)
void pdb_sethexpwd(char p[33], const unsigned char *pwd, uint32 acct_ctrl)
{
if (pwd != NULL) {
int i;

File diff suppressed because it is too large Load Diff