mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
Remove pstring usages.
This commit is contained in:
parent
7a683618e7
commit
6d9b24de78
@ -24,6 +24,9 @@
|
||||
#include <asm/types.h>
|
||||
#include <linux/smb_fs.h>
|
||||
|
||||
#define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1)
|
||||
#define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1)
|
||||
|
||||
static pstring credentials;
|
||||
static pstring my_netbios_name;
|
||||
static pstring password;
|
||||
|
@ -33,8 +33,6 @@
|
||||
_DEPRECATED_ typedef char pstring[PSTRING_LEN];
|
||||
typedef char fstring[FSTRING_LEN];
|
||||
|
||||
#define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1)
|
||||
#define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1)
|
||||
#define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
|
||||
#define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1)
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "auth/ntlmssp/msrpc_parse.h"
|
||||
#include "../lib/crypto/crypto.h"
|
||||
#include "libcli/auth/libcli_auth.h"
|
||||
#include "pstring.h"
|
||||
#include "param/param.h"
|
||||
|
||||
/*
|
||||
@ -94,7 +93,7 @@ bool E_md4hash(const char *passwd, uint8_t p16[16])
|
||||
bool E_deshash(const char *passwd, uint8_t p16[16])
|
||||
{
|
||||
bool ret = true;
|
||||
fstring dospwd;
|
||||
char dospwd[20];
|
||||
ZERO_STRUCT(dospwd);
|
||||
|
||||
/* Password must be converted to DOS charset - null terminated, uppercase. */
|
||||
|
@ -127,8 +127,8 @@ static void mux_printf(unsigned int mux_id, const char *format, ...)
|
||||
/* Copy of parse_domain_user from winbindd_util.c. Parse a string of the
|
||||
form DOMAIN/user into a domain and a user */
|
||||
|
||||
static bool parse_ntlm_auth_domain_user(const char *domuser, fstring domain,
|
||||
fstring user, char winbind_separator)
|
||||
static bool parse_ntlm_auth_domain_user(const char *domuser, char **domain,
|
||||
char **user, char winbind_separator)
|
||||
{
|
||||
|
||||
char *p = strchr(domuser, winbind_separator);
|
||||
@ -137,9 +137,9 @@ static bool parse_ntlm_auth_domain_user(const char *domuser, fstring domain,
|
||||
return false;
|
||||
}
|
||||
|
||||
fstrcpy(user, p+1);
|
||||
fstrcpy(domain, domuser);
|
||||
domain[PTR_DIFF(p, domuser)] = 0;
|
||||
*user = smb_xstrdup(p+1);
|
||||
*domain = smb_xstrdup(domuser);
|
||||
(*domain)[PTR_DIFF(p, domuser)] = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -753,18 +753,14 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod
|
||||
uint32_t flags = 0;
|
||||
|
||||
if (full_username && !username) {
|
||||
fstring fstr_user;
|
||||
fstring fstr_domain;
|
||||
|
||||
if (!parse_ntlm_auth_domain_user(full_username, fstr_user, fstr_domain,
|
||||
*lp_winbind_separator(lp_ctx))) {
|
||||
SAFE_FREE(username);
|
||||
SAFE_FREE(domain);
|
||||
if (!parse_ntlm_auth_domain_user(full_username, &username,
|
||||
&domain,
|
||||
*lp_winbind_separator(lp_ctx))) {
|
||||
/* username might be 'tainted', don't print into our new-line deleimianted stream */
|
||||
mux_printf(mux_id, "Error: Could not parse into domain and username\n");
|
||||
}
|
||||
SAFE_FREE(username);
|
||||
SAFE_FREE(domain);
|
||||
username = smb_xstrdup(fstr_user);
|
||||
domain = smb_xstrdup(fstr_domain);
|
||||
}
|
||||
|
||||
if (!domain) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user