struct connections_data crec;
struct msg_all *msg_all = (struct msg_all *)state;
+ if (dbuf.dsize != sizeof(crec))
+ return 0;
+
memcpy(&crec, dbuf.dptr, sizeof(crec));
- if (crec.cnum != -1) return 0;
+ if (crec.cnum != -1)
+ return 0;
/* if the msg send fails because the pid was not found (i.e. smbd died),
* the msg has already been deleted from the messages.tdb.*/
struct session_record *ptr;
struct connections_data crec;
+ if (dbuf.dsize != sizeof(crec))
+ return 0;
+
memcpy(&crec, dbuf.dptr, sizeof(crec));
- if (crec.cnum == -1) return 0;
+ if (crec.cnum == -1)
+ return 0;
if (!process_exists(crec.pid) || !Ucrit_checkUsername(uidtoname(crec.uid))) {
return 0;
/*
Unix SMB/Netbios implementation.
- Version 1.9.
+ Version 2.2.
web status page
Copyright (C) Andrew Tridgell 1997-1998
static int traverse_fn1(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, void* state)
{
struct connections_data crec;
+
+ if (dbuf.dsize != sizeof(crec))
+ return 0;
+
memcpy(&crec, dbuf.dptr, sizeof(crec));
if (crec.cnum == -1 && process_exists(crec.pid)) {
static int traverse_fn2(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, void* state)
{
struct connections_data crec;
+
+ if (dbuf.dsize != sizeof(crec))
+ return 0;
+
memcpy(&crec, dbuf.dptr, sizeof(crec));
- if (crec.cnum != -1 || !process_exists(crec.pid) ||
- (crec.pid == smbd_pid)) return 0;
+ if (crec.cnum != -1 || !process_exists(crec.pid) || (crec.pid == smbd_pid))
+ return 0;
printf("<tr><td>%d</td><td>%s</td><td>%s</td><td>%s</td>\n",
(int)crec.pid,
static int traverse_fn3(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, void* state)
{
struct connections_data crec;
+
+ if (dbuf.dsize != sizeof(crec))
+ return 0;
+
memcpy(&crec, dbuf.dptr, sizeof(crec));
- if (crec.cnum == -1 || !process_exists(crec.pid)) return 0;
+ if (crec.cnum == -1 || !process_exists(crec.pid))
+ return 0;
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%d</td><td>%s</td><td>%s</td></tr>\n",
crec.name,uidtoname(crec.uid),
printf("//-->\n</script>\n");
}
}
-