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)
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) {
}
- result = json_add_string(&sub_json, "pid", pid);
+ result = add_server_id_to_json(&sub_json, e->pid);
if (result < 0) {
goto failure;
}
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) {
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,
result = add_open_to_json(&file_json,
e,
state->resolve_uids,
- pid,
op_str,
lease_type,
uid_str);