From: Jule Anger Date: Mon, 2 May 2022 08:56:27 +0000 (+0200) Subject: smbstatus: add server_id to open files dictionary X-Git-Tag: samba-4.17.0rc1~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=003684dc67854ed1dbb23d46241758786ca87239;p=thirdparty%2Fsamba.git smbstatus: add server_id to open files dictionary Signed-off-by: Jule Anger Reviewed-by: Ralph Boehme --- diff --git a/source3/utils/status.c b/source3/utils/status.c index cf58ff83100..fbe9ce1a15e 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -317,7 +317,6 @@ static int print_share_mode(struct file_id fid, d, e, fid, - pid, user_str, oplock, lstate, diff --git a/source3/utils/status_json.c b/source3/utils/status_json.c index 56cf0e2ab95..ce6ee178b4a 100644 --- a/source3/utils/status_json.c +++ b/source3/utils/status_json.c @@ -617,7 +617,6 @@ failure: static int add_open_to_json(struct json_object *parent_json, const struct share_mode_entry *e, bool resolve_uids, - const char *pid, const char *op_str, uint32_t lease_type, const char *uid_str) @@ -628,6 +627,8 @@ static int add_open_to_json(struct json_object *parent_json, bool add_lease = false; char *key = NULL; char *share_file_id = NULL; + char *pid = NULL; + struct server_id_buf tmp; TALLOC_CTX *tmp_ctx = talloc_stackframe(); if (tmp_ctx == NULL) { @@ -644,7 +645,7 @@ static int add_open_to_json(struct json_object *parent_json, } - result = json_add_string(&sub_json, "pid", pid); + result = add_server_id_to_json(&sub_json, e->pid); if (result < 0) { goto failure; } @@ -677,6 +678,7 @@ static int add_open_to_json(struct json_object *parent_json, goto failure; } + pid = server_id_str_buf(e->pid, &tmp); key = talloc_asprintf(tmp_ctx, "%s/%lu", pid, e->share_file_id); result = json_add_object(&opens_json, key, &sub_json); if (result < 0) { @@ -735,7 +737,6 @@ int print_share_mode_json(struct traverse_state *state, const struct share_mode_data *d, const struct share_mode_entry *e, struct file_id fid, - const char *pid, const char *uid_str, const char *op_str, uint32_t lease_type, @@ -786,7 +787,6 @@ int print_share_mode_json(struct traverse_state *state, result = add_open_to_json(&file_json, e, state->resolve_uids, - pid, op_str, lease_type, uid_str); diff --git a/source3/utils/status_json.h b/source3/utils/status_json.h index 2ee5b59fba8..1f23dc1d62b 100644 --- a/source3/utils/status_json.h +++ b/source3/utils/status_json.h @@ -48,7 +48,6 @@ int print_share_mode_json(struct traverse_state *state, const struct share_mode_data *d, const struct share_mode_entry *e, struct file_id fid, - const char *pid, const char *uid_str, const char *op_str, uint32_t lease_type, diff --git a/source3/utils/status_json_dummy.c b/source3/utils/status_json_dummy.c index 51bdfb4cf78..c92fbb49372 100644 --- a/source3/utils/status_json_dummy.c +++ b/source3/utils/status_json_dummy.c @@ -62,7 +62,6 @@ int print_share_mode_json(struct traverse_state *state, const struct share_mode_data *d, const struct share_mode_entry *e, struct file_id fid, - const char *pid, const char *uid_str, const char *op_str, uint32_t lease_type,