From c5caea43af154671448df82881efe09a5c982386 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 25 Aug 2007 19:47:57 +0000 Subject: [PATCH] r24659: Some formatting changes helping to minimize the 3_2_0 diff --- source/smbd/negprot.c | 9 ++++----- source/smbd/nttrans.c | 6 +++--- source/smbd/reply.c | 16 ++++++++-------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/source/smbd/negprot.c b/source/smbd/negprot.c index 935d25fab33..4437f0bd3f5 100644 --- a/source/smbd/negprot.c +++ b/source/smbd/negprot.c @@ -229,10 +229,9 @@ static DATA_BLOB negprot_spnego(void) char *host_princ_s = NULL; name_to_fqdn(myname, global_myname()); strlower_m(myname); - asprintf(&host_princ_s, "cifs/%s@%s", myname, lp_realm()); - if (host_princ_s == NULL) { - blob = data_blob_null; - return blob; + if (asprintf(&host_princ_s, "cifs/%s@%s", myname, lp_realm()) + == -1) { + return data_blob_null; } blob = spnego_gen_negTokenInit(guid, OIDs_krb5, host_princ_s); SAFE_FREE(host_princ_s); @@ -540,7 +539,7 @@ void reply_negprot(connection_struct *conn, struct smb_request *req) num_cliprotos = 0; cliprotos = NULL; - while (p < (smb_buf(req->inbuf) + bcc)) { + while (p < (smb_buf(req->inbuf) + bcc)) { char **tmp; diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c index 907176c161e..5e200023394 100644 --- a/source/smbd/nttrans.c +++ b/source/smbd/nttrans.c @@ -859,19 +859,19 @@ void reply_ntcreate_and_X(connection_struct *conn, create_options, file_attributes, &info, &fsp); - } } TALLOC_FREE(case_state); - if (!NT_STATUS_IS_OK(status)) { - END_PROFILE(SMBntcreateX); + if (!NT_STATUS_IS_OK(status)) { if (open_was_deferred(req->mid)) { /* We have re-scheduled this call. */ + END_PROFILE(SMBntcreateX); return; } reply_openerror(req, status); + END_PROFILE(SMBntcreateX); return; } diff --git a/source/smbd/reply.c b/source/smbd/reply.c index b3c4717b0b6..c3ae4ef61f6 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -486,7 +486,7 @@ void reply_tcon(connection_struct *conn, struct smb_request *req) SSVAL(req->outbuf,smb_vwv1,conn->cnum); SSVAL(req->outbuf,smb_tid,conn->cnum); - DEBUG(3,("tcon service=%s cnum=%d\n", + DEBUG(3,("tcon service=%s cnum=%d\n", service, conn->cnum)); END_PROFILE(SMBtcon); @@ -1550,12 +1550,13 @@ void reply_open(connection_struct *conn, struct smb_request *req) &info, &fsp); if (!NT_STATUS_IS_OK(status)) { - END_PROFILE(SMBopen); if (open_was_deferred(req->mid)) { + END_PROFILE(SMBopen); /* We have re-scheduled this call. */ return; } reply_openerror(req, status); + END_PROFILE(SMBopen); return; } @@ -1876,7 +1877,7 @@ void reply_mknew(connection_struct *conn, struct smb_request *req) srvstr_get_path((char *)req->inbuf, req->flags2, fname, smb_buf(req->inbuf) + 1, sizeof(fname), 0, - STR_TERMINATE, &status); + STR_TERMINATE, &status); if (!NT_STATUS_IS_OK(status)) { reply_nterror(req, status); END_PROFILE(SMBcreate); @@ -1947,7 +1948,6 @@ void reply_mknew(connection_struct *conn, struct smb_request *req) file_ntimes(conn, fname, ts); reply_outbuf(req, 1, 0); - SSVAL(req->outbuf,smb_vwv0,fsp->fnum); if (oplock_request && lp_fake_oplocks(SNUM(conn))) { @@ -2059,12 +2059,13 @@ void reply_ctemp(connection_struct *conn, struct smb_request *req) close(tmpfd); if (!NT_STATUS_IS_OK(status)) { - END_PROFILE(SMBctemp); if (open_was_deferred(req->mid)) { /* We have re-scheduled this call. */ + END_PROFILE(SMBctemp); return; } reply_openerror(req, status); + END_PROFILE(SMBctemp); return; } @@ -2668,7 +2669,7 @@ void reply_readbraw(connection_struct *conn, struct smb_request *req) fsp = file_fsp(SVAL(req->inbuf,smb_vwv0)); - /* + /* * We have to do a check_fsp by hand here, as * we must always return 4 zero bytes on error, * not a NTSTATUS. @@ -2760,7 +2761,7 @@ void reply_readbraw(connection_struct *conn, struct smb_request *req) if (startpos >= size) { nread = 0; } else { - nread = MIN(maxcount,(size - startpos)); + nread = MIN(maxcount,(size - startpos)); } #if 0 /* mincount appears to be ignored in a W2K server. JRA. */ @@ -3088,7 +3089,6 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req, TALLOC_FREE(req->outbuf); return; } - #endif normal_read: -- 2.11.4.GIT