summaryrefslogtreecommitdiffstats
path: root/source/lib/substitute.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-02-02 16:05:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:31 -0500
commitbe537eaebe84b2ccae089e5982263df8a96e7a5b (patch)
tree6e9dc502a4baa3b4b7478f562bfab6179fd6d2be /source/lib/substitute.c
parent54ac409d4fd3b6e8e2bd338dabed446a92507811 (diff)
downloadsamba-be537eaebe84b2ccae089e5982263df8a96e7a5b.tar.gz
samba-be537eaebe84b2ccae089e5982263df8a96e7a5b.tar.xz
samba-be537eaebe84b2ccae089e5982263df8a96e7a5b.zip
r5174: ensure that we consistently use the current_user_info.smb_name vs. smb_name when parsing smb.conf and reloading config files
Diffstat (limited to 'source/lib/substitute.c')
-rw-r--r--source/lib/substitute.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/lib/substitute.c b/source/lib/substitute.c
index 6ec3bb4a76e..615a8d73b0a 100644
--- a/source/lib/substitute.c
+++ b/source/lib/substitute.c
@@ -135,6 +135,18 @@ void set_current_user_info(const userdom_struct *pcui)
}
/*******************************************************************
+ return the current active user name
+*******************************************************************/
+
+const char* get_current_username( void )
+{
+ if ( current_user_info.smb_name[0] == '\0' )
+ return smb_user_name;
+
+ return current_user_info.smb_name;
+}
+
+/*******************************************************************
Given a pointer to a %$(NAME) expand it as an environment variable.
Return the number of characters by which the pointer should be advanced.
Based on code by Branko Cibej <branko.cibej@hermes.si>