summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-06-12 17:56:43 +0200
committerStefan Metzmacher <metze@samba.org>2012-06-15 03:28:13 +0200
commit5d2af68a25534bd84601f3ac40853ef9fcb21edb (patch)
treefcdecd5b7e3b3ecfee835236e53337b5c7ee34d9 /source3
parent63bfc70a2ad391c7d0f0ce8d7c637ca2b5ba5645 (diff)
downloadsamba-5d2af68a25534bd84601f3ac40853ef9fcb21edb.tar.gz
samba-5d2af68a25534bd84601f3ac40853ef9fcb21edb.tar.bz2
samba-5d2af68a25534bd84601f3ac40853ef9fcb21edb.zip
s3:smbd: use FNUM_FIELD_INVALID instead of literal -1
This is in preparation of changing fnum to uint64_t Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/files.c4
-rw-r--r--source3/smbd/posix_acls.c2
-rw-r--r--source3/smbd/smb2_ioctl.c2
-rw-r--r--source3/smbd/trans2.c14
4 files changed, 13 insertions, 9 deletions
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 12ec04cd3b..ada9d67bc4 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -82,7 +82,7 @@ NTSTATUS fsp_new(struct connection_struct *conn, TALLOC_CTX *mem_ctx,
fsp->fh->ref_count = 1;
fsp->fh->fd = -1;
- fsp->fnum = -1;
+ fsp->fnum = FNUM_FIELD_INVALID;
fsp->conn = conn;
DLIST_ADD(sconn->files, fsp);
@@ -581,7 +581,7 @@ static struct files_struct *file_fnum(struct smbd_server_connection *sconn,
int count=0;
for (fsp=sconn->files; fsp; fsp=fsp->next, count++) {
- if (fsp->fnum == -1) {
+ if (fsp->fnum == FNUM_FIELD_INVALID) {
continue;
}
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index e2571ff248..9753bfeb61 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -4878,7 +4878,7 @@ struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fna
ZERO_STRUCT( finfo );
ZERO_STRUCT( fh );
- finfo.fnum = -1;
+ finfo.fnum = FNUM_FIELD_INVALID;
finfo.conn = conn;
finfo.fh = &fh;
finfo.fh->fd = -1;
diff --git a/source3/smbd/smb2_ioctl.c b/source3/smbd/smb2_ioctl.c
index 7710a9ebb2..db1ef0883e 100644
--- a/source3/smbd/smb2_ioctl.c
+++ b/source3/smbd/smb2_ioctl.c
@@ -372,7 +372,7 @@ static struct tevent_req *smbd_smb2_ioctl_send(TALLOC_CTX *mem_ctx,
DEBUG(10, ("smbd_smb2_ioctl: ctl_code[0x%08x] %s fnum[%d]\n",
(unsigned)in_ctl_code,
fsp ? fsp_str_dbg(fsp) : "<no handle>",
- fsp ? fsp->fnum : -1));
+ fsp ? fsp->fnum : FNUM_FIELD_INVALID));
smbreq = smbd_smb2_fake_smb_request(smb2req);
if (tevent_req_nomem(smbreq, req)) {
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 3787fa9721..b83eb9e1c3 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -3271,7 +3271,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
ZERO_STRUCT(quotas);
fsp.conn = conn;
- fsp.fnum = -1;
+ fsp.fnum = FNUM_FIELD_INVALID;
/* access check */
if (get_current_uid(conn) != 0) {
@@ -4290,7 +4290,8 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
}
DEBUG(5,("smbd_do_qfilepathinfo: %s (fnum = %d) level=%d max_data=%u\n",
- smb_fname_str_dbg(smb_fname), fsp ? fsp->fnum : -1,
+ smb_fname_str_dbg(smb_fname),
+ fsp ? fsp->fnum : FNUM_FIELD_INVALID,
info_level, max_data_bytes));
mode = dos_mode(conn, smb_fname);
@@ -5323,7 +5324,8 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
DEBUG(3,("call_trans2qfilepathinfo %s (fnum = %d) level=%d call=%d "
"total_data=%d\n", smb_fname_str_dbg(smb_fname),
- fsp ? fsp->fnum : -1, info_level,tran_call,total_data));
+ fsp ? fsp->fnum : FNUM_FIELD_INVALID,
+ info_level,tran_call,total_data));
/* Pull out any data sent here before we realloc. */
switch (info_level) {
@@ -7654,7 +7656,8 @@ NTSTATUS smbd_do_setfilepathinfo(connection_struct *conn,
DEBUG(3,("smbd_do_setfilepathinfo: %s (fnum %d) info_level=%d "
"totdata=%d\n", smb_fname_str_dbg(smb_fname),
- fsp ? fsp->fnum : -1, info_level, total_data));
+ fsp ? fsp->fnum : FNUM_FIELD_INVALID,
+ info_level, total_data));
switch (info_level) {
@@ -8077,7 +8080,8 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
DEBUG(3,("call_trans2setfilepathinfo(%d) %s (fnum %d) info_level=%d "
"totdata=%d\n", tran_call, smb_fname_str_dbg(smb_fname),
- fsp ? fsp->fnum : -1, info_level,total_data));
+ fsp ? fsp->fnum : FNUM_FIELD_INVALID,
+ info_level,total_data));
/* Realloc the parameter size */
*pparams = (char *)SMB_REALLOC(*pparams,2);