summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/substitute.c5
-rw-r--r--source3/lib/username.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index 5dec980810..fed11c2298 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -116,6 +116,11 @@ void sub_set_smb_name(const char *name)
alpha_strcpy(smb_user_name,tmp,SAFE_NETBIOS_CHARS,sizeof(smb_user_name)-1);
}
+char* sub_get_smb_name( void )
+{
+ return smb_user_name;
+}
+
/*******************************************************************
Setup the strings used by substitutions. Called per packet. Ensure
%U name is set correctly also.
diff --git a/source3/lib/username.c b/source3/lib/username.c
index 40327f8168..ac5530b5c7 100644
--- a/source3/lib/username.c
+++ b/source3/lib/username.c
@@ -283,6 +283,11 @@ struct passwd *Get_Pwnam(const char *user)
fstring user2;
struct passwd *ret;
+ if ( *user == '\0' ) {
+ DEBUG(10,("Get_Pwnam: empty username!\n"));
+ return NULL;
+ }
+
fstrcpy(user2, user);
DEBUG(5,("Finding user %s\n", user));