svn commit: samba r11669 - in branches/SAMBA_4_0/source/libcli/raw: .

2005-11-10 Thread metze
Author: metze
Date: 2005-11-11 07:38:25 + (Fri, 11 Nov 2005)
New Revision: 11669

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11669

Log:
- make sure req is initialized
- call async callback on error

metze
Modified:
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/clitransport.c
===
--- branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-11 07:23:45 UTC 
(rev 11668)
+++ branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-11 07:38:25 UTC 
(rev 11669)
@@ -347,7 +347,7 @@
uint8_t *buffer, *hdr, *vwv;
int len;
uint16_t wct=0, mid = 0, op = 0;
-   struct smbcli_request *req;
+   struct smbcli_request *req = NULL;
 
buffer = blob.data;
len = blob.length;
@@ -482,6 +482,9 @@
if (req) {
DLIST_REMOVE(transport->pending_recv, req);
req->state = SMBCLI_REQUEST_ERROR;
+   if (req->async.fn) {
+   req->async.fn(req);
+   }
} else {
talloc_free(buffer);
}



svn commit: samba r11668 - in branches/SAMBA_4_0/source: libcli/smb2 torture/smb2

2005-11-10 Thread tridge
Author: tridge
Date: 2005-11-11 07:23:45 + (Fri, 11 Nov 2005)
New Revision: 11668

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11668

Log:

yay! we get a successful session setup with SMB2, and get back a 64bit uid

Modified:
   branches/SAMBA_4_0/source/libcli/smb2/negprot.c
   branches/SAMBA_4_0/source/libcli/smb2/request.c
   branches/SAMBA_4_0/source/libcli/smb2/session.c
   branches/SAMBA_4_0/source/libcli/smb2/smb2.h
   branches/SAMBA_4_0/source/libcli/smb2/smb2_calls.h
   branches/SAMBA_4_0/source/libcli/smb2/transport.c
   branches/SAMBA_4_0/source/torture/smb2/connect.c


Changeset:
Sorry, the patch is too large (314 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11668


svn commit: samba r11667 - branches/SAMBA_3_0/source/nsswitch trunk/source/nsswitch

2005-11-10 Thread vlendec
Author: vlendec
Date: 2005-11-11 07:03:17 + (Fri, 11 Nov 2005)
New Revision: 11667

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11667

Log:
Fix a debug message
Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
   trunk/source/nsswitch/winbindd_pam.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c   2005-11-11 06:26:42 UTC 
(rev 11666)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c   2005-11-11 07:03:17 UTC 
(rev 11667)
@@ -530,8 +530,9 @@
 
  done:
set_auth_errors(&state->response, result);
-   DEBUG(5, ("CRAP authentication for %s returned %s (PAM: %d)\n",
- state->request.data.auth.user, 
+   DEBUG(5, ("CRAP authentication for %s\\%s returned %s (PAM: %d)\n",
+ state->request.data.auth_crap.domain,
+ state->request.data.auth_crap.user, 
  state->response.data.auth.nt_status_string,
  state->response.data.auth.pam_error));
request_error(state);

Modified: trunk/source/nsswitch/winbindd_pam.c
===
--- trunk/source/nsswitch/winbindd_pam.c2005-11-11 06:26:42 UTC (rev 
11666)
+++ trunk/source/nsswitch/winbindd_pam.c2005-11-11 07:03:17 UTC (rev 
11667)
@@ -530,8 +530,9 @@
 
  done:
set_auth_errors(&state->response, result);
-   DEBUG(5, ("CRAP authentication for %s returned %s (PAM: %d)\n",
- state->request.data.auth.user, 
+   DEBUG(5, ("CRAP authentication for %s\\%s returned %s (PAM: %d)\n",
+ state->request.data.auth_crap.domain,
+ state->request.data.auth_crap.user, 
  state->response.data.auth.nt_status_string,
  state->response.data.auth.pam_error));
request_error(state);



svn commit: samba r11666 - in branches/SAMBA_4_0/source: include libcli/smb2 torture/smb2

2005-11-10 Thread tridge
Author: tridge
Date: 2005-11-11 06:26:42 + (Fri, 11 Nov 2005)
New Revision: 11666

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11666

Log:

filled in the basic session setup. Vista happily accepts the first
stage of the session setup, and waits for more.

Modified:
   branches/SAMBA_4_0/source/include/structs.h
   branches/SAMBA_4_0/source/libcli/smb2/session.c
   branches/SAMBA_4_0/source/libcli/smb2/smb2.h
   branches/SAMBA_4_0/source/torture/smb2/connect.c


Changeset:
Modified: branches/SAMBA_4_0/source/include/structs.h
===
--- branches/SAMBA_4_0/source/include/structs.h 2005-11-11 05:53:54 UTC (rev 
11665)
+++ branches/SAMBA_4_0/source/include/structs.h 2005-11-11 06:26:42 UTC (rev 
11666)
@@ -337,3 +337,4 @@
 struct smb2_request;
 struct smb2_transport;
 struct smb2_negprot;
+struct smb2_session_setup;

Modified: branches/SAMBA_4_0/source/libcli/smb2/session.c
===
--- branches/SAMBA_4_0/source/libcli/smb2/session.c 2005-11-11 05:53:54 UTC 
(rev 11665)
+++ branches/SAMBA_4_0/source/libcli/smb2/session.c 2005-11-11 06:26:42 UTC 
(rev 11666)
@@ -23,6 +23,7 @@
 #include "includes.h"
 #include "libcli/raw/libcliraw.h"
 #include "libcli/smb2/smb2.h"
+#include "libcli/smb2/smb2_calls.h"
 
 /*
   initialise a smb2_session structure
@@ -31,6 +32,7 @@
   TALLOC_CTX *parent_ctx, BOOL primary)
 {
struct smb2_session *session;
+   NTSTATUS status;
 
session = talloc_zero(parent_ctx, struct smb2_session);
if (!session) {
@@ -42,6 +44,74 @@
session->transport = talloc_reference(session, transport);
}
 
+   /* prepare a gensec context for later use */
+   status = gensec_client_start(session, &session->gensec, 
+session->transport->socket->event.ctx);
+   if (!NT_STATUS_IS_OK(status)) {
+   talloc_free(session);
+   return NULL;
+   }
+
return session;
 }
 
+/*
+  send a session setup request
+*/
+struct smb2_request *smb2_session_setup_send(struct smb2_session *session, 
+struct smb2_session_setup *io)
+{
+   struct smb2_request *req;
+   
+   req = smb2_request_init(session->transport, SMB2_OP_SESSSETUP, 
+   0x10 + io->in.secblob.length);
+   if (req == NULL) return NULL;
+
+   SIVAL(req->out.body, 0x00, io->in.unknown1);
+   SIVAL(req->out.body, 0x04, io->in.unknown2);
+   SIVAL(req->out.body, 0x08, io->in.unknown3);
+   SSVAL(req->out.body, 0x0C, io->in.unknown4);
+   SSVAL(req->out.body, 0x0E, io->in.secblob.length);
+   memcpy(req->out.body+0x10, io->in.secblob.data, io->in.secblob.length);
+
+   smb2_transport_send(req);
+
+   return req;
+}
+
+
+/*
+  recv a session setup reply
+*/
+NTSTATUS smb2_session_setup_recv(struct smb2_request *req, TALLOC_CTX 
*mem_ctx, 
+struct smb2_session_setup *io)
+{
+   uint16_t blobsize;
+
+   if (!smb2_request_receive(req) || 
+   smb2_request_is_error(req)) {
+   return smb2_request_destroy(req);
+   }
+
+   if (req->in.body_size < 0x08) {
+   return NT_STATUS_BUFFER_TOO_SMALL;
+   }
+
+   io->out.unknown1 = IVAL(req->in.body, 0x00);
+   io->out.unknown2 = SVAL(req->in.body, 0x04);
+   blobsize = SVAL(req->in.body, 0x06);
+   io->out.secblob  = smb2_pull_blob(req, req->in.body+0x08, blobsize);
+   talloc_steal(mem_ctx, io->out.secblob.data);
+
+   return smb2_request_destroy(req);
+}
+
+/*
+  sync session setup request
+*/
+NTSTATUS smb2_session_setup(struct smb2_session *session, 
+   TALLOC_CTX *mem_ctx, struct smb2_session_setup *io)
+{
+   struct smb2_request *req = smb2_session_setup_send(session, io);
+   return smb2_session_setup_recv(req, mem_ctx, io);
+}

Modified: branches/SAMBA_4_0/source/libcli/smb2/smb2.h
===
--- branches/SAMBA_4_0/source/libcli/smb2/smb2.h2005-11-11 05:53:54 UTC 
(rev 11665)
+++ branches/SAMBA_4_0/source/libcli/smb2/smb2.h2005-11-11 06:26:42 UTC 
(rev 11666)
@@ -56,6 +56,7 @@
 */
 struct smb2_session {
struct smb2_transport *transport;
+   struct gensec_security *gensec;
 };
 
 struct smb2_request_buffer {

Modified: branches/SAMBA_4_0/source/torture/smb2/connect.c
===
--- branches/SAMBA_4_0/source/torture/smb2/connect.c2005-11-11 05:53:54 UTC 
(rev 11665)
+++ branches/SAMBA_4_0/source/torture/smb2/connect.c2005-11-11 06:26:42 UTC 
(rev 11666)
@@ -27,6 +27,7 @@
 #include "librpc/gen_ndr/ndr_security.h"
 #include "lib/cmdline/popt_common.h"
 #include "lib/events/ev

svn commit: samba r11665 - in branches/SAMBA_4_0/source: include libcli/smb2 torture/smb2

2005-11-10 Thread tridge
Author: tridge
Date: 2005-11-11 05:53:54 + (Fri, 11 Nov 2005)
New Revision: 11665

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11665

Log:

started to put some meat on the structure used for the SMB2 library

the call definitions will be in smb2_calls.h, which will play a
similar role that smb_interfaces.h plays for the old SMB protocol


Added:
   branches/SAMBA_4_0/source/libcli/smb2/session.c
   branches/SAMBA_4_0/source/libcli/smb2/smb2_calls.h
Modified:
   branches/SAMBA_4_0/source/include/structs.h
   branches/SAMBA_4_0/source/libcli/smb2/config.mk
   branches/SAMBA_4_0/source/libcli/smb2/negprot.c
   branches/SAMBA_4_0/source/libcli/smb2/request.c
   branches/SAMBA_4_0/source/libcli/smb2/smb2.h
   branches/SAMBA_4_0/source/libcli/smb2/transport.c
   branches/SAMBA_4_0/source/torture/smb2/connect.c


Changeset:
Sorry, the patch is too large (422 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11665


svn commit: samba r11664 - in branches/SAMBA_4_0/source/include: .

2005-11-10 Thread tridge
Author: tridge
Date: 2005-11-11 05:41:38 + (Fri, 11 Nov 2005)
New Revision: 11664

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11664

Log:

forgot to commit the structs.h change

Modified:
   branches/SAMBA_4_0/source/include/structs.h


Changeset:
Modified: branches/SAMBA_4_0/source/include/structs.h
===
--- branches/SAMBA_4_0/source/include/structs.h 2005-11-11 04:46:48 UTC (rev 
11663)
+++ branches/SAMBA_4_0/source/include/structs.h 2005-11-11 05:41:38 UTC (rev 
11664)
@@ -333,3 +333,6 @@
 struct smbcli_socket;
 
 struct _krb5_krb_auth_data;
+
+struct smb2_request;
+struct smb2_transport;



svn commit: samba r11663 - in branches/SAMBA_4_0/source/torture: . smb2

2005-11-10 Thread tridge
Author: tridge
Date: 2005-11-11 04:46:48 + (Fri, 11 Nov 2005)
New Revision: 11663

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11663

Log:

start of a SMB2 torture test. Just does a negprot and prints some fields for 
now.

test name is SMB2-CONNECT

Added:
   branches/SAMBA_4_0/source/torture/smb2/
   branches/SAMBA_4_0/source/torture/smb2/config.mk
   branches/SAMBA_4_0/source/torture/smb2/connect.c
Modified:
   branches/SAMBA_4_0/source/torture/config.mk
   branches/SAMBA_4_0/source/torture/torture.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/config.mk
===
--- branches/SAMBA_4_0/source/torture/config.mk 2005-11-11 04:45:38 UTC (rev 
11662)
+++ branches/SAMBA_4_0/source/torture/config.mk 2005-11-11 04:46:48 UTC (rev 
11663)
@@ -26,7 +26,7 @@
 #
 
 #
-# Start SUBSYSTEM TORTURE_BASIC
+# Start SUBSYSTEM TORTURE_RAW
 [SUBSYSTEM::TORTURE_RAW]
 ADD_OBJ_FILES = \
raw/qfsinfo.o \
@@ -57,6 +57,8 @@
 # End SUBSYSTEM TORTURE_RAW
 #
 
+include smb2/config.mk
+
 #
 # Start SUBSYSTEM TORTURE_COM
 [SUBSYSTEM::TORTURE_COM]
@@ -224,6 +226,7 @@
 REQUIRED_SUBSYSTEMS = \
TORTURE_BASIC \
TORTURE_RAW \
+   TORTURE_SMB2 \
TORTURE_RPC \
TORTURE_RAP \
TORTURE_AUTH \

Added: branches/SAMBA_4_0/source/torture/smb2/config.mk
===
--- branches/SAMBA_4_0/source/torture/smb2/config.mk2005-11-11 04:45:38 UTC 
(rev 11662)
+++ branches/SAMBA_4_0/source/torture/smb2/config.mk2005-11-11 04:46:48 UTC 
(rev 11663)
@@ -0,0 +1,10 @@
+
+#
+# Start SUBSYSTEM TORTURE_SMB2
+[SUBSYSTEM::TORTURE_SMB2]
+ADD_OBJ_FILES = \
+   connect.o
+REQUIRED_SUBSYSTEMS = \
+   LIBCLI_SMB2
+# End SUBSYSTEM TORTURE_SMB2
+#

Added: branches/SAMBA_4_0/source/torture/smb2/connect.c
===
--- branches/SAMBA_4_0/source/torture/smb2/connect.c2005-11-11 04:45:38 UTC 
(rev 11662)
+++ branches/SAMBA_4_0/source/torture/smb2/connect.c2005-11-11 04:46:48 UTC 
(rev 11663)
@@ -0,0 +1,74 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   test suite for SMB2 connection operations
+
+   Copyright (C) Andrew Tridgell 2005
+   
+   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"
+#include "libcli/raw/libcliraw.h"
+#include "libcli/smb2/smb2.h"
+#include "librpc/gen_ndr/ndr_security.h"
+#include "lib/cmdline/popt_common.h"
+#include "lib/events/events.h"
+
+#define BASEDIR "\\testsmb2"
+
+#define CHECK_STATUS(status, correct) do { \
+   if (!NT_STATUS_EQUAL(status, correct)) { \
+   printf("(%s) Incorrect status %s - should be %s\n", \
+  __location__, nt_errstr(status), nt_errstr(correct)); \
+   ret = False; \
+   goto done; \
+   }} while (0)
+
+/* 
+   basic testing of SMB2 connection calls
+*/
+BOOL torture_smb2_connect(void)
+{
+   TALLOC_CTX *mem_ctx = talloc_new(NULL);
+   struct smbcli_socket *socket;
+   struct smb2_transport *transport;
+   const char *host = lp_parm_string(-1, "torture", "host");
+   BOOL ret = True;
+   NTSTATUS status;
+
+   socket = smbcli_sock_connect_byname(host, 445, mem_ctx, NULL);
+   if (socket == NULL) {
+   printf("Failed to connect to %s\n", host);
+   return False;
+   }
+
+   transport = smb2_transport_init(socket, mem_ctx);
+   if (socket == NULL) {
+   printf("Failed to setup smb2 transport\n");
+   return False;
+   }
+
+   /* send a negprot */
+   status = smb2_negprot(transport);
+   if (!NT_STATUS_IS_OK(status)) {
+   printf("negprot failed - %s\n", nt_errstr(status));
+   return False;
+   }
+
+   talloc_free(mem_ctx);
+
+   return ret;
+}

Modified: branches/SAMBA_4_0/source/torture/torture.c
===
--- branches/SAMBA_4_0/source/t

svn commit: samba r11662 - in branches/SAMBA_4_0/source/libcli: . smb2

2005-11-10 Thread tridge
Author: tridge
Date: 2005-11-11 04:45:38 + (Fri, 11 Nov 2005)
New Revision: 11662

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11662

Log:

the beginnings of a SMB2 client library. Very hackish, meant for experimentation


Added:
   branches/SAMBA_4_0/source/libcli/smb2/
   branches/SAMBA_4_0/source/libcli/smb2/config.mk
   branches/SAMBA_4_0/source/libcli/smb2/negprot.c
   branches/SAMBA_4_0/source/libcli/smb2/request.c
   branches/SAMBA_4_0/source/libcli/smb2/smb2.h
   branches/SAMBA_4_0/source/libcli/smb2/transport.c
Modified:
   branches/SAMBA_4_0/source/libcli/config.mk


Changeset:
Sorry, the patch is too large (727 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11662


svn commit: samba r11661 - branches/SAMBA_3_0/source/auth branches/SAMBA_3_0/source/libsmb branches/SAMBA_3_0/source/nsswitch branches/SAMBA_3_0/source/smbd trunk/source/auth trunk/source/libsmb trunk

2005-11-10 Thread jerry
Author: jerry
Date: 2005-11-11 03:03:41 + (Fri, 11 Nov 2005)
New Revision: 11661

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11661

Log:
Store the INFO3 in the PAC data into the netsamlogon_cache.
Also remove the mem_ctx from the netsamlogon_cache_store() API.

Guenther, what should we be doing with the other fields in 
the PAC_LOGON_INFO?



Modified:
   branches/SAMBA_3_0/source/auth/auth_domain.c
   branches/SAMBA_3_0/source/libsmb/samlogon_cache.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
   branches/SAMBA_3_0/source/smbd/sesssetup.c
   trunk/source/auth/auth_domain.c
   trunk/source/libsmb/samlogon_cache.c
   trunk/source/nsswitch/winbindd_pam.c
   trunk/source/smbd/sesssetup.c


Changeset:
Modified: branches/SAMBA_3_0/source/auth/auth_domain.c
===
--- branches/SAMBA_3_0/source/auth/auth_domain.c2005-11-11 01:38:39 UTC 
(rev 11660)
+++ branches/SAMBA_3_0/source/auth/auth_domain.c2005-11-11 03:03:41 UTC 
(rev 11661)
@@ -253,7 +253,7 @@
server_info,
&info3);
 
-   netsamlogon_cache_store( mem_ctx, user_info->smb_name.str, 
&info3 );
+   netsamlogon_cache_store( user_info->smb_name.str, &info3 );
}
 
/* Note - once the cli stream is shutdown the mem_ctx used

Modified: branches/SAMBA_3_0/source/libsmb/samlogon_cache.c
===
--- branches/SAMBA_3_0/source/libsmb/samlogon_cache.c   2005-11-11 01:38:39 UTC 
(rev 11660)
+++ branches/SAMBA_3_0/source/libsmb/samlogon_cache.c   2005-11-11 03:03:41 UTC 
(rev 11661)
@@ -109,7 +109,7 @@
  username should be in UTF-8 format
 ***/
 
-BOOL netsamlogon_cache_store(TALLOC_CTX *mem_ctx, const char * username, 
NET_USER_INFO_3 *user)
+BOOL netsamlogon_cache_store( const char *username, NET_USER_INFO_3 *user )
 {
TDB_DATAdata;
 fstringkeystr;
@@ -117,6 +117,7 @@
BOOLresult = False;
DOM_SID user_sid;
time_t  t = time(NULL);
+   TALLOC_CTX  *mem_ctx;

 
if (!netsamlogon_cache_init()) {
@@ -142,6 +143,11 @@

/* Prepare data */

+   if ( !(mem_ctx = TALLOC_P( NULL, int )) ) {
+   DEBUG(0,("netsamlogon_cache_store: talloc() failed!\n"));
+   return False;
+   }
+
prs_init( &ps, RPC_MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);

if ( !prs_uint32( "timestamp", &ps, 0, (uint32*)&t ) )
@@ -157,6 +163,8 @@

prs_mem_free( &ps );
}
+
+   TALLOC_FREE( mem_ctx );

return result;
 }
@@ -175,7 +183,7 @@
uint32  t;

if (!netsamlogon_cache_init()) {
-   DEBUG(0,("netsamlogon_cache_store: cannot open %s for 
write!\n", NETSAMLOGON_TDB));
+   DEBUG(0,("netsamlogon_cache_get: cannot open %s for write!\n", 
NETSAMLOGON_TDB));
return False;
}
 

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c   2005-11-11 01:38:39 UTC 
(rev 11660)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c   2005-11-11 03:03:41 UTC 
(rev 11661)
@@ -382,7 +382,7 @@
} while ( (attempts < 2) && retry );
 
if (NT_STATUS_IS_OK(result)) {
-   netsamlogon_cache_store(state->mem_ctx, name_user, &info3);
+   netsamlogon_cache_store(name_user, &info3);
wcache_invalidate_samlogon(find_domain_from_name(name_domain), 
&info3);
 
/* Check if the user is in the right group */
@@ -667,7 +667,7 @@
} while ( (attempts < 2) && retry );
 
if (NT_STATUS_IS_OK(result)) {
-   netsamlogon_cache_store(state->mem_ctx, name_user, &info3);
+   netsamlogon_cache_store(name_user, &info3);
wcache_invalidate_samlogon(find_domain_from_name(name_domain), 
&info3);
 
/* Check if the user is in the right group */

Modified: branches/SAMBA_3_0/source/smbd/sesssetup.c
===
--- branches/SAMBA_3_0/source/smbd/sesssetup.c  2005-11-11 01:38:39 UTC (rev 
11660)
+++ branches/SAMBA_3_0/source/smbd/sesssetup.c  2005-11-11 03:03:41 UTC (rev 
11661)
@@ -180,10 +180,6 @@
return ERROR_NT(NT_STATUS_LOGON_FAILURE);
}
 
-   if (pac_data) {
-   logon_info = get_logon_info_from_pac(pac_data);
-   }
-
DEBUG(3,("Ticket name is [%s]\n", client));
 
p = strchr_m(client, '@');
@@ -196,6 +192,14 @@
}
 
*p = 0;
+
+   /* save the PAC data if we have 

svn commit: samba r11660 - in branches/SAMBA_4_0/source: libcli/raw torture

2005-11-10 Thread tridge
Author: tridge
Date: 2005-11-11 01:38:39 + (Fri, 11 Nov 2005)
New Revision: 11660

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11660

Log:

- the libcli/raw/ lib no longer uses the SMBCLI_REQUEST_SEND state, or
  the associated send queue

- fixed negnowait to not watch for the SMBCLI_REQUEST_SEND state

Modified:
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c
   branches/SAMBA_4_0/source/libcli/raw/libcliraw.h
   branches/SAMBA_4_0/source/torture/torture.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/clitransport.c
===
--- branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-11 00:50:40 UTC 
(rev 11659)
+++ branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-11 01:38:39 UTC 
(rev 11660)
@@ -520,9 +520,6 @@
 {
struct smbcli_request *req = talloc_get_type(private, struct 
smbcli_request);
 
-   if (req->state == SMBCLI_REQUEST_SEND) {
-   DLIST_REMOVE(req->transport->pending_send, req);
-   }
if (req->state == SMBCLI_REQUEST_RECV) {
DLIST_REMOVE(req->transport->pending_recv, req);
}
@@ -540,9 +537,6 @@
 static int smbcli_request_destructor(void *ptr)
 {
struct smbcli_request *req = talloc_get_type(ptr, struct 
smbcli_request);
-   if (req->state == SMBCLI_REQUEST_SEND) {
-   DLIST_REMOVE(req->transport->pending_send, req);
-   }
if (req->state == SMBCLI_REQUEST_RECV) {
DLIST_REMOVE(req->transport->pending_recv, req);
}

Modified: branches/SAMBA_4_0/source/libcli/raw/libcliraw.h
===
--- branches/SAMBA_4_0/source/libcli/raw/libcliraw.h2005-11-11 00:50:40 UTC 
(rev 11659)
+++ branches/SAMBA_4_0/source/libcli/raw/libcliraw.h2005-11-11 01:38:39 UTC 
(rev 11660)
@@ -144,9 +144,6 @@
void *private;
} oplock;
 
-   /* a list of async requests that are pending for send on this 
connection */
-   struct smbcli_request *pending_send;
-
/* a list of async requests that are pending for receive on this 
connection */
struct smbcli_request *pending_recv;
 
@@ -199,7 +196,6 @@
   a client request moves between the following 4 states.
 */
 enum smbcli_request_state {SMBCLI_REQUEST_INIT, /* we are creating the request 
*/
-   SMBCLI_REQUEST_SEND, /* the request is in the outgoing 
socket Q */
SMBCLI_REQUEST_RECV, /* we are waiting for a matching 
reply */
SMBCLI_REQUEST_DONE, /* the request is finished */
SMBCLI_REQUEST_ERROR}; /* a packet or transport level 
error has occurred */

Modified: branches/SAMBA_4_0/source/torture/torture.c
===
--- branches/SAMBA_4_0/source/torture/torture.c 2005-11-11 00:50:40 UTC (rev 
11659)
+++ branches/SAMBA_4_0/source/torture/torture.c 2005-11-11 01:38:39 UTC (rev 
11660)
@@ -900,33 +900,18 @@
 
printf("Filling send buffer\n");
 
-   for (i=0;i<1;i++) {
+   for (i=0;i<1000;i++) {
struct smbcli_request *req;
time_t t1 = time(NULL);
req = smb_raw_negotiate_send(cli->transport, PROTOCOL_NT1);
-   while (req->state == SMBCLI_REQUEST_SEND && time(NULL) < t1+5) {
-   smbcli_transport_process(cli->transport);
-   }
+   smbcli_transport_process(cli->transport);
if (req->state == SMBCLI_REQUEST_ERROR) {
printf("Failed to fill pipe - %s\n", 
nt_errstr(req->status));
torture_close_connection(cli);
return correct;
}
-   if (req->state == SMBCLI_REQUEST_SEND) {
-   break;
-   }
}
 
-   if (i == 1) {
-   printf("send buffer failed to fill\n");
-   if (!torture_close_connection(cli)) {
-   correct = False;
-   }
-   return correct;
-   }
-
-   printf("send buffer filled after %d requests\n", i);
-
printf("Opening secondary connection\n");
if (!torture_open_connection(&cli2)) {
return False;



svn commit: samba r11659 - in branches/SAMBA_4_0/source/script/tests: .

2005-11-10 Thread tridge
Author: tridge
Date: 2005-11-11 00:50:40 + (Fri, 11 Nov 2005)
New Revision: 11659

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11659

Log:

allow the max runtime for smbtorture and smbd to be controlled on a
per-host basis in the build farm



Modified:
   branches/SAMBA_4_0/source/script/tests/selftest.sh
   branches/SAMBA_4_0/source/script/tests/test_functions.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/selftest.sh
===
--- branches/SAMBA_4_0/source/script/tests/selftest.sh  2005-11-11 00:16:43 UTC 
(rev 11658)
+++ branches/SAMBA_4_0/source/script/tests/selftest.sh  2005-11-11 00:50:40 UTC 
(rev 11659)
@@ -21,7 +21,11 @@
exit
 fi
 
+if [ -z "$TORTURE_MAXTIME" ]; then
+TORTURE_MAXTIME=300
+fi
 
+
 PREFIX=$1
 PREFIX=`echo $PREFIX | sed s+//+/+`
 export PREFIX
@@ -168,7 +172,7 @@
 SOCKET_WRAPPER_DEFAULT_IFACE=26
 export SOCKET_WRAPPER_DEFAULT_IFACE
 
TORTURE_INTERFACES='127.0.0.26/8,127.0.0.27/8,127.0.0.28/8,127.0.0.29/8,127.0.0.30/8,127.0.0.31/8'
-TORTURE_OPTIONS="--maximum-runtime=300 --option=interfaces=$TORTURE_INTERFACES 
$CONFIGURATION"
+TORTURE_OPTIONS="--maximum-runtime=$TORTURE_MAXTIME 
--option=interfaces=$TORTURE_INTERFACES $CONFIGURATION"
 export TORTURE_OPTIONS
 
 START=`date`

Modified: branches/SAMBA_4_0/source/script/tests/test_functions.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_functions.sh2005-11-11 
00:16:43 UTC (rev 11658)
+++ branches/SAMBA_4_0/source/script/tests/test_functions.sh2005-11-11 
00:50:40 UTC (rev 11659)
@@ -19,11 +19,10 @@
 
echo -n "STARTING SMBD..."
((
-   runtime=2700
-   if [ -n "$SMBD_VALGRIND" ]; then
-   runtime=7200
+   if [ -z "$SMBD_MAXTIME" ]; then
+   SMBD_MAXTIME=2700
fi
-   $SMBD_VALGRIND $SRCDIR/bin/smbd 
--maximum-runtime=$runtime -d1 -s $CONFFILE -M single -i < $SMBD_TEST_FIFO > 
$SMBD_TEST_LOG 2>&1;
+   $SMBD_VALGRIND $SRCDIR/bin/smbd 
--maximum-runtime=$SMBD_MAXTIME -d1 -s $CONFFILE -M single -i < $SMBD_TEST_FIFO 
> $SMBD_TEST_LOG 2>&1;
ret=$?;
rm -f $SMBD_TEST_FIFO;
if [ -n "$SOCKET_WRAPPER_DIR" -a -d 
"$SOCKET_WRAPPER_DIR" ]; then



Re: svn commit: samba r11658 - in branches/SAMBA_3_0/source: .

2005-11-10 Thread Jeremy Allison
On Fri, Nov 11, 2005 at 12:16:44AM +, [EMAIL PROTECTED] wrote:
> Author: jra
> Date: 2005-11-11 00:16:43 + (Fri, 11 Nov 2005)
> New Revision: 11658
> 
> WebSVN: 
> http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11658
> 
> Log:
> Someone broke the initialization of the static modules by adding a 'NTSTATUS'
> declaration before their call.
> The compiler sees : { NTSTATUS fn_foo(); NT_STATUS fn_bar(); } 
> as *definitions: They need to be : { fn_foo(); fn_bar(); }
> Jeremy.

Strangely enough this was only broken in SAMBA_3_0, not HEAD.
Odd.

Jeremy.


svn commit: samba r11658 - in branches/SAMBA_3_0/source: .

2005-11-10 Thread jra
Author: jra
Date: 2005-11-11 00:16:43 + (Fri, 11 Nov 2005)
New Revision: 11658

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11658

Log:
Someone broke the initialization of the static modules by adding a 'NTSTATUS'
declaration before their call.
The compiler sees : { NTSTATUS fn_foo(); NT_STATUS fn_bar(); } 
as *definitions: They need to be : { fn_foo(); fn_bar(); }
Jeremy.

Modified:
   branches/SAMBA_3_0/source/aclocal.m4


Changeset:
Modified: branches/SAMBA_3_0/source/aclocal.m4
===
--- branches/SAMBA_3_0/source/aclocal.m42005-11-10 21:34:25 UTC (rev 
11657)
+++ branches/SAMBA_3_0/source/aclocal.m42005-11-11 00:16:43 UTC (rev 
11658)
@@ -56,7 +56,7 @@
[$6]
string_shared_modules="$string_shared_modules $1"
elif test x"$DEST" = xSTATIC; then
-   [init_static_modules_]translit([$4], [A-Z], 
[a-z])="$[init_static_modules_]translit([$4], [A-Z], [a-z]) NTSTATUS $1_init();"
+   [init_static_modules_]translit([$4], [A-Z], 
[a-z])="$[init_static_modules_]translit([$4], [A-Z], [a-z])  $1_init();"
string_static_modules="$string_static_modules $1"
$4_STATIC="$$4_STATIC $2"
AC_SUBST($4_STATIC)



Build status as of Fri Nov 11 00:00:02 2005

2005-11-10 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2005-11-10 
00:00:08.0 +
+++ /home/build/master/cache/broken_results.txt 2005-11-11 00:00:08.0 
+
@@ -1,17 +1,17 @@
-Build status as of Thu Nov 10 00:00:02 2005
+Build status as of Fri Nov 11 00:00:02 2005
 
 Build counts:
 Tree Total  Broken Panic 
 ccache   11 2  0 
 distcc   11 1  0 
-lorikeet-heimdal 34 32 0 
+lorikeet-heimdal 19 18 0 
 ppp  18 0  0 
 rsync36 2  0 
-samba3  0  0 
+samba4  0  0 
 samba-docs   0  0  0 
-samba4   37 23 8 
-samba_3_035 6  0 
+samba4   36 19 0 
+samba_3_035 5  0 
 smb-build27 3  0 
-talloc   11 4  0 
-tdb  34 2  0 
+talloc   13 5  0 
+tdb  35 2  0 
 


svn commit: samba r11657 - in branches/SAMBA_3_0/source/smbd: .

2005-11-10 Thread paulg
Author: paulg
Date: 2005-11-10 21:34:25 + (Thu, 10 Nov 2005)
New Revision: 11657

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11657

Log:
Tiny improvement to debug error message in dir_check_ftype.


Modified:
   branches/SAMBA_3_0/source/smbd/dir.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/dir.c
===
--- branches/SAMBA_3_0/source/smbd/dir.c2005-11-10 21:33:17 UTC (rev 
11656)
+++ branches/SAMBA_3_0/source/smbd/dir.c2005-11-10 21:34:25 UTC (rev 
11657)
@@ -802,7 +802,7 @@
*mode = dos_mode(conn,pathreal,&sbuf);
 
if (!dir_check_ftype(conn,*mode,dirtype)) {
-   DEBUG(5,("[%s] attribs didn't match 
%x\n",filename,(unsigned int)dirtype));
+   DEBUG(5,("[%s] attribs 0x%x didn't match 
0x%x\n",filename,(unsigned int)*mode,(unsigned int)dirtype));
continue;
}
 



svn commit: samba r11656 - in trunk/source/smbd: .

2005-11-10 Thread paulg
Author: paulg
Date: 2005-11-10 21:33:17 + (Thu, 10 Nov 2005)
New Revision: 11656

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11656

Log:
Tiny improvement to debug error message in dir_check_ftype.


Modified:
   trunk/source/smbd/dir.c


Changeset:
Modified: trunk/source/smbd/dir.c
===
--- trunk/source/smbd/dir.c 2005-11-10 21:10:24 UTC (rev 11655)
+++ trunk/source/smbd/dir.c 2005-11-10 21:33:17 UTC (rev 11656)
@@ -802,7 +802,7 @@
*mode = dos_mode(conn,pathreal,&sbuf);
 
if (!dir_check_ftype(conn,*mode,dirtype)) {
-   DEBUG(5,("[%s] attribs didn't match 
%x\n",filename,(unsigned int)dirtype));
+   DEBUG(5,("[%s] attribs 0x%x didn't match 
0x%x\n",filename,(unsigned int)*mode,(unsigned int)dirtype));
continue;
}
 



svn commit: samba r11655 - branches/SAMBA_3_0/source/lib branches/SAMBA_3_0/source/smbd trunk/source/lib trunk/source/smbd

2005-11-10 Thread jerry
Author: jerry
Date: 2005-11-10 21:10:24 + (Thu, 10 Nov 2005)
New Revision: 11655

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11655

Log:
Two small fixes

* remove redundant call to sub_set_smb_name() in session setup code.
* Fix lockup when running 'wbinfo -t' on a Samba PDC.  Cause
  was new authenticated session setup from winbindd which 
  resulted in a mangled username (machine_) that was not found
  in the local files and so was queiued up to nss_winbindd.
  Deadlock
  So now make sure to keep the trailing '$' for machine account 
  names when calling sub_set_smb_name().


Modified:
   branches/SAMBA_3_0/source/lib/substitute.c
   branches/SAMBA_3_0/source/smbd/sesssetup.c
   trunk/source/lib/substitute.c
   trunk/source/smbd/sesssetup.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/substitute.c
===
--- branches/SAMBA_3_0/source/lib/substitute.c  2005-11-10 20:33:32 UTC (rev 
11654)
+++ branches/SAMBA_3_0/source/lib/substitute.c  2005-11-10 21:10:24 UTC (rev 
11655)
@@ -107,15 +107,37 @@
 void sub_set_smb_name(const char *name)
 {
fstring tmp;
+   int len;
+   BOOL is_machine_account = False;
 
/* don't let anonymous logins override the name */
if (! *name)
return;
 
-   fstrcpy(tmp,name);
-   trim_char(tmp,' ',' ');
-   strlower_m(tmp);
-   
alpha_strcpy(smb_user_name,tmp,SAFE_NETBIOS_CHARS,sizeof(smb_user_name)-1);
+
+   fstrcpy( tmp, name );
+   trim_char( tmp, ' ', ' ' );
+   strlower_m( tmp );
+
+   len = strlen( tmp );
+
+   if ( len == 0 )
+   return;
+
+   /* long story but here goeswe have to allow usernames
+  ending in '$' as they are valid machine account names.
+  So check for a machine account and re-add the '$'
+  at the end after the call to alpha_strcpy().   --jerry  */
+  
+   if ( tmp[len-1] == '$' )
+   is_machine_account = True;
+   
+   alpha_strcpy( smb_user_name, tmp, SAFE_NETBIOS_CHARS, 
sizeof(smb_user_name)-1 );
+
+   if ( is_machine_account ) {
+   len = strlen( smb_user_name );
+   smb_user_name[len-1] = '$';
+   }
 }
 
 char* sub_get_smb_name( void )

Modified: branches/SAMBA_3_0/source/smbd/sesssetup.c
===
--- branches/SAMBA_3_0/source/smbd/sesssetup.c  2005-11-10 20:33:32 UTC (rev 
11654)
+++ branches/SAMBA_3_0/source/smbd/sesssetup.c  2005-11-10 21:10:24 UTC (rev 
11655)
@@ -954,9 +954,6 @@
return ERROR_NT(NT_STATUS_LOGON_FAILURE);
}
fstrcpy(sub_user, user);
-
-   /* setup the string used by %U */
-   sub_set_smb_name(user);
} else {
fstrcpy(sub_user, lp_guestaccount());
}

Modified: trunk/source/lib/substitute.c
===
--- trunk/source/lib/substitute.c   2005-11-10 20:33:32 UTC (rev 11654)
+++ trunk/source/lib/substitute.c   2005-11-10 21:10:24 UTC (rev 11655)
@@ -107,15 +107,37 @@
 void sub_set_smb_name(const char *name)
 {
fstring tmp;
+   int len;
+   BOOL is_machine_account = False;
 
/* don't let anonymous logins override the name */
if (! *name)
return;
 
-   fstrcpy(tmp,name);
-   trim_char(tmp,' ',' ');
-   strlower_m(tmp);
-   
alpha_strcpy(smb_user_name,tmp,SAFE_NETBIOS_CHARS,sizeof(smb_user_name)-1);
+
+   fstrcpy( tmp, name );
+   trim_char( tmp, ' ', ' ' );
+   strlower_m( tmp );
+
+   len = strlen( tmp );
+
+   if ( len == 0 )
+   return;
+
+   /* long story but here goeswe have to allow usernames
+  ending in '$' as they are valid machine account names.
+  So check for a machine account and re-add the '$'
+  at the end after the call to alpha_strcpy().   --jerry  */
+  
+   if ( tmp[len-1] == '$' )
+   is_machine_account = True;
+   
+   alpha_strcpy( smb_user_name, tmp, SAFE_NETBIOS_CHARS, 
sizeof(smb_user_name)-1 );
+
+   if ( is_machine_account ) {
+   len = strlen( smb_user_name );
+   smb_user_name[len-1] = '$';
+   }
 }
 
 char* sub_get_smb_name( void )

Modified: trunk/source/smbd/sesssetup.c
===
--- trunk/source/smbd/sesssetup.c   2005-11-10 20:33:32 UTC (rev 11654)
+++ trunk/source/smbd/sesssetup.c   2005-11-10 21:10:24 UTC (rev 11655)
@@ -954,9 +954,6 @@
return ERROR_NT(NT_STATUS_LOGON_FAILURE);
}
fstrcpy(sub_user, user);
-
-   /* setup the string used by %U */
-   sub_set_smb_name(user);
} else {
fstrcpy(sub_user, lp_guestaccount());

svn commit: samba r11654 - in trunk/source: .

2005-11-10 Thread paulg
Author: paulg
Date: 2005-11-10 20:33:32 + (Thu, 10 Nov 2005)
New Revision: 11654

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11654

Log:
Declare the correct return value for the static initialization functions.
Some compilers (guess whose) have ABIs that return int values using a
different method than returning struct values.


Modified:
   trunk/source/aclocal.m4


Changeset:
Modified: trunk/source/aclocal.m4
===
--- trunk/source/aclocal.m4 2005-11-10 20:32:00 UTC (rev 11653)
+++ trunk/source/aclocal.m4 2005-11-10 20:33:32 UTC (rev 11654)
@@ -56,7 +56,7 @@
[$6]
string_shared_modules="$string_shared_modules $1"
elif test x"$DEST" = xSTATIC; then
-   [init_static_modules_]translit([$4], [A-Z], 
[a-z])="$[init_static_modules_]translit([$4], [A-Z], [a-z]) $1_init();"
+   [init_static_modules_]translit([$4], [A-Z], 
[a-z])="$[init_static_modules_]translit([$4], [A-Z], [a-z]) NTSTATUS $1_init();"
string_static_modules="$string_static_modules $1"
$4_STATIC="$$4_STATIC $2"
AC_SUBST($4_STATIC)



svn commit: samba r11653 - in branches/SAMBA_3_0/source: .

2005-11-10 Thread paulg
Author: paulg
Date: 2005-11-10 20:32:00 + (Thu, 10 Nov 2005)
New Revision: 11653

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11653

Log:
Declare the correct return value for the static initialization functions.
Some compilers (guess whose) have ABIs that return int values using a
different method than returning struct values.


Modified:
   branches/SAMBA_3_0/source/aclocal.m4


Changeset:
Modified: branches/SAMBA_3_0/source/aclocal.m4
===
--- branches/SAMBA_3_0/source/aclocal.m42005-11-10 20:28:23 UTC (rev 
11652)
+++ branches/SAMBA_3_0/source/aclocal.m42005-11-10 20:32:00 UTC (rev 
11653)
@@ -56,7 +56,7 @@
[$6]
string_shared_modules="$string_shared_modules $1"
elif test x"$DEST" = xSTATIC; then
-   [init_static_modules_]translit([$4], [A-Z], 
[a-z])="$[init_static_modules_]translit([$4], [A-Z], [a-z]) $1_init();"
+   [init_static_modules_]translit([$4], [A-Z], 
[a-z])="$[init_static_modules_]translit([$4], [A-Z], [a-z]) NTSTATUS $1_init();"
string_static_modules="$string_static_modules $1"
$4_STATIC="$$4_STATIC $2"
AC_SUBST($4_STATIC)



svn commit: samba r11652 - branches/SAMBA_3_0/source branches/SAMBA_3_0/source/auth branches/SAMBA_3_0/source/libsmb branches/SAMBA_3_0/source/nsswitch trunk/source trunk/source/auth trunk/source/libs

2005-11-10 Thread jerry
Author: jerry
Date: 2005-11-10 20:28:23 + (Thu, 10 Nov 2005)
New Revision: 11652

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11652

Log:
Reinstate the netsamlogon_cache in order to work
around failed query_user calls.  This fixes 
logons to a member of a Samba domain as a user from a 
trusted AD domain.

As per comments on samba-technical, I still need to add

(a) cache the PAC info as werll as NTLM net_user_info_3
(b) expire the cache when the SMB session goes away

Both Jeremy and Guenther have signed off on the idea.



Added:
   branches/SAMBA_3_0/source/libsmb/samlogon_cache.c
   trunk/source/libsmb/samlogon_cache.c
Modified:
   branches/SAMBA_3_0/source/Makefile.in
   branches/SAMBA_3_0/source/auth/auth_domain.c
   branches/SAMBA_3_0/source/nsswitch/winbindd.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_rpc.c
   trunk/source/Makefile.in
   trunk/source/auth/auth_domain.c
   trunk/source/nsswitch/winbindd.c
   trunk/source/nsswitch/winbindd_cache.c
   trunk/source/nsswitch/winbindd_pam.c
   trunk/source/nsswitch/winbindd_rpc.c


Changeset:
Sorry, the patch is too large (979 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11652


svn commit: samba r11651 - branches/SAMBA_3_0/source/libads branches/SAMBA_3_0/source/nsswitch trunk/source/libads trunk/source/nsswitch

2005-11-10 Thread jerry
Author: jerry
Date: 2005-11-10 19:50:09 + (Thu, 10 Nov 2005)
New Revision: 11651

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11651

Log:
After talking to Jeremy, commit my winbindd "Do the Right Thing" patch.
Still needs some more testing ni domains with multiple DCs. Coming next



Modified:
   branches/SAMBA_3_0/source/libads/kerberos.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
   trunk/source/libads/kerberos.c
   trunk/source/nsswitch/winbindd_ads.c
   trunk/source/nsswitch/winbindd_cache.c


Changeset:
Sorry, the patch is too large (325 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11651


svn commit: samba-docs r857 - in trunk/smbdotconf/protocol: .

2005-11-10 Thread jra
Author: jra
Date: 2005-11-10 19:08:39 + (Thu, 10 Nov 2005)
New Revision: 857

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-docs&rev=857

Log:
Added acl map full control docs.
Jeremy.

Added:
   trunk/smbdotconf/protocol/aclmapfullcontrol.xml


Changeset:
Added: trunk/smbdotconf/protocol/aclmapfullcontrol.xml
===
--- trunk/smbdotconf/protocol/aclmapfullcontrol.xml 2005-11-08 06:42:23 UTC 
(rev 856)
+++ trunk/smbdotconf/protocol/aclmapfullcontrol.xml 2005-11-10 19:08:39 UTC 
(rev 857)
@@ -0,0 +1,16 @@
+http://www.samba.org/samba/DTD/samba-doc";>
+
+This boolean parameter controls whether 
smbd 
+8maps a POSIX ACE entry of "rwx" 
(read/write/execute),
+the maximum allowed POSIX permission set, into a Windows ACL of "FULL 
CONTROL". If this
+parameter is set to true any POSIX ACE entry of "rwx" will be returned in 
a Windows ACL as
+"FULL CONTROL", is this parameter is set to false any POSIX ACE entry of 
"rwx" will be
+returned as the specific Windows ACL bits representing read, write and 
execute.
+
+
+True
+



svn commit: samba r11650 - in branches/SAMBA_4_0/source/smb_server: .

2005-11-10 Thread metze
Author: metze
Date: 2005-11-10 16:16:09 + (Thu, 10 Nov 2005)
New Revision: 11650

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11650

Log:
- as every call that goes down to the ntvfs layer need a valid tcon and session
  ntcancel also needs to have AS_USER
- move the SIGNING_NO_REPLY logic as global option, because this needs to be set
  for the error replies too.
- as we currently don't know how to generate signatures for ntcancel replies
  we just skip the sending of the reply 
- w2k3 first checks the VUID and then the TID, so we do now
- ntcreateX also uses ERRbaduid when getting a wrong VUID

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/reply.c
   branches/SAMBA_4_0/source/smb_server/smb_server.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/reply.c
===
--- branches/SAMBA_4_0/source/smb_server/reply.c2005-11-10 16:09:44 UTC 
(rev 11649)
+++ branches/SAMBA_4_0/source/smb_server/reply.c2005-11-10 16:16:09 UTC 
(rev 11650)
@@ -2335,7 +2335,6 @@
 void reply_ntcancel(struct smbsrv_request *req)
 {
/* NOTE: this request does not generate a reply */
-   req_signing_no_reply(req);
ntvfs_cancel(req);
req_destroy(req);
 }

Modified: branches/SAMBA_4_0/source/smb_server/smb_server.c
===
--- branches/SAMBA_4_0/source/smb_server/smb_server.c   2005-11-10 16:09:44 UTC 
(rev 11649)
+++ branches/SAMBA_4_0/source/smb_server/smb_server.c   2005-11-10 16:16:09 UTC 
(rev 11650)
@@ -114,6 +114,7 @@
   These flags determine some of the permissions required to do an operation 
 */
 #define AS_USER (1<<0)
+#define SIGNING_NO_REPLY (1<<1)
 
 /* 
define a list of possible SMB messages and their corresponding
@@ -291,7 +292,7 @@
 /* 0xa1 */ { "SMBnttranss", reply_nttranss, AS_USER},
 /* 0xa2 */ { "SMBntcreateX", reply_ntcreate_and_X, AS_USER},
 /* 0xa3 */ { NULL, NULL, 0 },
-/* 0xa4 */ { "SMBntcancel", reply_ntcancel, 0},
+/* 0xa4 */ { "SMBntcancel", reply_ntcancel, AS_USER|SIGNING_NO_REPLY},
 /* 0xa5 */ { "SMBntrename", reply_ntrename, AS_USER},
 /* 0xa6 */ { NULL, NULL, 0 },
 /* 0xa7 */ { NULL, NULL, 0 },
@@ -411,6 +412,7 @@
int flags;
struct smbsrv_connection *smb_conn = req->smb_conn;
uint16_t session_tag;
+   NTSTATUS status;
 
type &= 0xff;
 
@@ -448,23 +450,64 @@
 
DEBUG(3,("switch message %s (task_id %d)\n",smb_fn_name(type), 
req->smb_conn->connection->server_id));
 
-   /* does this protocol need a valid tree connection? */
-   if ((flags & AS_USER) && !req->tcon) {
+   /* this must be called before we do any reply */
+   if (flags & SIGNING_NO_REPLY) {
+   req_signing_no_reply(req);
+   }
+
+   /* see if the vuid is valid */
+   if ((flags & AS_USER) && !req->session) {
/* amazingly, the error code depends on the command */
switch (type) {
case SMBntcreateX:
-   req_reply_error(req, NT_STATUS_DOS(ERRSRV, 
ERRinvnid));
+   case SMBntcancel:
+   status = NT_STATUS_DOS(ERRSRV, ERRbaduid);
break;
default:
-   req_reply_error(req, NT_STATUS_INVALID_HANDLE);
+   status = NT_STATUS_INVALID_HANDLE;
break;
}
+   /* 
+* TODO:
+* don't know how to handle smb signing for this case 
+* so just skip the reply
+*/
+   if ((flags & SIGNING_NO_REPLY) &&
+   (req->smb_conn->signing.signing_state != 
SMB_SIGNING_ENGINE_OFF)) {
+   DEBUG(1,("SKIP ERROR REPLY: %s %s because of unknown 
smb signing case\n",
+   smb_fn_name(type), nt_errstr(status)));
+   req_destroy(req);
+   return;
+   }
+   req_reply_error(req, status);
return;
}
 
-   /* see if the vuid is valid */
-   if ((flags & AS_USER) && !req->session) {
-   req_reply_error(req, NT_STATUS_INVALID_HANDLE);
+   /* does this protocol need a valid tree connection? */
+   if ((flags & AS_USER) && !req->tcon) {
+   /* amazingly, the error code depends on the command */
+   switch (type) {
+   case SMBntcreateX:
+   case SMBntcancel:
+   status = NT_STATUS_DOS(ERRSRV, ERRinvnid);
+   break;
+   default:
+   status = NT_STATUS_INVALID_HANDLE;
+   break;
+   }
+   /* 
+* TODO:
+   

svn commit: samba r11649 - in branches/SAMBA_4_0/source/libcli/raw: .

2005-11-10 Thread metze
Author: metze
Date: 2005-11-10 16:09:44 + (Thu, 10 Nov 2005)
New Revision: 11649

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11649

Log:
- add support for ntcancel replies (they only happen in error cases,
  e.g when you supply an invalid TID or VUID)
- as we don't yet understand how to check the smb_signing of this
  replies, we just ignore the whole packet

abartlet,jra,tridge:
can someone try to find out how to create and verify
the signatures for this replies.
what I noticed is that still use the increment by one for the request,
and later requests are still generated fine, only the generating and verifying
of the ntcancel replies make problems

metze
Modified:
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c
   branches/SAMBA_4_0/source/libcli/raw/libcliraw.h
   branches/SAMBA_4_0/source/libcli/raw/rawnotify.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/clitransport.c
===
--- branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-10 15:51:57 UTC 
(rev 11648)
+++ branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-10 16:09:44 UTC 
(rev 11649)
@@ -391,6 +391,9 @@
if (req->mid == mid) break;
}
 
+   /* see if it's a ntcancel reply for the current MID */
+   req = smbcli_handle_ntcancel_reply(req, len, hdr);
+
if (!req) {
DEBUG(1,("Discarding unmatched reply with mid %d op %d\n", mid, 
op));
goto error;

Modified: branches/SAMBA_4_0/source/libcli/raw/libcliraw.h
===
--- branches/SAMBA_4_0/source/libcli/raw/libcliraw.h2005-11-10 15:51:57 UTC 
(rev 11648)
+++ branches/SAMBA_4_0/source/libcli/raw/libcliraw.h2005-11-10 16:09:44 UTC 
(rev 11649)
@@ -231,6 +231,9 @@
/* the sequence number of this packet - used for signing */
uint_t seq_num;
 
+   /* list of ntcancel request for this requests */
+   struct smbcli_request *ntcancel;
+
/* set if this is a one-way request, meaning we are not
   expecting a reply from the server. */
uint_t one_way_request:1;

Modified: branches/SAMBA_4_0/source/libcli/raw/rawnotify.c
===
--- branches/SAMBA_4_0/source/libcli/raw/rawnotify.c2005-11-10 15:51:57 UTC 
(rev 11648)
+++ branches/SAMBA_4_0/source/libcli/raw/rawnotify.c2005-11-10 16:09:44 UTC 
(rev 11649)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "libcli/raw/libcliraw.h"
+#include "dlinklist.h"
 
 /
 change notify (async send)
@@ -89,7 +90,38 @@
return NT_STATUS_OK;
 }
 
+/
+  handle ntcancel replies from the server,
+  as the MID of the real reply and the ntcancel reply is the same
+  we need to do find out to what request the reply belongs
+/
+struct smbcli_request *smbcli_handle_ntcancel_reply(struct smbcli_request *req,
+   uint_t len, const uint8_t 
*hdr)
+{
+   struct smbcli_request *ntcancel;
 
+   if (!req) return req;
+
+   if (!req->ntcancel) return req;
+
+   if (len >= MIN_SMB_SIZE + NBT_HDR_SIZE &&
+   (CVAL(hdr, HDR_FLG) & FLAG_REPLY) &&
+CVAL(hdr,HDR_COM) == SMBntcancel) {
+   ntcancel = req->ntcancel;
+   DLIST_REMOVE(req->ntcancel, ntcancel);
+
+   /*
+* TODO: untill we understand how the 
+*   smb_signing works for this case we 
+*   return NULL, to just ignore the packet
+*/
+   /*return ntcancel;*/
+   return NULL;
+   }
+
+   return req;
+}
+
 /
  Send a NT Cancel request - used to hurry along a pending request. Usually
  used to cancel a pending change notify request
@@ -111,7 +143,18 @@
req->sign_single_increment = 1;
req->one_way_request = 1;
 
+   /* 
+* smbcli_request_send() free's oneway requests
+* but we want to keep it under oldreq->ntcancel
+*/
+   if (!talloc_reference(oldreq, req)) {
+   talloc_free(req);
+   return NT_STATUS_NO_MEMORY;
+   }
+
smbcli_request_send(req);
 
+   DLIST_ADD_END(oldreq->ntcancel, req, struct smbcli_request *);
+
return NT_STATUS_OK;
 }



svn commit: samba r11648 - in branches/SAMBA_4_0/source/nbt_server: . dgram

2005-11-10 Thread metze
Author: metze
Date: 2005-11-10 15:51:57 + (Thu, 10 Nov 2005)
New Revision: 11648

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11648

Log:
fix some bugs...

metze
Modified:
   branches/SAMBA_4_0/source/nbt_server/dgram/browse.c
   branches/SAMBA_4_0/source/nbt_server/dgram/request.c
   branches/SAMBA_4_0/source/nbt_server/irpc.c


Changeset:
Modified: branches/SAMBA_4_0/source/nbt_server/dgram/browse.c
===
--- branches/SAMBA_4_0/source/nbt_server/dgram/browse.c 2005-11-10 15:27:27 UTC 
(rev 11647)
+++ branches/SAMBA_4_0/source/nbt_server/dgram/browse.c 2005-11-10 15:51:57 UTC 
(rev 11648)
@@ -31,7 +31,7 @@
 */
 void nbtd_mailslot_browse_handler(struct dgram_mailslot_handler *dgmslot, 
  struct nbt_dgram_packet *packet, 
- struct nbt_peer_socket *src)
+ const struct nbt_peer_socket *src)
 {
DEBUG(2,("Browse request on '%s' from %s:%d\n", 
  dgmslot->mailslot_name, src->addr, src->port));

Modified: branches/SAMBA_4_0/source/nbt_server/dgram/request.c
===
--- branches/SAMBA_4_0/source/nbt_server/dgram/request.c2005-11-10 
15:27:27 UTC (rev 11647)
+++ branches/SAMBA_4_0/source/nbt_server/dgram/request.c2005-11-10 
15:51:57 UTC (rev 11648)
@@ -44,10 +44,10 @@
   are handled in the specific mailslot handlers
 */
 void dgram_request_handler(struct nbt_dgram_socket *dgmsock, 
-  struct nbt_dgram_packet *packet, 
-  const char *src_address, int src_port)
+  struct nbt_dgram_packet *packet,
+  const struct nbt_peer_socket *src)
 {
-   DEBUG(0,("General datagram request from %s:%d\n", src_address, 
src_port));
+   DEBUG(0,("General datagram request from %s:%d\n", src->addr, 
src->port));
NDR_PRINT_DEBUG(nbt_dgram_packet, packet);
 }
 

Modified: branches/SAMBA_4_0/source/nbt_server/irpc.c
===
--- branches/SAMBA_4_0/source/nbt_server/irpc.c 2005-11-10 15:27:27 UTC (rev 
11647)
+++ branches/SAMBA_4_0/source/nbt_server/irpc.c 2005-11-10 15:51:57 UTC (rev 
11648)
@@ -57,7 +57,7 @@
 
 static void getdc_recv_ntlogon_reply(struct dgram_mailslot_handler *dgmslot, 
 struct nbt_dgram_packet *packet, 
-const char *src_address, int src_port)
+const struct nbt_peer_socket *src)
 {
struct getdc_state *s =
talloc_get_type(dgmslot->private, struct getdc_state);



svn commit: samba r11647 - in branches/SAMBA_4_0/source/libcli/raw: .

2005-11-10 Thread metze
Author: metze
Date: 2005-11-10 15:27:27 + (Thu, 10 Nov 2005)
New Revision: 11647

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11647

Log:
add smbcli_ prefix

metze
Modified:
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c
   branches/SAMBA_4_0/source/libcli/raw/rawrequest.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/clitransport.c
===
--- branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-10 14:54:05 UTC 
(rev 11646)
+++ branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-10 15:27:27 UTC 
(rev 11647)
@@ -356,7 +356,7 @@
vwv = hdr + HDR_VWV;
 
/* see if it could be an oplock break request */
-   if (handle_oplock_break(transport, len, hdr, vwv)) {
+   if (smbcli_handle_oplock_break(transport, len, hdr, vwv)) {
talloc_free(buffer);
return NT_STATUS_OK;
}

Modified: branches/SAMBA_4_0/source/libcli/raw/rawrequest.c
===
--- branches/SAMBA_4_0/source/libcli/raw/rawrequest.c   2005-11-10 14:54:05 UTC 
(rev 11646)
+++ branches/SAMBA_4_0/source/libcli/raw/rawrequest.c   2005-11-10 15:27:27 UTC 
(rev 11647)
@@ -360,7 +360,7 @@
   handle oplock break requests from the server - return True if the request was
   an oplock break
 */
-BOOL handle_oplock_break(struct smbcli_transport *transport, uint_t len, const 
uint8_t *hdr, const uint8_t *vwv)
+BOOL smbcli_handle_oplock_break(struct smbcli_transport *transport, uint_t 
len, const uint8_t *hdr, const uint8_t *vwv)
 {
/* we must be very fussy about what we consider an oplock break to avoid
   matching readbraw replies */



svn commit: samba r11646 - in branches/SAMBA_4_0/source/smb_server: .

2005-11-10 Thread metze
Author: metze
Date: 2005-11-10 14:54:05 + (Thu, 10 Nov 2005)
New Revision: 11646

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11646

Log:
fix typos

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/signing.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/signing.c
===
--- branches/SAMBA_4_0/source/smb_server/signing.c  2005-11-10 14:30:39 UTC 
(rev 11645)
+++ branches/SAMBA_4_0/source/smb_server/signing.c  2005-11-10 14:54:05 UTC 
(rev 11646)
@@ -130,7 +130,7 @@
 {
req->seq_num = req->smb_conn->signing.next_seq_num;
 
-   if (req->smb_conn->signing.signing_state != SMB_SIGNING_OFF) {
+   if (req->smb_conn->signing.signing_state != SMB_SIGNING_ENGINE_OFF) {
req->smb_conn->signing.next_seq_num += 2;
}
 }
@@ -140,7 +140,7 @@
 */
 void req_signing_no_reply(struct smbsrv_request *req)
 {
-   if (req->smb_conn->signing.signing_state != SMB_SIGNING_OFF) {
+   if (req->smb_conn->signing.signing_state != SMB_SIGNING_ENGINE_OFF) {
req->smb_conn->signing.next_seq_num--;
}
 }



svn commit: samba r11645 - in branches/SAMBA_3_0/examples/logon/mklogon: .

2005-11-10 Thread jerry
Author: jerry
Date: 2005-11-10 14:30:39 + (Thu, 10 Nov 2005)
New Revision: 11645

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11645

Log:
mklogon updates from Ricky Nance
Modified:
   branches/SAMBA_3_0/examples/logon/mklogon/mklogon.conf
   branches/SAMBA_3_0/examples/logon/mklogon/mklogon.pl


Changeset:
Modified: branches/SAMBA_3_0/examples/logon/mklogon/mklogon.conf
===
--- branches/SAMBA_3_0/examples/logon/mklogon/mklogon.conf  2005-11-10 
14:16:50 UTC (rev 11644)
+++ branches/SAMBA_3_0/examples/logon/mklogon/mklogon.conf  2005-11-10 
14:30:39 UTC (rev 11645)
@@ -6,72 +6,73 @@
 # infront of your # on a comment it breaks ...
 # logging = yes# Should Logging be enabled (YES,ON,1 or 
NO,OFF,0)(if not specified defaults to no)
 # logdir  = "/root/perl"   # What is the base directory the logs should be 
stored.
-# logfile = "userlogs.txt" # What should the file be named.
-# logtype = file (default) # file will log to the file specified, syslog is 
well... the system logs ;)
+# logfile = "userlist.txt" # What should the file be named.
+# VERY IMPORTANT anything that has a "\" (backslash) in it ex. "C:\" MUST be 
changed to a double "\\" for 
+# it to be used in the script. ex. "C:\\"
 
 [global]
 logging = yes
 logdir  = "/home/samba/netlogon"   
 logfile = "UserLogs.txt" 
-logtype = system
 mkprofile = 1
 timesync = yes
 sambaconf = "/etc/samba/smb.conf"
+logtype = file
 
 # Change and uncomment the below value to force the servername, some clients 
ocassionally 
 # have trouble picking up the right servername so it may need to be set. It 
CANNOT be left blank AND uncommented.
-# servername = staticservername
+servername = "TIGER"
 
 [common]
 public = P:, public
 home   = H:, /home
 
 [groupmap]
-admin   = Y:, UTILS
-adm = R:, NETLOGON
+adm = R:, NETLOGON, Y:, ARCHIVES
+teachers = S:, RECORDS, X:, SIS
+plato = T:, PLATO
+webpage = W:, WEB
+hsoffice = N:, HSOFFICE, Q:, COMMON, X:, SIS
+suoffice = N:, super, Q:, COMMON, X:, SIS
+emoffice = N:, emOFFICE, Q:, COMMON, X:, SIS
+tech = O:, utils
+yearbook = Y:, yearbook
 
 [usermap]
-user1 = G:, GHOST
-beanbags = Q:, STAR
-avinst = P:\\vexira\\vexprof.bat
+rnance = G:, GHOST, I:, TTL, Y:, ARCHIVES, R:, NETLOGON, X:, SIS
+lwatts = G:, GHOST, I:, TTL, Y:, ARCHIVES, R:, NETLOGON, X:, SIS
+droot = U:, stuhomes
+2007mbk = Y:, yearbook
+2008mll = Y:, yearbook
+2008jtj = Y:, yearbook
+2007tja = Y:, yearbook
+2007hms = Y:, yearbook
+2006dpv = Y:, yearbook
+2006jwb2 = Y:, yearbook
+2007npd = Y:, yearbook
+astewart = Y:, yearbook
 
+
+
 # Here is where things get confusing, you can assign a computer, or make a 
group of computers. 
-# The same context will go for ip address's as well.
+# The same context will go for ip address's as well, however you can also 
specify ip ranges, 
+# but I have not yet figured out how to do multiple ranges.
 # Use the following examples for help.
 # To define a single computer to do commands
 # mymachinename = command1, command2
 # To define a group of computers to do commands 
 # mymachinegroup = machinename1, machinename2
-# [preformcommands]
+# [performcommands]
 # mymachinegroup = command1,command2
+# iprangegroup1 = 10.1.2.1 - 10.1.3.1
 
+
+
 [machines]
-#emints 1 is jf
-emints1 = school-w88zfod9, school-o8axvv6t, school-mmtudgbo, school-dpokmajd, 
school-m84hx4iw, school-74548k1j, school-vou4gdap, school-qfuw5uho
-#emints 2 is kh
-emints2 = school-w7loulcx, school-2tbh64eu, school-uunqieuz, school-pow35do4, 
school-x0v0cbiz, school-zu5qyjhw, school-l4q4j32o
 
 [ip]
-ipgroup1 = 10.5.1.1 - 10.5.1.10, 10.1.1.255/24
-ipgroup2 = 10.1.1.1
+sixthemints = 10.1.5.201 - 10.1.5.215
 
-# This is the section where you can specify things according to the operating 
system of the client.
-# The clients OS -- Windows 95/98/ME (Win95), Windows NT (WinNT),
-# Windows 2000 (Win2K), Windows  XP  (WinXP), and Windows 2003
-# (Win2K3). Anything else will be known as ``UNKNOWN''
-# That snippet is directly from man smb.conf.
-# 
-
-[os]
-Win95 = REM your computer is windows 9x based
-WinNT = 
-Win2K = 
-WinXP = 
-Win2K3 = 
-UNKNOWN = 
-
-[preformcommands]
-emints1 = START JF-TEACHER\\Brother, START JF-TEACHER\\Canon, REGEDIT 
/S P:\\SETHOME-JF.REG, your in emints 1
-emints2 = START s0034292474\\Brother, START s0034292474\\Canon, 
REGEDIT /S P:\\SETHOME-KH.REG
-ipgroup1 = echo your in the ip group 
-ipgroup2 = echo your in the ip group 2, start command.com
+[performcommands]
+common = "XCOPY P:\\TYPEN32.INI C:\\WINDOWS\\ /Y \>NUL", "XCOPY 
P:\\ARPROGRAMS\\DBLOCATION\\\*\.\* C:\\WINDOWS\\ /Y \>NUL", "XCOPY 
P:\\EMACTIVITIES\\EMGAMESPREFS.INI C:\\WINDOWS\\ /Y \>NUL", 
"PATH\=\%PATH\%;p:\\PXPerl\parrot\\bin;p:\\PXPerl\\bin"
+sixthemints = "start 10.1.5.20\\printer"

Modified: branches/SAMBA_3_0/examples/logon/mklogon/mklogon.pl
===
--- branches/SAMBA_3

svn commit: samba r11644 - in branches/SAMBA_4_0/source/libcli/raw: .

2005-11-10 Thread metze
Author: metze
Date: 2005-11-10 14:16:50 + (Thu, 10 Nov 2005)
New Revision: 11644

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11644

Log:
free the buffer when it's not used

metze
Modified:
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/clitransport.c
===
--- branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-10 14:03:07 UTC 
(rev 11643)
+++ branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-10 14:16:50 UTC 
(rev 11644)
@@ -479,6 +479,8 @@
if (req) {
DLIST_REMOVE(transport->pending_recv, req);
req->state = SMBCLI_REQUEST_ERROR;
+   } else {
+   talloc_free(buffer);
}
return NT_STATUS_OK;
 }



svn commit: samba r11643 - in branches/SAMBA_4_0/source/smb_server: .

2005-11-10 Thread metze
Author: metze
Date: 2005-11-10 14:03:07 + (Thu, 10 Nov 2005)
New Revision: 11643

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11643

Log:
fix compiler warnings

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/reply.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/reply.c
===
--- branches/SAMBA_4_0/source/smb_server/reply.c2005-11-10 13:52:07 UTC 
(rev 11642)
+++ branches/SAMBA_4_0/source/smb_server/reply.c2005-11-10 14:03:07 UTC 
(rev 11643)
@@ -2382,7 +2382,7 @@
NTSTATUS status;

blob.data = req->in.buffer + 4;
-   blob.length = ascii_len_n(blob.data, req->in.size - PTR_DIFF(blob.data, 
req->in.buffer));
+   blob.length = ascii_len_n((const char *)blob.data, req->in.size - 
PTR_DIFF(blob.data, req->in.buffer));
if (blob.length == 0) return NT_STATUS_BAD_NETWORK_NAME;
 
req->smb_conn->negotiate.called_name  = talloc(req->smb_conn, struct 
nbt_name);
@@ -2397,7 +2397,7 @@
NT_STATUS_NOT_OK_RETURN(status);
 
blob.data += blob.length;
-   blob.length = ascii_len_n(blob.data, req->in.size - PTR_DIFF(blob.data, 
req->in.buffer));
+   blob.length = ascii_len_n((const char *)blob.data, req->in.size - 
PTR_DIFF(blob.data, req->in.buffer));
if (blob.length == 0) return NT_STATUS_BAD_NETWORK_NAME;
 
status = nbt_name_from_blob(req->smb_conn, &blob,



svn commit: samba r11642 - in branches/SAMBA_4_0/source/lib/stream: .

2005-11-10 Thread metze
Author: metze
Date: 2005-11-10 13:52:07 + (Thu, 10 Nov 2005)
New Revision: 11642

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11642

Log:
add some error checks

metze
Modified:
   branches/SAMBA_4_0/source/lib/stream/packet.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/stream/packet.c
===
--- branches/SAMBA_4_0/source/lib/stream/packet.c   2005-11-10 13:02:56 UTC 
(rev 11641)
+++ branches/SAMBA_4_0/source/lib/stream/packet.c   2005-11-10 13:52:07 UTC 
(rev 11642)
@@ -317,7 +317,11 @@
packet_error(pc, NT_STATUS_NO_MEMORY);
return;
}
-   data_blob_realloc(pc, &blob, pc->packet_size);
+   status = data_blob_realloc(pc, &blob, pc->packet_size);
+   if (!NT_STATUS_IS_OK(status)) {
+   packet_error(pc, status);
+   return;
+   }
} else {
pc->partial = data_blob(NULL, 0);
}
@@ -440,7 +444,9 @@
/* if we aren't going to free the packet then we must reference it
   to ensure it doesn't disappear before going out */
if (pc->nofree) {
-   talloc_reference(el, blob.data);
+   if (!talloc_reference(el, blob.data)) {
+   return NT_STATUS_NO_MEMORY;
+   }
} else {
talloc_steal(el, blob.data);
}



svn commit: samba r11641 - in branches/SAMBA_4_0/source/smb_server: .

2005-11-10 Thread metze
Author: metze
Date: 2005-11-10 13:02:56 + (Thu, 10 Nov 2005)
New Revision: 11641

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11641

Log:
remove unused parameter vuid

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/service.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/service.c
===
--- branches/SAMBA_4_0/source/smb_server/service.c  2005-11-10 12:59:15 UTC 
(rev 11640)
+++ branches/SAMBA_4_0/source/smb_server/service.c  2005-11-10 13:02:56 UTC 
(rev 11641)
@@ -104,7 +104,7 @@
 /
 static NTSTATUS make_connection(struct smbsrv_request *req,
const char *service, DATA_BLOB password, 
-   const char *dev, uint16_t vuid)
+   const char *dev)
 {
int snum;
enum ntvfs_type type;
@@ -154,22 +154,17 @@
 NTSTATUS tcon_backend(struct smbsrv_request *req, union smb_tcon *con)
 {
NTSTATUS status;
-   uint16_t vuid = UID_FIELD_INVALID;
 
/* can only do bare tcon in share level security */
if (req->session == NULL && lp_security() != SEC_SHARE) {
return NT_STATUS_ACCESS_DENIED;
}
 
-   if (req->session) {
-   vuid = req->session->vuid;
-   }
-
if (con->generic.level == RAW_TCON_TCON) {
DATA_BLOB password;
password = data_blob(con->tcon.in.password, 
strlen(con->tcon.in.password) + 1);
 
-   status = make_connection(req, con->tcon.in.service, password, 
con->tcon.in.dev, vuid);
+   status = make_connection(req, con->tcon.in.service, password, 
con->tcon.in.dev);

if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -182,7 +177,7 @@
} 
 
status = make_connection(req, con->tconx.in.path, 
con->tconx.in.password, 
-con->tconx.in.device, vuid);
+con->tconx.in.device);
if (!NT_STATUS_IS_OK(status)) {
return status;
}



svn commit: samba r11640 - in branches/SAMBA_4_0/source/smb_server: .

2005-11-10 Thread metze
Author: metze
Date: 2005-11-10 12:59:15 + (Thu, 10 Nov 2005)
New Revision: 11640

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11640

Log:
just a nicer format, and make adding more special cases easier

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/smb_server.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb_server.c
===
--- branches/SAMBA_4_0/source/smb_server/smb_server.c   2005-11-10 12:35:12 UTC 
(rev 11639)
+++ branches/SAMBA_4_0/source/smb_server/smb_server.c   2005-11-10 12:59:15 UTC 
(rev 11640)
@@ -450,11 +450,14 @@
 
/* does this protocol need a valid tree connection? */
if ((flags & AS_USER) && !req->tcon) {
-   if (type == SMBntcreateX) {
-   /* amazingly, the error code depends on the command */
-   req_reply_error(req, NT_STATUS_DOS(ERRSRV, ERRinvnid));
-   } else {
-   req_reply_error(req, NT_STATUS_INVALID_HANDLE);
+   /* amazingly, the error code depends on the command */
+   switch (type) {
+   case SMBntcreateX:
+   req_reply_error(req, NT_STATUS_DOS(ERRSRV, 
ERRinvnid));
+   break;
+   default:
+   req_reply_error(req, NT_STATUS_INVALID_HANDLE);
+   break;
}
return;
}



svn commit: samba r11639 - in branches/SAMBA_4_0/source/torture/raw: .

2005-11-10 Thread tridge
Author: tridge
Date: 2005-11-10 12:35:12 + (Thu, 10 Nov 2005)
New Revision: 11639

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11639

Log:

fixed some create_time tests that should be change_time tests


Modified:
   branches/SAMBA_4_0/source/torture/raw/search.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/search.c
===
--- branches/SAMBA_4_0/source/torture/raw/search.c  2005-11-10 12:29:44 UTC 
(rev 11638)
+++ branches/SAMBA_4_0/source/torture/raw/search.c  2005-11-10 12:35:12 UTC 
(rev 11639)
@@ -345,11 +345,11 @@
CHECK_NTTIME("ID_FULL_DIRECTORY_INFO", id_full_directory_info,  
 access_time, all_info, all_info, access_time);
CHECK_NTTIME("ID_BOTH_DIRECTORY_INFO", id_both_directory_info,  
 access_time, all_info, all_info, access_time);
 
-   CHECK_NTTIME("DIRECTORY_INFO",  directory_info,  create_time, 
all_info, all_info, create_time);
-   CHECK_NTTIME("FULL_DIRECTORY_INFO", full_directory_info, create_time, 
all_info, all_info, create_time);
-   CHECK_NTTIME("BOTH_DIRECTORY_INFO", both_directory_info, create_time, 
all_info, all_info, create_time);
-   CHECK_NTTIME("ID_FULL_DIRECTORY_INFO", id_full_directory_info,  
 create_time, all_info, all_info, create_time);
-   CHECK_NTTIME("ID_BOTH_DIRECTORY_INFO", id_both_directory_info,  
 create_time, all_info, all_info, create_time);
+   CHECK_NTTIME("DIRECTORY_INFO",  directory_info,  change_time, 
all_info, all_info, change_time);
+   CHECK_NTTIME("FULL_DIRECTORY_INFO", full_directory_info, change_time, 
all_info, all_info, change_time);
+   CHECK_NTTIME("BOTH_DIRECTORY_INFO", both_directory_info, change_time, 
all_info, all_info, change_time);
+   CHECK_NTTIME("ID_FULL_DIRECTORY_INFO", id_full_directory_info,  
 change_time, all_info, all_info, change_time);
+   CHECK_NTTIME("ID_BOTH_DIRECTORY_INFO", id_both_directory_info,  
 change_time, all_info, all_info, change_time);
 
CHECK_VAL("SEARCH",  search,  size, all_info, 
all_info, size);
CHECK_VAL("STANDARD",standard,size, all_info, 
all_info, size);



svn commit: samba r11638 - in branches/SAMBA_4_0/source/torture/raw: .

2005-11-10 Thread tridge
Author: tridge
Date: 2005-11-10 12:29:44 + (Thu, 10 Nov 2005)
New Revision: 11638

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11638

Log:

fixed handling of null volume name in RAW-QFSINFO test
thanks to Stephen Zarkos for finding this


Modified:
   branches/SAMBA_4_0/source/torture/raw/qfsinfo.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/qfsinfo.c
===
--- branches/SAMBA_4_0/source/torture/raw/qfsinfo.c 2005-11-10 12:25:46 UTC 
(rev 11637)
+++ branches/SAMBA_4_0/source/torture/raw/qfsinfo.c 2005-11-10 12:29:44 UTC 
(rev 11638)
@@ -83,9 +83,8 @@
 ret = False; \
 }} while(0)
 
-#define STR_EQUAL(n1, v1, n2, v2) do {if (!s1->n1.out.v1 && !s2->n2.out.v2) 
return True; \
-   if (!s1->n1.out.v1 || !s2->n2.out.v2) return False; \
-   if (strcmp(s1->n1.out.v1, s2->n2.out.v2)) { \
+#define STR_EQUAL(n1, v1, n2, v2) do { \
+   if (strcmp_safe(s1->n1.out.v1, s2->n2.out.v2)) { \
  printf("%s/%s [%s] != %s/%s [%s] at %s(%d)\n", \
#n1, #v1, s1->n1.out.v1, \
#n2, #v2, s2->n2.out.v2, \
@@ -287,7 +286,7 @@
 #define STR_CHECK(sname, stype, field, flags) do { \
s1 = find(sname); \
if (s1) { \
-   if (wire_bad_flags(&s1->stype.out.field, flags, cli)) { \
+   if (s1->stype.out.field.s && 
wire_bad_flags(&s1->stype.out.field, flags, cli)) { \
printf("(%d) incorrect string termination in %s/%s\n", \
   __LINE__, #stype, #field); \
ret = False; \
@@ -295,6 +294,7 @@
}} while (0)
 
printf("check for correct termination\n");
+   
STR_CHECK("VOLUME",volume, volume_name, 0);
STR_CHECK("VOLUME_INFO",   volume_info,volume_name, 
STR_UNICODE);
STR_CHECK("VOLUME_INFORMATION",volume_info,volume_name, 
STR_UNICODE);



svn commit: samba r11637 - in branches/SAMBA_4_0/source/smb_server: .

2005-11-10 Thread metze
Author: metze
Date: 2005-11-10 12:25:46 + (Thu, 10 Nov 2005)
New Revision: 11637

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11637

Log:
we need a session and a tcon for ntioctl() and ntrename()

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/smb_server.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb_server.c
===
--- branches/SAMBA_4_0/source/smb_server/smb_server.c   2005-11-10 11:10:40 UTC 
(rev 11636)
+++ branches/SAMBA_4_0/source/smb_server/smb_server.c   2005-11-10 12:25:46 UTC 
(rev 11637)
@@ -166,7 +166,7 @@
 /* 0x24 */ { "SMBlockingX",reply_lockingX,AS_USER},
 /* 0x25 */ { "SMBtrans",reply_trans,AS_USER},
 /* 0x26 */ { "SMBtranss",reply_transs,AS_USER},
-/* 0x27 */ { "SMBioctl",reply_ioctl,0},
+/* 0x27 */ { "SMBioctl",reply_ioctl,AS_USER},
 /* 0x28 */ { "SMBioctls",NULL,AS_USER},
 /* 0x29 */ { "SMBcopy",reply_copy,AS_USER},
 /* 0x2a */ { "SMBmove",NULL,AS_USER},
@@ -291,8 +291,8 @@
 /* 0xa1 */ { "SMBnttranss", reply_nttranss, AS_USER},
 /* 0xa2 */ { "SMBntcreateX", reply_ntcreate_and_X, AS_USER},
 /* 0xa3 */ { NULL, NULL, 0 },
-/* 0xa4 */ { "SMBntcancel", reply_ntcancel, 0 },
-/* 0xa5 */ { "SMBntrename", reply_ntrename, 0 },
+/* 0xa4 */ { "SMBntcancel", reply_ntcancel, 0},
+/* 0xa5 */ { "SMBntrename", reply_ntrename, AS_USER},
 /* 0xa6 */ { NULL, NULL, 0 },
 /* 0xa7 */ { NULL, NULL, 0 },
 /* 0xa8 */ { NULL, NULL, 0 },



svn commit: samba r11636 - in branches/SAMBA_4_0/source: lib/stream libcli/raw

2005-11-10 Thread tridge
Author: tridge
Date: 2005-11-10 11:10:40 + (Thu, 10 Nov 2005)
New Revision: 11636

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11636

Log:

a bit neater solution to the nt_cancel problem

Modified:
   branches/SAMBA_4_0/source/lib/stream/packet.c
   branches/SAMBA_4_0/source/lib/stream/packet.h
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/stream/packet.c
===
--- branches/SAMBA_4_0/source/lib/stream/packet.c   2005-11-10 09:12:36 UTC 
(rev 11635)
+++ branches/SAMBA_4_0/source/lib/stream/packet.c   2005-11-10 11:10:40 UTC 
(rev 11636)
@@ -45,6 +45,7 @@
BOOL serialise;
BOOL processing;
BOOL recv_disable;
+   BOOL nofree;
 
struct send_element {
struct send_element *next, *prev;
@@ -144,7 +145,15 @@
pc->initial_read = initial_read;
 }
 
+/*
+  tell the packet system not to steal/free blobs given to packet_send()
+*/
+void packet_set_nofree(struct packet_context *pc)
+{
+   pc->nofree = True;
+}
 
+
 /*
   tell the caller we have an error
 */
@@ -427,8 +436,15 @@
DLIST_ADD_END(pc->send_queue, el, struct send_element *);
el->blob = blob;
el->nsent = 0;
-   talloc_steal(el, blob.data);
 
+   /* if we aren't going to free the packet then we must reference it
+  to ensure it doesn't disappear before going out */
+   if (pc->nofree) {
+   talloc_reference(el, blob.data);
+   } else {
+   talloc_steal(el, blob.data);
+   }
+
EVENT_FD_WRITEABLE(pc->fde);
 
return NT_STATUS_OK;

Modified: branches/SAMBA_4_0/source/lib/stream/packet.h
===
--- branches/SAMBA_4_0/source/lib/stream/packet.h   2005-11-10 09:12:36 UTC 
(rev 11635)
+++ branches/SAMBA_4_0/source/lib/stream/packet.h   2005-11-10 11:10:40 UTC 
(rev 11636)
@@ -40,6 +40,7 @@
 void packet_set_event_context(struct packet_context *pc, struct event_context 
*ev);
 void packet_set_serialise(struct packet_context *pc, struct fd_event *fde);
 void packet_set_initial_read(struct packet_context *pc, uint32_t initial_read);
+void packet_set_nofree(struct packet_context *pc);
 void packet_recv(struct packet_context *pc);
 void packet_recv_disable(struct packet_context *pc);
 void packet_recv_enable(struct packet_context *pc);

Modified: branches/SAMBA_4_0/source/libcli/raw/clitransport.c
===
--- branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-10 09:12:36 UTC 
(rev 11635)
+++ branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-10 11:10:40 UTC 
(rev 11636)
@@ -105,6 +105,7 @@
packet_set_full_request(transport->packet, packet_full_request_nbt);
packet_set_error_handler(transport->packet, smbcli_transport_error);
packet_set_event_context(transport->packet, 
transport->socket->event.ctx);
+   packet_set_nofree(transport->packet);
 
smbcli_init_signing(transport);
 
@@ -559,16 +560,6 @@
return;
}
 
-   /* put it on the socket queue
-* - as the buffer is a part of the smbcli_request struct
-*   we need to reference it here, because packet_queue_run()
-*   will call talloc_free() on it
-*/
-   if (!talloc_reference(req, req->out.buffer)) {
-   req->state = SMBCLI_REQUEST_ERROR;
-   req->status = NT_STATUS_NO_MEMORY;
-   return;
-   }
blob = data_blob_const(req->out.buffer, req->out.size);
status = packet_send(req->transport->packet, blob);
if (!NT_STATUS_IS_OK(status)) {



svn commit: samba r11635 - in branches/SAMBA_4_0/source/libcli/raw: .

2005-11-10 Thread metze
Author: metze
Date: 2005-11-10 09:12:36 + (Thu, 10 Nov 2005)
New Revision: 11635

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11635

Log:
fix a handling of packet_send in the smb client lib

this was cause of the PANIC on the build farm on metze01

as we use req->out.buffer from the old request in the smb_raw_ntcancel()
and send a 0 TID, that causes our server code to crash
(a fix for the server code will follow)

metze
Modified:
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/clitransport.c
===
--- branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-10 07:12:17 UTC 
(rev 11634)
+++ branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2005-11-10 09:12:36 UTC 
(rev 11635)
@@ -559,7 +559,16 @@
return;
}
 
-   /* put it on the socket queue */
+   /* put it on the socket queue
+* - as the buffer is a part of the smbcli_request struct
+*   we need to reference it here, because packet_queue_run()
+*   will call talloc_free() on it
+*/
+   if (!talloc_reference(req, req->out.buffer)) {
+   req->state = SMBCLI_REQUEST_ERROR;
+   req->status = NT_STATUS_NO_MEMORY;
+   return;
+   }
blob = data_blob_const(req->out.buffer, req->out.size);
status = packet_send(req->transport->packet, blob);
if (!NT_STATUS_IS_OK(status)) {