DATA_BLOB *data)
{
char *message = debug_list_class_names_and_levels();
+ struct server_id_buf tmp;
if (!message) {
DEBUG(0,("debuglevel_message - debug_list_class_names_and_levels returned NULL\n"));
return;
}
- DEBUG(1,("INFO: Received REQ_DEBUGLEVEL message from PID %s\n",
- procid_str_static(&src)));
+ DEBUG(1, ("INFO: Received REQ_DEBUGLEVEL message from PID %s\n",
+ server_id_str_buf(src, &tmp)));
messaging_send_buf(msg_ctx, src, MSG_DEBUGLEVEL,
(uint8 *)message, strlen(message) + 1);
#define serverid_equal(p1, p2) server_id_equal(p1,p2)
bool procid_is_me(const struct server_id *pid);
struct server_id interpret_pid(const char *pid_string);
-char *procid_str_static(const struct server_id *pid);
bool procid_valid(const struct server_id *pid);
bool procid_is_local(const struct server_id *pid);
bool is_offset_safe(const char *buf_base, size_t buf_len, char *ptr, size_t off);
status = messaging_send_buf(msg, ids[i], MSG_DBWRAP_MODIFIED,
w_key.dptr, w_key.dsize);
if (!NT_STATUS_IS_OK(status)) {
- char *str = procid_str_static(&ids[i]);
+ struct server_id_buf tmp;
DEBUG(1, ("messaging_send to %s failed: %s\n",
- str, nt_errstr(status)));
- TALLOC_FREE(str);
+ server_id_str_buf(ids[i], &tmp),
+ nt_errstr(status)));
}
}
done:
return server_id_from_string(get_my_vnn(), pid_string);
}
-char *procid_str_static(const struct server_id *pid)
-{
- return server_id_str(talloc_tos(), pid);
-}
-
bool procid_valid(const struct server_id *pid)
{
return (pid->pid != (uint64_t)-1);
if (pend_lock->lock_type == PENDING_READ_LOCK &&
brl_pending_overlap(plock, pend_lock)) {
- DEBUG(10,("brl_lock_posix: sending unlock message to pid %s\n",
- procid_str_static(&pend_lock->context.pid )));
+ struct server_id_buf tmp;
+
+ DEBUG(10, ("brl_lock_posix: sending unlock "
+ "message to pid %s\n",
+ server_id_str_buf(pend_lock->context.pid,
+ &tmp)));
messaging_send(msg_ctx, pend_lock->context.pid,
MSG_SMB_UNLOCK, &data_blob_null);
/* We could send specific lock info here... */
if (brl_pending_overlap(plock, pend_lock)) {
- DEBUG(10,("brl_unlock: sending unlock message to pid %s\n",
- procid_str_static(&pend_lock->context.pid )));
+ struct server_id_buf tmp;
+
+ DEBUG(10, ("brl_unlock: sending unlock message to "
+ "pid %s\n",
+ server_id_str_buf(pend_lock->context.pid,
+ &tmp)));
messaging_send(msg_ctx, pend_lock->context.pid,
MSG_SMB_UNLOCK, &data_blob_null);
/* We could send specific lock info here... */
if (brl_pending_overlap(plock, pend_lock)) {
- DEBUG(10,("brl_unlock: sending unlock message to pid %s\n",
- procid_str_static(&pend_lock->context.pid )));
+ struct server_id_buf tmp;
+
+ DEBUG(10, ("brl_unlock: sending unlock message to "
+ "pid %s\n",
+ server_id_str_buf(pend_lock->context.pid,
+ &tmp)));
messaging_send(msg_ctx, pend_lock->context.pid,
MSG_SMB_UNLOCK, &data_blob_null);
char *share_mode_str(TALLOC_CTX *ctx, int num, const struct share_mode_entry *e)
{
+ struct server_id_buf tmp;
+
return talloc_asprintf(ctx, "share_mode_entry[%d]: "
"pid = %s, share_access = 0x%x, private_options = 0x%x, "
"access_mask = 0x%x, mid = 0x%llx, type= 0x%x, gen_id = %llu, "
"uid = %u, flags = %u, file_id %s, name_hash = 0x%x",
num,
- procid_str_static(&e->pid),
+ server_id_str_buf(e->pid, &tmp),
e->share_access, e->private_options,
e->access_mask, (unsigned long long)e->op_mid,
e->op_type, (unsigned long long)e->share_file_id,
/* Send the messages. */
for (i=0; i<d->num_share_modes; i++) {
struct share_mode_entry *se = &d->share_modes[i];
+ struct server_id_buf tmp;
+
if (!is_valid_share_mode_entry(se)) {
continue;
}
DEBUG(10,("rename_share_filename: sending rename message to "
"pid %s file_id %s sharepath %s base_name %s "
"stream_name %s\n",
- procid_str_static(&se->pid),
+ server_id_str_buf(se->pid, &tmp),
file_id_string_tos(&id),
d->servicepath, d->base_name,
has_stream ? d->stream_name : ""));
*/
bool share_mode_stale_pid(struct share_mode_data *d, uint32_t idx)
{
+ struct server_id_buf tmp;
struct share_mode_entry *e;
if (idx > d->num_share_modes) {
}
if (serverid_exists(&e->pid)) {
DEBUG(10, ("PID %s (index %u out of %u) still exists\n",
- procid_str_static(&e->pid), idx,
+ server_id_str_buf(e->pid, &tmp), idx,
(unsigned)d->num_share_modes));
return false;
}
DEBUG(10, ("PID %s (index %u out of %u) does not exist anymore\n",
- procid_str_static(&e->pid), idx,
+ server_id_str_buf(e->pid, &tmp), idx,
(unsigned)d->num_share_modes));
e->stale = true;
void *private_data)
{
TDB_DATA value = dbwrap_record_get_value(rec);
+ struct server_id_buf tmp;
struct notify_db_entry *entries;
size_t i, num_entries;
time_t now;
- DEBUG(10, ("del_entry called for %s %p\n", procid_str_static(pid),
- private_data));
+ DEBUG(10, ("del_entry called for %s %p\n",
+ server_id_str_buf(*pid, &tmp), private_data));
if ((value.dsize % sizeof(struct notify_db_entry)) != 0) {
DEBUG(1, ("Invalid value.dsize = %u\n",
}
if (!procid_is_local(&e->server)) {
+ struct server_id_buf tmp;
DEBUG(1, ("internal error: Non-local pid %s in "
"notify.tdb\n",
- procid_str_static(&e->server)));
+ server_id_str_buf(e->server, &tmp)));
continue;
}
{
NTSTATUS status;
char msg[MSG_SMB_SHARE_MODE_ENTRY_SIZE];
+ struct server_id_buf tmp;
DEBUG(10, ("Sending break request to PID %s\n",
- procid_str_static(&exclusive->pid)));
+ server_id_str_buf(exclusive->pid, &tmp)));
/* Create the message. */
share_mode_entry_to_message(msg, exclusive);
DATA_BLOB *data)
{
int sig;
+ struct server_id_buf tmp;
if (data->length != sizeof(sig)) {
DEBUG(0, ("Process %s sent bogus signal injection request\n",
- procid_str_static(&src)));
+ server_id_str_buf(src, &tmp)));
return;
}
#if HAVE_STRSIGNAL
DEBUG(0, ("Process %s requested injection of signal %d (%s)\n",
- procid_str_static(&src), sig, strsignal(sig)));
+ server_id_str_buf(src, &tmp), sig, strsignal(sig)));
#else
DEBUG(0, ("Process %s requested injection of signal %d\n",
- procid_str_static(&src), sig));
+ server_id_str_buf(src, &tmp), sig));
#endif
kill(getpid(), sig);
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)) {
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);
const struct connections_data *crec,
void *state)
{
+ struct server_id_buf tmp;
+
if (crec->cnum == TID_FIELD_INVALID)
return 0;
}
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));
void *state)
{
struct sessionids *ids = (struct sessionids *)state;
+ struct server_id_buf tmp;
int i;
bool guest = true;
}
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,
}
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)) {
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");
}
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);
const struct connections_data *crec,
void *state)
{
+ struct server_id_buf tmp;
+
if (crec->cnum == TID_FIELD_INVALID)
return 0;
}
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));
void *private_data)
{
fstring uid_str, gid_str;
+ struct server_id_buf tmp;
if (do_checks &&
(!process_exists(session->pid) ||
}
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);