diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-09 15:27:53 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-09 12:40:09 +0200 |
commit | 0e95311c235929e07fdcfd7153b91ae795a979b9 (patch) | |
tree | f8bff7dd988832e80be864dc7fc9d6022a4e4dd6 /source3/lib | |
parent | bb00f97a82aea24bbf95de4dbd788d32bd34b427 (diff) | |
download | samba-0e95311c235929e07fdcfd7153b91ae795a979b9.tar.gz samba-0e95311c235929e07fdcfd7153b91ae795a979b9.tar.bz2 samba-0e95311c235929e07fdcfd7153b91ae795a979b9.zip |
s3-lib Add myhostname_upper()
This varient always upper cases the hostname, which is needed for the
netbios name.
Andrew Bartlett
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 499f5f7f6b..51ad7bd3bd 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1456,6 +1456,22 @@ char *myhostname(void) return ret; } +/***************************************************************** + Get local hostname and cache result. +*****************************************************************/ + +char *myhostname_upper(void) +{ + char *name; + static char *ret; + if (ret == NULL) { + name = get_myname(talloc_tos()); + ret = strupper_talloc(NULL, name); + talloc_free(name); + } + return ret; +} + /** * @brief Returns an absolute path to a file concatenating the provided * @a rootpath and @a basename |