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.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/lib/substitute.c b/source/lib/substitute.c
index af30e900ace..15862f7a966 100644
--- a/source/lib/substitute.c
+++ b/source/lib/substitute.c
@@ -385,15 +385,20 @@ void standard_sub_basic(const char *smb_name, char *str,size_t len)
case 'i' :
string_sub(p,"%i", client_socket_addr(),l);
break;
- case 'L' :
- if (local_machine_name && *local_machine_name)
- string_sub(p,"%L", local_machine_name,l);
- else {
+ case 'L' :
+ if (!StrnCaseCmp(p, "\%LOGONSERVER\%", 13)) {
+ p++;
+ break;
+ }
+
+ if (local_machine_name && *local_machine_name) {
+ string_sub_once(p, "%L", local_machine_name, l);
+ } else {
pstring temp_name;
pstrcpy(temp_name, global_myname());
strlower_m(temp_name);
- string_sub(p,"%L", temp_name,l);
+ string_sub_once(p, "%L", temp_name, l);
}
break;
case 'M' :