summaryrefslogtreecommitdiff
path: root/source/lib/substitute.c
diff options
context:
space:
mode:
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>