diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/lib/util.c | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index edcb025101..585d53f643 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -565,6 +565,7 @@ int set_maxfiles(int requested_max); int smb_mkstemp(char *name_template); void *smb_xmalloc_array(size_t size, unsigned int count); char *myhostname(void); +char *myhostname_upper(void); char *lock_path(const char *name); char *pid_path(const char *name); char *state_path(const char *name); 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 |