The Samba-Bugzilla – Attachment 4581 Details for
Bug 6655
[PATCH] smbcontrol smbd ping does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
0001-make-smbcontrol-smbd-ping-work.patch (text/plain), 2.37 KB, created by
Olaf Flebbe
on 2009-08-21 05:51:08 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Olaf Flebbe
Created:
2009-08-21 05:51:08 UTC
Size:
2.37 KB
patch
obsolete
>From b7fa111088f39dc946c700a14b722874e4ec3a75 Mon Sep 17 00:00:00 2001 >From: Olaf Flebbe <flebbe@nix.science-computing.de> >Date: Mon, 17 Aug 2009 17:31:01 +0200 >Subject: [PATCH] make smbcontrol smbd ping work > proper checking for arguments > handle short pid_t correctly > >--- > source3/lib/util.c | 20 ++++++++++++++------ > source3/utils/smbcontrol.c | 13 +++++-------- > 2 files changed, 19 insertions(+), 14 deletions(-) > >diff --git a/source3/lib/util.c b/source3/lib/util.c >index 61a73e6..f61dec1 100644 >--- a/source3/lib/util.c >+++ b/source3/lib/util.c >@@ -2743,14 +2743,15 @@ bool procid_is_me(const struct server_id *pid) > > struct server_id interpret_pid(const char *pid_string) > { >-#ifdef CLUSTER_SUPPORT >- unsigned int vnn, pid; > struct server_id result; >- if (sscanf(pid_string, "%u:%u", &vnn, &pid) == 2) { >+ int pid; >+#ifdef CLUSTER_SUPPORT >+ unsigned int vnn; >+ if (sscanf(pid_string, "%u:%d", &vnn, &pid) == 2) { > result.vnn = vnn; > result.pid = pid; > } >- else if (sscanf(pid_string, "%u", &pid) == 1) { >+ else if (sscanf(pid_string, "%d", &pid) == 1) { > result.vnn = get_my_vnn(); > result.pid = pid; > } >@@ -2758,10 +2759,17 @@ struct server_id interpret_pid(const char *pid_string) > result.vnn = NONCLUSTER_VNN; > result.pid = -1; > } >- return result; > #else >- return pid_to_procid(atoi(pid_string)); >+ if (sscanf(pid_string, "%d", &pid) != 1) >+ result.pid = -1; >+ else >+ result.pid = pid; > #endif >+ /* Assigning to result.pid may have overflowed >+ Map negative pid to -1: i.e. error */ >+ if (result.pid < 0) >+ result.pid = -1; >+ return result; > } > > char *procid_str(TALLOC_CTX *mem_ctx, const struct server_id *pid) >diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c >index fc7d0aa..7fab6eb 100644 >--- a/source3/utils/smbcontrol.c >+++ b/source3/utils/smbcontrol.c >@@ -1247,15 +1247,12 @@ static struct server_id parse_dest(const char *dest) > dest = "winbindd"; > } > >- if (!(strequal(dest, "winbindd") || strequal(dest, "nmbd"))) { >- /* Check for numeric pid number */ >+ /* Check for numeric pid number */ >+ result = interpret_pid(dest); > >- result = interpret_pid(dest); >- >- /* Zero isn't valid if not smbd. */ >- if (result.pid && procid_valid(&result)) { >- return result; >- } >+ /* Zero isn't valid if not "all". */ >+ if (result.pid && procid_valid(&result)) { >+ return result; > } > > /* Look up other destinations in pidfile directory */ >-- >1.6.0.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
vl
:
review+
metze
:
review+
Actions:
View
Attachments on
bug 6655
: 4581