diff options
author | Volker Lendecke <vl@samba.org> | 2009-02-13 10:56:34 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-02-13 12:15:03 +0100 |
commit | 0844cca1d5e4579b54af7d03509f3f97fac43bdc (patch) | |
tree | 48e92ab9ebeb54a485394849e3bcc2b0aca7734a /source3 | |
parent | e7f7ed8bf6281ef01aca53ea44acdd4af4c51aa7 (diff) | |
download | samba-0844cca1d5e4579b54af7d03509f3f97fac43bdc.tar.gz samba-0844cca1d5e4579b54af7d03509f3f97fac43bdc.tar.bz2 samba-0844cca1d5e4579b54af7d03509f3f97fac43bdc.zip |
Replace get_myname() with the talloc version from v3-3-test
Diffstat (limited to 'source3')
-rw-r--r-- | source3/client/smbspool.c | 2 | ||||
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/lib/util.c | 31 | ||||
-rw-r--r-- | source3/nmbd/nmbd_processlogon.c | 2 | ||||
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 2 | ||||
-rw-r--r-- | source3/torture/torture.c | 2 |
6 files changed, 6 insertions, 35 deletions
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c index 7943cf5828..a276353a87 100644 --- a/source3/client/smbspool.c +++ b/source3/client/smbspool.c @@ -485,7 +485,7 @@ smb_connect(const char *workgroup, /* I - Workgroup */ /* * Get the names and addresses of the client and server... */ - myname = talloc_get_myname(talloc_tos()); + myname = get_myname(talloc_tos()); if (!myname) { return NULL; } diff --git a/source3/include/proto.h b/source3/include/proto.h index 7ad063ef47..34104727e9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1154,7 +1154,7 @@ void *Realloc(void *p, size_t size, bool free_old_on_error); void add_to_large_array(TALLOC_CTX *mem_ctx, size_t element_size, void *element, void *_array, uint32 *num_elements, ssize_t *array_size); -char *talloc_get_myname(TALLOC_CTX *ctx); +char *get_myname(TALLOC_CTX *ctx); char *get_mydnsdomname(TALLOC_CTX *ctx); int interpret_protocol(const char *str,int def); char *automount_lookup(TALLOC_CTX *ctx, const char *user_name); diff --git a/source3/lib/util.c b/source3/lib/util.c index 68d3322436..6079e71063 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1209,35 +1209,6 @@ void add_to_large_array(TALLOC_CTX *mem_ctx, size_t element_size, } /**************************************************************************** - Get my own name and IP. -****************************************************************************/ - -char *talloc_get_myname(TALLOC_CTX *ctx) -{ - char *p; - char hostname[HOST_NAME_MAX]; - - *hostname = 0; - - /* get my host name */ - if (gethostname(hostname, sizeof(hostname)) == -1) { - DEBUG(0,("gethostname failed\n")); - return False; - } - - /* Ensure null termination. */ - hostname[sizeof(hostname)-1] = '\0'; - - /* split off any parts after an initial . */ - p = strchr_m(hostname,'.'); - if (p) { - *p = 0; - } - - return talloc_strdup(ctx, hostname); -} - -/**************************************************************************** Get my own domain name, or "" if we have none. ****************************************************************************/ @@ -2237,7 +2208,7 @@ char *myhostname(void) if (ret == NULL) { /* This is cached forever so * use talloc_autofree_context() ctx. */ - ret = talloc_get_myname(talloc_autofree_context()); + ret = get_myname(talloc_autofree_context()); } return ret; } diff --git a/source3/nmbd/nmbd_processlogon.c b/source3/nmbd/nmbd_processlogon.c index a4ef528133..59a2ca405e 100644 --- a/source3/nmbd/nmbd_processlogon.c +++ b/source3/nmbd/nmbd_processlogon.c @@ -442,7 +442,7 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n", ("get_mydnsdomname failed.\n")); return; } - hostname = talloc_get_myname(talloc_tos()); + hostname = get_myname(talloc_tos()); if (!hostname) { DEBUG(2, ("get_myname failed.\n")); diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 2841ff08f6..24dbcb0193 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -3417,7 +3417,7 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path, result->transfer_syntax = ndr_transfer_syntax; result->dispatch = cli_do_rpc_ndr; - result->desthost = talloc_get_myname(result); + result->desthost = get_myname(result); result->srv_name_slash = talloc_asprintf_strupper_m( result, "\\\\%s", result->desthost); if ((result->desthost == NULL) || (result->srv_name_slash == NULL)) { diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 9cf41d88c7..db89b05603 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -5862,7 +5862,7 @@ static void usage(void) *p = 0; fstrcpy(share, p+1); - fstrcpy(myname, talloc_get_myname(talloc_tos())); + fstrcpy(myname, get_myname(talloc_tos())); if (!*myname) { fprintf(stderr, "Failed to get my hostname.\n"); return 1; |