diff options
author | Volker Lendecke <vl@samba.org> | 2015-04-23 18:06:17 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-04-28 18:11:13 +0200 |
commit | db5b76690388ff1ae31b8197572d1cfb65eed6c0 (patch) | |
tree | 4a4795c7c9e68a62ba67c45649890221582a474a /source3/utils | |
parent | fdbca5e13a0375d7f18639679a627e67c3df647a (diff) | |
download | samba-db5b76690388ff1ae31b8197572d1cfb65eed6c0.tar.gz |
lib: Remove procid_str_static
Replace all callers with direct calls to server_id_str_buf without
talloc_tos()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_status.c | 12 | ||||
-rw-r--r-- | source3/utils/status.c | 13 |
2 files changed, 17 insertions, 8 deletions
diff --git a/source3/utils/net_status.c b/source3/utils/net_status.c index be24fec5732..9dbb1a45847 100644 --- a/source3/utils/net_status.c +++ b/source3/utils/net_status.c @@ -34,6 +34,7 @@ int net_status_usage(struct net_context *c, int argc, const char **argv) static int show_session(const char *key, struct sessionid *session, void *private_data) { + struct server_id_buf tmp; bool *parseable = (bool *)private_data; if (!process_exists(session->pid)) { @@ -42,13 +43,13 @@ static int show_session(const char *key, struct sessionid *session, if (*parseable) { d_printf("%s\\%s\\%s\\%s\\%s\n", - procid_str_static(&session->pid), + server_id_str_buf(session->pid, &tmp), uidtoname(session->uid), gidtoname(session->gid), session->remote_machine, session->hostname); } else { d_printf("%7s %-12s %-12s %-12s (%s)\n", - procid_str_static(&session->pid), + server_id_str_buf(session->pid, &tmp), uidtoname(session->uid), gidtoname(session->gid), session->remote_machine, session->hostname); @@ -95,6 +96,8 @@ static int show_share(const struct connections_key *key, const struct connections_data *crec, void *state) { + struct server_id_buf tmp; + if (crec->cnum == TID_FIELD_INVALID) return 0; @@ -103,7 +106,7 @@ static int show_share(const struct connections_key *key, } d_printf("%-10.10s %s %-12s %s", - crec->servicename, procid_str_static(&crec->pid), + crec->servicename, server_id_str_buf(crec->pid, &tmp), crec->machine, time_to_asc(crec->start)); @@ -139,6 +142,7 @@ static int show_share_parseable(const struct connections_key *key, void *state) { struct sessionids *ids = (struct sessionids *)state; + struct server_id_buf tmp; int i; bool guest = true; @@ -158,7 +162,7 @@ static int show_share_parseable(const struct connections_key *key, } d_printf("%s\\%s\\%s\\%s\\%s\\%s\\%s", - crec->servicename,procid_str_static(&crec->pid), + crec->servicename, server_id_str_buf(crec->pid, &tmp), guest ? "" : uidtoname(ids->entries[i].uid), guest ? "" : gidtoname(ids->entries[i].gid), crec->machine, diff --git a/source3/utils/status.c b/source3/utils/status.c index 80aa18e1037..33ca728cf50 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -137,7 +137,8 @@ static int print_share_mode(const struct share_mode_entry *e, } if (Ucrit_checkPid(e->pid)) { - d_printf("%-11s ",procid_str_static(&e->pid)); + struct server_id_buf tmp; + d_printf("%-11s ", server_id_str_buf(e->pid, &tmp)); d_printf("%-9u ", (unsigned int)e->uid); switch (map_share_mode_to_deny_mode(e->share_access, e->private_options)) { @@ -218,6 +219,7 @@ static void print_brl(struct file_id id, const char *sharepath = ""; char *fname = NULL; struct share_mode_lock *share_mode; + struct server_id_buf tmp; if (count==0) { d_printf("Byte range locks:\n"); @@ -250,7 +252,7 @@ static void print_brl(struct file_id id, } d_printf("%-10s %-15s %-4s %-9jd %-9jd %-24s %-24s\n", - procid_str_static(&pid), file_id_string_tos(&id), + server_id_str_buf(pid, &tmp), file_id_string_tos(&id), desc, (intmax_t)start, (intmax_t)size, sharepath, fname); @@ -263,6 +265,8 @@ static int traverse_connections(const struct connections_key *key, const struct connections_data *crec, void *state) { + struct server_id_buf tmp; + if (crec->cnum == TID_FIELD_INVALID) return 0; @@ -272,7 +276,7 @@ static int traverse_connections(const struct connections_key *key, } d_printf("%-10s %s %-12s %s", - crec->servicename,procid_str_static(&crec->pid), + crec->servicename, server_id_str_buf(crec->pid, &tmp), crec->machine, time_to_asc(crec->start)); @@ -283,6 +287,7 @@ static int traverse_sessionid(const char *key, struct sessionid *session, void *private_data) { fstring uid_str, gid_str; + struct server_id_buf tmp; if (do_checks && (!process_exists(session->pid) || @@ -313,7 +318,7 @@ static int traverse_sessionid(const char *key, struct sessionid *session, } d_printf("%-7s %-12s %-12s %-12s (%s) %-12s\n", - procid_str_static(&session->pid), + server_id_str_buf(session->pid, &tmp), uid_str, gid_str, session->remote_machine, session->hostname, session->protocol_ver); |