From ef2e26c91b80556af033d3335e55f5dfa6fff31d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Aug 2003 01:53:07 +0000 Subject: first public release of samba4 code (This used to be commit b0510b5428b3461aeb9bbe3cc95f62fc73e2b97f) --- source4/libcli/raw/clioplock.c | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 source4/libcli/raw/clioplock.c (limited to 'source4/libcli/raw/clioplock.c') diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c new file mode 100644 index 0000000000..8f69716bda --- /dev/null +++ b/source4/libcli/raw/clioplock.c @@ -0,0 +1,57 @@ +/* + Unix SMB/CIFS implementation. + SMB client oplock functions + Copyright (C) Andrew Tridgell 2001 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" + +/**************************************************************************** +send an ack for an oplock break request +****************************************************************************/ +BOOL cli_oplock_ack(struct cli_tree *tree, uint16 fnum, uint16 ack_level) +{ + BOOL ret; + struct cli_request *req; + + req = cli_request_setup(tree, SMBlockingX, 8, 0); + + SSVAL(req->out.vwv,VWV(0),0xFF); + SSVAL(req->out.vwv,VWV(1),0); + SSVAL(req->out.vwv,VWV(2),fnum); + SSVAL(req->out.vwv,VWV(3),ack_level); + SIVAL(req->out.vwv,VWV(4),0); + SSVAL(req->out.vwv,VWV(6),0); + SSVAL(req->out.vwv,VWV(7),0); + + ret = cli_request_send(req); + cli_request_destroy(req); + + return ret; +} + + +/**************************************************************************** +set the oplock handler for a connection +****************************************************************************/ +void cli_oplock_handler(struct cli_transport *transport, + BOOL (*handler)(struct cli_transport *, uint16, uint16, uint8, void *), + void *private) +{ + transport->oplock.handler = handler; + transport->oplock.private = private; +} -- cgit From f169d83a8b707d6d480c456bf4e4ca7c85dadbae Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 25 Mar 2004 02:41:19 +0000 Subject: fixed the handling of level II oplocks in samba4, especially when acting as a cifs redirectory (using the cifs backend) (This used to be commit 06a8100e6a2f3f079af5b6ec32d87d1d25f56c3c) --- source4/libcli/raw/clioplock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/libcli/raw/clioplock.c') diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c index 8f69716bda..f27bf937ce 100644 --- a/source4/libcli/raw/clioplock.c +++ b/source4/libcli/raw/clioplock.c @@ -33,7 +33,8 @@ BOOL cli_oplock_ack(struct cli_tree *tree, uint16 fnum, uint16 ack_level) SSVAL(req->out.vwv,VWV(0),0xFF); SSVAL(req->out.vwv,VWV(1),0); SSVAL(req->out.vwv,VWV(2),fnum); - SSVAL(req->out.vwv,VWV(3),ack_level); + SCVAL(req->out.vwv,VWV(3),LOCKING_ANDX_OPLOCK_RELEASE); + SCVAL(req->out.vwv,VWV(3)+1,ack_level); SIVAL(req->out.vwv,VWV(4),0); SSVAL(req->out.vwv,VWV(6),0); SSVAL(req->out.vwv,VWV(7),0); -- cgit From f88bf54c7f6d1c2ef833047eb8327953c304b5ff Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 25 May 2004 17:24:24 +0000 Subject: r889: convert samba4 to use [u]int16_t instead of [u]int16 metze (This used to be commit af6f1f8a01bebbecd99bc8c066519e89966e65e3) --- source4/libcli/raw/clioplock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/raw/clioplock.c') diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c index f27bf937ce..eacfd411a0 100644 --- a/source4/libcli/raw/clioplock.c +++ b/source4/libcli/raw/clioplock.c @@ -23,7 +23,7 @@ /**************************************************************************** send an ack for an oplock break request ****************************************************************************/ -BOOL cli_oplock_ack(struct cli_tree *tree, uint16 fnum, uint16 ack_level) +BOOL cli_oplock_ack(struct cli_tree *tree, uint16_t fnum, uint16_t ack_level) { BOOL ret; struct cli_request *req; -- cgit From 47864891ffd6309764fdc3a5227ec2e83c6f7107 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 26 May 2004 01:13:12 +0000 Subject: r893: a few more _t conversions (This used to be commit 66eb46dbb1486c5916194bf6b303cf16373a272a) --- source4/libcli/raw/clioplock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/raw/clioplock.c') diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c index eacfd411a0..0cd6adb41f 100644 --- a/source4/libcli/raw/clioplock.c +++ b/source4/libcli/raw/clioplock.c @@ -50,7 +50,7 @@ BOOL cli_oplock_ack(struct cli_tree *tree, uint16_t fnum, uint16_t ack_level) set the oplock handler for a connection ****************************************************************************/ void cli_oplock_handler(struct cli_transport *transport, - BOOL (*handler)(struct cli_transport *, uint16, uint16, uint8, void *), + BOOL (*handler)(struct cli_transport *, uint16_t, uint16_t, uint8_t, void *), void *private) { transport->oplock.handler = handler; -- cgit From 53781e9d37b9adb1cf2d5be2a6ae6c1f5ace26c9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 3 Aug 2004 06:52:06 +0000 Subject: r1633: fixed a couple of async oplock handling errors (This used to be commit d7e2f39b90122088e94d4a8e8c7ffa7c91d7d664) --- source4/libcli/raw/clioplock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/libcli/raw/clioplock.c') diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c index 0cd6adb41f..29e44fc940 100644 --- a/source4/libcli/raw/clioplock.c +++ b/source4/libcli/raw/clioplock.c @@ -39,8 +39,11 @@ BOOL cli_oplock_ack(struct cli_tree *tree, uint16_t fnum, uint16_t ack_level) SSVAL(req->out.vwv,VWV(6),0); SSVAL(req->out.vwv,VWV(7),0); + /* this request does not expect a reply, so tell the signing + subsystem not to allocate an id for a reply */ + req->one_way_request = 1; + ret = cli_request_send(req); - cli_request_destroy(req); return ret; } -- cgit From c5fbb6f23c2d399c7510bc552cdb1a27b1ef66a8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 4 Aug 2004 13:23:35 +0000 Subject: r1654: rename cli_ -> smbcli_ rename CLI_ -> SMBCLI_ metze (This used to be commit 8441750fd9427dd6fe477f27e603821b4026f038) --- source4/libcli/raw/clioplock.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/libcli/raw/clioplock.c') diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c index 29e44fc940..6ae21a08f4 100644 --- a/source4/libcli/raw/clioplock.c +++ b/source4/libcli/raw/clioplock.c @@ -23,12 +23,12 @@ /**************************************************************************** send an ack for an oplock break request ****************************************************************************/ -BOOL cli_oplock_ack(struct cli_tree *tree, uint16_t fnum, uint16_t ack_level) +BOOL smbcli_oplock_ack(struct smbcli_tree *tree, uint16_t fnum, uint16_t ack_level) { BOOL ret; - struct cli_request *req; + struct smbcli_request *req; - req = cli_request_setup(tree, SMBlockingX, 8, 0); + req = smbcli_request_setup(tree, SMBlockingX, 8, 0); SSVAL(req->out.vwv,VWV(0),0xFF); SSVAL(req->out.vwv,VWV(1),0); @@ -43,7 +43,7 @@ BOOL cli_oplock_ack(struct cli_tree *tree, uint16_t fnum, uint16_t ack_level) subsystem not to allocate an id for a reply */ req->one_way_request = 1; - ret = cli_request_send(req); + ret = smbcli_request_send(req); return ret; } @@ -52,8 +52,8 @@ BOOL cli_oplock_ack(struct cli_tree *tree, uint16_t fnum, uint16_t ack_level) /**************************************************************************** set the oplock handler for a connection ****************************************************************************/ -void cli_oplock_handler(struct cli_transport *transport, - BOOL (*handler)(struct cli_transport *, uint16_t, uint16_t, uint8_t, void *), +void smbcli_oplock_handler(struct smbcli_transport *transport, + BOOL (*handler)(struct smbcli_transport *, uint16_t, uint16_t, uint8_t, void *), void *private) { transport->oplock.handler = handler; -- cgit From 9f1210a243654fd6d94acdef83f468a33c1b3b3f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 1 Nov 2004 01:03:22 +0000 Subject: r3419: moved the libcli/raw structures into libcli/raw/libcliraw.h and made them private (This used to be commit 386ac565c452ede1d74e06acb401ca9db99d3ff3) --- source4/libcli/raw/clioplock.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/raw/clioplock.c') diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c index 6ae21a08f4..f26aa0c5f2 100644 --- a/source4/libcli/raw/clioplock.c +++ b/source4/libcli/raw/clioplock.c @@ -19,6 +19,7 @@ */ #include "includes.h" +#include "libcli/raw/libcliraw.h" /**************************************************************************** send an ack for an oplock break request -- cgit From 20b3b0f2e316f1689ea30e1901d97bdf86a71fa0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 30 Apr 2006 00:00:28 +0000 Subject: r15338: Fix build of most things with shared libs enabled. (This used to be commit 8985093d3fba90287bd739aaaa0fbfdadca2b999) --- source4/libcli/raw/clioplock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/libcli/raw/clioplock.c') diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c index f26aa0c5f2..f004532b26 100644 --- a/source4/libcli/raw/clioplock.c +++ b/source4/libcli/raw/clioplock.c @@ -24,7 +24,7 @@ /**************************************************************************** send an ack for an oplock break request ****************************************************************************/ -BOOL smbcli_oplock_ack(struct smbcli_tree *tree, uint16_t fnum, uint16_t ack_level) +_PUBLIC_ BOOL smbcli_oplock_ack(struct smbcli_tree *tree, uint16_t fnum, uint16_t ack_level) { BOOL ret; struct smbcli_request *req; @@ -53,7 +53,7 @@ BOOL smbcli_oplock_ack(struct smbcli_tree *tree, uint16_t fnum, uint16_t ack_lev /**************************************************************************** set the oplock handler for a connection ****************************************************************************/ -void smbcli_oplock_handler(struct smbcli_transport *transport, +_PUBLIC_ void smbcli_oplock_handler(struct smbcli_transport *transport, BOOL (*handler)(struct smbcli_transport *, uint16_t, uint16_t, uint8_t, void *), void *private) { -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/libcli/raw/clioplock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/libcli/raw/clioplock.c') diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c index f004532b26..12b586aafa 100644 --- a/source4/libcli/raw/clioplock.c +++ b/source4/libcli/raw/clioplock.c @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/libcli/raw/clioplock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/libcli/raw/clioplock.c') diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c index 12b586aafa..ae4e58ae01 100644 --- a/source4/libcli/raw/clioplock.c +++ b/source4/libcli/raw/clioplock.c @@ -23,9 +23,9 @@ /**************************************************************************** send an ack for an oplock break request ****************************************************************************/ -_PUBLIC_ BOOL smbcli_oplock_ack(struct smbcli_tree *tree, uint16_t fnum, uint16_t ack_level) +_PUBLIC_ bool smbcli_oplock_ack(struct smbcli_tree *tree, uint16_t fnum, uint16_t ack_level) { - BOOL ret; + bool ret; struct smbcli_request *req; req = smbcli_request_setup(tree, SMBlockingX, 8, 0); @@ -53,7 +53,7 @@ _PUBLIC_ BOOL smbcli_oplock_ack(struct smbcli_tree *tree, uint16_t fnum, uint16_ set the oplock handler for a connection ****************************************************************************/ _PUBLIC_ void smbcli_oplock_handler(struct smbcli_transport *transport, - BOOL (*handler)(struct smbcli_transport *, uint16_t, uint16_t, uint8_t, void *), + bool (*handler)(struct smbcli_transport *, uint16_t, uint16_t, uint8_t, void *), void *private) { transport->oplock.handler = handler; -- cgit From afe3e8172ddaa5e4aa811faceecda4f943d6e2ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 04:53:27 +0200 Subject: Install public header files again and include required prototypes. (This used to be commit 47ffbbf67435904754469544390b67d34c958343) --- source4/libcli/raw/clioplock.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/raw/clioplock.c') diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c index ae4e58ae01..47ffb6dd31 100644 --- a/source4/libcli/raw/clioplock.c +++ b/source4/libcli/raw/clioplock.c @@ -19,6 +19,7 @@ #include "includes.h" #include "libcli/raw/libcliraw.h" +#include "libcli/raw/raw_proto.h" /**************************************************************************** send an ack for an oplock break request -- cgit