diff options
author | Jeremy Allison <jra@samba.org> | 2002-04-30 13:28:41 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-04-30 13:28:41 +0000 |
commit | d04b55f2186fb8af998cf61c576771a5f72f4892 (patch) | |
tree | 9ff8c3a7cf34cefc0ee9a550a3bb1236a9e77595 /source/lib/substitute.c | |
parent | 73267ca42d9eddabb71b31b4c5068ebbe7bc9f7c (diff) | |
download | samba-d04b55f2186fb8af998cf61c576771a5f72f4892.tar.gz samba-d04b55f2186fb8af998cf61c576771a5f72f4892.tar.xz samba-d04b55f2186fb8af998cf61c576771a5f72f4892.zip |
Start of merge to 2_2_RELEASE branch for release.
Jeremy.
Diffstat (limited to 'source/lib/substitute.c')
-rw-r--r-- | source/lib/substitute.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/lib/substitute.c b/source/lib/substitute.c index 387b07bc512..c1ac1f504a3 100644 --- a/source/lib/substitute.c +++ b/source/lib/substitute.c @@ -168,6 +168,7 @@ static char *automount_server(char *user_name) void standard_sub_basic(char *str) { + extern pstring global_myname; char *p, *s; fstring pidstr; struct passwd *pass; @@ -197,7 +198,21 @@ void standard_sub_basic(char *str) string_sub(p,"%D", tmp_str,l); break; case 'I' : string_sub(p,"%I", client_addr(),l); break; - case 'L' : string_sub(p,"%L", local_machine,l); break; + case 'L' : + if (*local_machine) + string_sub(p,"%L", local_machine,l); + else { + char *ns = p; + + string_sub(p,"%L", global_myname,l); + while (*ns) + { + if (isupper(*ns)) + *ns = tolower(*ns); + ns++; + } + } + break; case 'M' : string_sub(p,"%M", client_name(),l); break; case 'R' : string_sub(p,"%R", remote_proto,l); break; case 'T' : string_sub(p,"%T", timestring(False),l); break; |