From 9dbb5769fe70d3c0e2a2c679a42104bc15d42bc7 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 2 Feb 2005 16:05:55 +0000 Subject: r5174: ensure that we consistently use the current_user_info.smb_name vs. smb_name when parsing smb.conf and reloading config files (This used to be commit be537eaebe84b2ccae089e5982263df8a96e7a5b) --- source3/lib/substitute.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/lib/substitute.c') diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index 6ec3bb4a76..615a8d73b0 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -134,6 +134,18 @@ void set_current_user_info(const userdom_struct *pcui) fstrcpy(smb_user_name, current_user_info.smb_name); } +/******************************************************************* + 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. -- cgit