summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-05-07 15:31:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:21:54 -0500
commit76ce309234adbe0a6a56b849a91714cab148c4a7 (patch)
tree0fe73b35a0c08fbc9b347dfeb23ce89f0bc08885 /source3/utils
parent71921605995fa95d84301534760a6bc2db3fa74b (diff)
downloadsamba-76ce309234adbe0a6a56b849a91714cab148c4a7.tar.gz
samba-76ce309234adbe0a6a56b849a91714cab148c4a7.tar.bz2
samba-76ce309234adbe0a6a56b849a91714cab148c4a7.zip
r22751: Next step for the cluster merge: sessionid.tdb should contain a 'struct
server_id' instead of a 'uint32 pid' (This used to be commit be7bac55c37676a8137c59a22dfb2e4c4821ac21)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_status.c16
-rw-r--r--source3/utils/status.c16
2 files changed, 16 insertions, 16 deletions
diff --git a/source3/utils/net_status.c b/source3/utils/net_status.c
index 72ea645896..af6952389c 100644
--- a/source3/utils/net_status.c
+++ b/source3/utils/net_status.c
@@ -31,18 +31,18 @@ static int show_session(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf,
memcpy(&sessionid, dbuf.dptr, sizeof(sessionid));
- if (!process_exists_by_pid(sessionid.pid)) {
+ if (!process_exists(sessionid.pid)) {
return 0;
}
if (*parseable) {
- d_printf("%d\\%s\\%s\\%s\\%s\n",
- (int)sessionid.pid, uidtoname(sessionid.uid),
+ d_printf("%s\\%s\\%s\\%s\\%s\n",
+ procid_str_static(&sessionid.pid), uidtoname(sessionid.uid),
gidtoname(sessionid.gid),
sessionid.remote_machine, sessionid.hostname);
} else {
- d_printf("%5d %-12s %-12s %-12s (%s)\n",
- (int)sessionid.pid, uidtoname(sessionid.uid),
+ d_printf("%7s %-12s %-12s %-12s (%s)\n",
+ procid_str_static(&sessionid.pid), uidtoname(sessionid.uid),
gidtoname(sessionid.gid),
sessionid.remote_machine, sessionid.hostname);
}
@@ -102,7 +102,7 @@ static int show_share(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf,
}
d_printf("%-10.10s %s %-12s %s",
- crec.servicename,procid_str_static(&crec.pid),
+ crec.servicename, procid_str_static(&crec.pid),
crec.machine,
time_to_asc(crec.start));
@@ -125,7 +125,7 @@ static int collect_pid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf,
memcpy(&sessionid, dbuf.dptr, sizeof(sessionid));
- if (!process_exists_by_pid(sessionid.pid))
+ if (!process_exists(sessionid.pid))
return 0;
ids->num_entries += 1;
@@ -160,7 +160,7 @@ static int show_share_parseable(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf,
}
for (i=0; i<ids->num_entries; i++) {
- struct server_id id = pid_to_procid(ids->entries[i].pid);
+ struct server_id id = ids->entries[i].pid;
if (procid_equal(&id, &crec.pid)) {
guest = False;
break;
diff --git a/source3/utils/status.c b/source3/utils/status.c
index 944158567a..d3bb79dd01 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -35,7 +35,7 @@
#define SMB_MAXPIDS 2048
static uid_t Ucrit_uid = 0; /* added by OH */
-static pid_t Ucrit_pid[SMB_MAXPIDS]; /* Ugly !!! */ /* added by OH */
+static struct server_id Ucrit_pid[SMB_MAXPIDS]; /* Ugly !!! */ /* added by OH */
static int Ucrit_MaxPid=0; /* added by OH */
static unsigned int Ucrit_IsActive = 0; /* added by OH */
@@ -69,7 +69,7 @@ static unsigned int Ucrit_checkUid(uid_t uid)
return 0;
}
-static unsigned int Ucrit_checkPid(pid_t pid)
+static unsigned int Ucrit_checkPid(struct server_id pid)
{
int i;
@@ -77,14 +77,14 @@ static unsigned int Ucrit_checkPid(pid_t pid)
return 1;
for (i=0;i<Ucrit_MaxPid;i++) {
- if( pid == Ucrit_pid[i] )
+ if (cluster_id_equal(&pid, &Ucrit_pid[i]))
return 1;
}
return 0;
}
-static BOOL Ucrit_addPid( pid_t pid )
+static BOOL Ucrit_addPid( struct server_id pid )
{
if ( !Ucrit_IsActive )
return True;
@@ -119,7 +119,7 @@ static void print_share_mode(const struct share_mode_entry *e,
}
count++;
- if (Ucrit_checkPid(procid_to_pid(&e->pid))) {
+ if (Ucrit_checkPid(e->pid)) {
d_printf("%-11s ",procid_str_static(&e->pid));
d_printf("%-9u ", (unsigned int)e->uid);
switch (map_share_mode_to_deny_mode(e->share_access,
@@ -222,7 +222,7 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
memcpy(&sessionid, dbuf.dptr, sizeof(sessionid));
- if (!process_exists_by_pid(sessionid.pid) || !Ucrit_checkUid(sessionid.uid)) {
+ if (!process_exists(sessionid.pid) || !Ucrit_checkUid(sessionid.uid)) {
return 0;
}
@@ -231,8 +231,8 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
fstr_sprintf(uid_str, "%d", sessionid.uid);
fstr_sprintf(gid_str, "%d", sessionid.gid);
- d_printf("%5d %-12s %-12s %-12s (%s)\n",
- (int)sessionid.pid,
+ d_printf("%s %-12s %-12s %-12s (%s)\n",
+ procid_str_static(&sessionid.pid),
numeric_only ? uid_str : uidtoname(sessionid.uid),
numeric_only ? gid_str : gidtoname(sessionid.gid),
sessionid.remote_machine, sessionid.hostname);