summaryrefslogtreecommitdiff
path: root/source4/libcli/raw
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-31 03:26:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:05 -0500
commitb24fcfc1aadf56130f9f2f2371282c0c399611c2 (patch)
tree00280ff144492488eccaad1561f4930f9c3b411e /source4/libcli/raw
parent50c5059ab048a5a1b9b03ca78029b333197178ba (diff)
downloadsamba-b24fcfc1aadf56130f9f2f2371282c0c399611c2.tar.gz
samba-b24fcfc1aadf56130f9f2f2371282c0c399611c2.tar.bz2
samba-b24fcfc1aadf56130f9f2f2371282c0c399611c2.zip
r3400: - allow callers to control the flags2 field in raw packets
- added testing of the FLAGS2_READ_PERMIT_EXECUTE bit in the ntdeny tests (This used to be commit adf4a682705871186f3b77ea6d417942445fc5d3)
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r--source4/libcli/raw/clisession.c22
-rw-r--r--source4/libcli/raw/rawrequest.c22
2 files changed, 24 insertions, 20 deletions
diff --git a/source4/libcli/raw/clisession.c b/source4/libcli/raw/clisession.c
index 5d769f9e32..9c73c07831 100644
--- a/source4/libcli/raw/clisession.c
+++ b/source4/libcli/raw/clisession.c
@@ -33,6 +33,8 @@
struct smbcli_session *smbcli_session_init(struct smbcli_transport *transport)
{
struct smbcli_session *session;
+ uint16_t flags2;
+ uint32_t capabilities;
session = talloc_p(transport, struct smbcli_session);
if (!session) {
@@ -44,6 +46,26 @@ struct smbcli_session *smbcli_session_init(struct smbcli_transport *transport)
session->pid = (uint16_t)getpid();
session->vuid = UID_FIELD_INVALID;
+
+ capabilities = transport->negotiate.capabilities;
+
+ flags2 = FLAGS2_LONG_PATH_COMPONENTS;
+
+ if (capabilities & CAP_UNICODE) {
+ flags2 |= FLAGS2_UNICODE_STRINGS;
+ }
+ if (capabilities & CAP_STATUS32) {
+ flags2 |= FLAGS2_32_BIT_ERROR_CODES;
+ }
+ if (capabilities & CAP_EXTENDED_SECURITY) {
+ flags2 |= FLAGS2_EXTENDED_SECURITY;
+ }
+ if (session->transport->negotiate.sign_info.doing_signing) {
+ flags2 |= FLAGS2_SMB_SECURITY_SIGNATURES;
+ }
+
+ session->flags2 = flags2;
+
return session;
}
diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c
index dd21eb89ea..26604cbcd4 100644
--- a/source4/libcli/raw/rawrequest.c
+++ b/source4/libcli/raw/rawrequest.c
@@ -139,35 +139,17 @@ struct smbcli_request *smbcli_request_setup_transport(struct smbcli_transport *t
way. This interface is used before a session is setup.
*/
struct smbcli_request *smbcli_request_setup_session(struct smbcli_session *session,
- uint8_t command, uint_t wct, uint_t buflen)
+ uint8_t command, uint_t wct, uint_t buflen)
{
struct smbcli_request *req;
- uint16_t flags2;
- uint32_t capabilities;
req = smbcli_request_setup_transport(session->transport, command, wct, buflen);
if (!req) return NULL;
req->session = session;
-
- flags2 = FLAGS2_LONG_PATH_COMPONENTS;
- capabilities = session->transport->negotiate.capabilities;
-
- if (capabilities & CAP_UNICODE) {
- flags2 |= FLAGS2_UNICODE_STRINGS;
- }
- if (capabilities & CAP_STATUS32) {
- flags2 |= FLAGS2_32_BIT_ERROR_CODES;
- }
- if (capabilities & CAP_EXTENDED_SECURITY) {
- flags2 |= FLAGS2_EXTENDED_SECURITY;
- }
- if (session->transport->negotiate.sign_info.doing_signing) {
- flags2 |= FLAGS2_SMB_SECURITY_SIGNATURES;
- }
- SSVAL(req->out.hdr, HDR_FLG2, flags2);
+ SSVAL(req->out.hdr, HDR_FLG2, session->flags2);
SSVAL(req->out.hdr, HDR_PID, session->pid & 0xFFFF);
SSVAL(req->out.hdr, HDR_PIDHIGH, session->pid >> 16);
SSVAL(req->out.hdr, HDR_UID, session->vuid);