r5174: ensure that we consistently use the current_user_info.smb_name vs. smb_name...
[ira/wip.git] / source / lib / substitute.c
index 6ec3bb4a76e4fba78da811b125c9758abc8f5c46..615a8d73b0a36016381705b8a7fa99fdf026bb8a 100644 (file)
@@ -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.