summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-06-06 15:22:31 +0200
committerMichael Adam <obnox@samba.org>2012-06-06 19:37:14 +0200
commitba1699463bee4d622e76f54c1a1c17858545c84f (patch)
tree9bb383e332c181f026939d0370e5389c385b56b3 /source3
parentaa3a7de3687ac78ae1ed3fa395d8c4707a24b774 (diff)
downloadsamba-ba1699463bee4d622e76f54c1a1c17858545c84f.tar.gz
samba-ba1699463bee4d622e76f54c1a1c17858545c84f.tar.bz2
samba-ba1699463bee4d622e76f54c1a1c17858545c84f.zip
s3:smb: introduce a name TID_FIELD_INVALID for the invalid value for a cnum/tid
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/include/smb.h1
-rw-r--r--source3/smbd/connection.c2
-rw-r--r--source3/smbd/msdfs.c2
-rw-r--r--source3/utils/net_status.c4
-rw-r--r--source3/utils/status.c2
-rw-r--r--source3/web/statuspage.c6
6 files changed, 9 insertions, 8 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 5ee2b1fb44..5887ca95e3 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -672,6 +672,7 @@ enum acl_compatibility {ACL_COMPAT_AUTO, ACL_COMPAT_WINNT, ACL_COMPAT_WIN2K};
#define UID_FIELD_INVALID 0
#define VUID_OFFSET 100 /* Amount to bias returned vuid numbers */
+#define TID_FIELD_INVALID -1
#define CNUM_OFFSET 1 /* shift for bitmap index */
/*
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index 01eb9d79f7..846a173ad7 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -71,7 +71,7 @@ static int count_fn(struct db_record *rec,
{
struct count_stat *cs = (struct count_stat *)udp;
- if (crec->cnum == -1) {
+ if (crec->cnum == TID_FIELD_INVALID) {
return 0;
}
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 9da8a8da75..6f182b4920 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -276,7 +276,7 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
}
conn->params->service = snum;
- conn->cnum = (unsigned)-1;
+ conn->cnum = TID_FIELD_INVALID;
DLIST_ADD(conn->sconn->connections, conn);
conn->sconn->num_connections++;
diff --git a/source3/utils/net_status.c b/source3/utils/net_status.c
index 2bb639138e..85d023505e 100644
--- a/source3/utils/net_status.c
+++ b/source3/utils/net_status.c
@@ -96,7 +96,7 @@ static int show_share(struct db_record *rec,
const struct connections_data *crec,
void *state)
{
- if (crec->cnum == -1)
+ if (crec->cnum == TID_FIELD_INVALID)
return 0;
if (!process_exists(crec->pid)) {
@@ -143,7 +143,7 @@ static int show_share_parseable(const struct connections_key *key,
int i;
bool guest = true;
- if (crec->cnum == -1)
+ if (crec->cnum == TID_FIELD_INVALID)
return 0;
if (!process_exists(crec->pid)) {
diff --git a/source3/utils/status.c b/source3/utils/status.c
index 1bcb1403fc..a6e8055062 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -250,7 +250,7 @@ static int traverse_fn1(const struct connections_key *key,
const struct connections_data *crec,
void *state)
{
- if (crec->cnum == -1)
+ if (crec->cnum == TID_FIELD_INVALID)
return 0;
if (!process_exists(crec->pid) || !Ucrit_checkUid(crec->uid)) {
diff --git a/source3/web/statuspage.c b/source3/web/statuspage.c
index 4b3d3aea86..dd83d158ae 100644
--- a/source3/web/statuspage.c
+++ b/source3/web/statuspage.c
@@ -190,7 +190,7 @@ static int traverse_fn1(const struct connections_key *key,
const struct connections_data *crec,
void *private_data)
{
- if (crec->cnum == -1 && process_exists(crec->pid)) {
+ if (crec->cnum == TID_FIELD_INVALID && process_exists(crec->pid)) {
char buf[30];
slprintf(buf,sizeof(buf)-1,"kill_%s", procid_str_static(&crec->pid));
if (cgi_variable(buf)) {
@@ -206,7 +206,7 @@ static int traverse_fn2(const struct connections_key *key,
const struct connections_data *crec,
void *private_data)
{
- if (crec->cnum == -1 || !process_exists(crec->pid) ||
+ if (crec->cnum == TID_FIELD_INVALID || !process_exists(crec->pid) ||
procid_equal(&crec->pid, &smbd_pid))
return 0;
@@ -230,7 +230,7 @@ static int traverse_fn3(const struct connections_key *key,
const struct connections_data *crec,
void *private_data)
{
- if (crec->cnum == -1 || !process_exists(crec->pid))
+ if (crec->cnum == TID_FIELD_INVALID || !process_exists(crec->pid))
return 0;
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",