summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/client/smbmount.c3
-rw-r--r--source4/include/pstring.h2
-rw-r--r--source4/libcli/auth/smbencrypt.c3
-rw-r--r--source4/utils/ntlm_auth.c24
4 files changed, 14 insertions, 18 deletions
diff --git a/source4/client/smbmount.c b/source4/client/smbmount.c
index 37c9eaadc4..d2e98eb140 100644
--- a/source4/client/smbmount.c
+++ b/source4/client/smbmount.c
@@ -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;
diff --git a/source4/include/pstring.h b/source4/include/pstring.h
index 0cbc964c34..43fd7fdfcf 100644
--- a/source4/include/pstring.h
+++ b/source4/include/pstring.h
@@ -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)
diff --git a/source4/libcli/auth/smbencrypt.c b/source4/libcli/auth/smbencrypt.c
index 096f51e49b..54daf19a12 100644
--- a/source4/libcli/auth/smbencrypt.c
+++ b/source4/libcli/auth/smbencrypt.c
@@ -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. */
diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c
index 1ec87c6b42..1a0a975879 100644
--- a/source4/utils/ntlm_auth.c
+++ b/source4/utils/ntlm_auth.c
@@ -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) {