Build status as of Sat Dec 2 00:00:02 2006

2006-12-01 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2006-12-01 
00:00:28.0 +
+++ /home/build/master/cache/broken_results.txt 2006-12-02 00:01:07.0 
+
@@ -1,4 +1,4 @@
-Build status as of Fri Dec  1 00:00:02 2006
+Build status as of Sat Dec  2 00:00:02 2006
 
 Build counts:
 Tree Total  Broken Panic 
@@ -14,9 +14,9 @@
 rsync44 5  0 
 samba0  0  0 
 samba-docs   0  0  0 
-samba4   42 31 0 
+samba4   41 31 0 
 samba_3_043 15 0 
 smb-build41 2  0 
-talloc   43 2  0 
+talloc   44 2  0 
 tdb  43 2  0 
 


svn commit: samba r19993 - in branches: SAMBA_3_0/source/smbd SAMBA_3_0_24/source/smbd

2006-12-01 Thread jra
Author: jra
Date: 2006-12-01 23:46:07 + (Fri, 01 Dec 2006)
New Revision: 19993

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

Log:
Fix the problem with Linux clients requesting O_WRONLY
on write-only files. Jim please check. Should not affect
Windows clients - I ensured all the relevent Samba4 
torture tests still pass.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/open.c
   branches/SAMBA_3_0_24/source/smbd/open.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/open.c
===
--- branches/SAMBA_3_0/source/smbd/open.c   2006-12-01 20:45:43 UTC (rev 
19992)
+++ branches/SAMBA_3_0/source/smbd/open.c   2006-12-01 23:46:07 UTC (rev 
19993)
@@ -1105,7 +1105,6 @@
uint32 open_access_mask = access_mask;
NTSTATUS status;
int ret_flock;
-   
 
if (conn->printer) {
/* 
@@ -1300,7 +1299,15 @@
 */
 
if (access_mask & (FILE_WRITE_DATA | FILE_APPEND_DATA)) {
-   flags = O_RDWR;
+   /* DENY_DOS opens are always underlying read-write on the
+  file handle, no matter what the requested access mask
+   says. */
+   if ((create_options & NTCREATEX_OPTIONS_PRIVATE_DENY_DOS) ||
+   access_mask & 
(FILE_READ_ATTRIBUTES|FILE_READ_DATA|FILE_READ_EA|FILE_EXECUTE)) {
+   flags = O_RDWR;
+   } else {
+   flags = O_WRONLY;
+   }
} else {
flags = O_RDONLY;
}
@@ -1448,11 +1455,13 @@
 
if (flags & O_RDWR) {
can_access_mask = 
FILE_READ_DATA|FILE_WRITE_DATA;
+   } else if (flags & O_WRONLY) {
+   can_access_mask = FILE_WRITE_DATA;
} else {
can_access_mask = FILE_READ_DATA;
}
 
-   if (((flags & O_RDWR) && !CAN_WRITE(conn)) ||
+   if (((can_access_mask & FILE_WRITE_DATA) && 
!CAN_WRITE(conn)) ||
!can_access_file(conn,fname,psbuf,can_access_mask)) 
{
can_access = False;
}

Modified: branches/SAMBA_3_0_24/source/smbd/open.c
===
--- branches/SAMBA_3_0_24/source/smbd/open.c2006-12-01 20:45:43 UTC (rev 
19992)
+++ branches/SAMBA_3_0_24/source/smbd/open.c2006-12-01 23:46:07 UTC (rev 
19993)
@@ -1105,7 +1105,6 @@
uint32 open_access_mask = access_mask;
NTSTATUS status;
int ret_flock;
-   
 
if (conn->printer) {
/* 
@@ -1300,7 +1299,15 @@
 */
 
if (access_mask & (FILE_WRITE_DATA | FILE_APPEND_DATA)) {
-   flags = O_RDWR;
+   /* DENY_DOS opens are always underlying read-write on the
+  file handle, no matter what the requested access mask
+   says. */
+   if ((create_options & NTCREATEX_OPTIONS_PRIVATE_DENY_DOS) ||
+   access_mask & 
(FILE_READ_ATTRIBUTES|FILE_READ_DATA|FILE_READ_EA|FILE_EXECUTE)) {
+   flags = O_RDWR;
+   } else {
+   flags = O_WRONLY;
+   }
} else {
flags = O_RDONLY;
}
@@ -1448,11 +1455,13 @@
 
if (flags & O_RDWR) {
can_access_mask = 
FILE_READ_DATA|FILE_WRITE_DATA;
+   } else if (flags & O_WRONLY) {
+   can_access_mask = FILE_WRITE_DATA;
} else {
can_access_mask = FILE_READ_DATA;
}
 
-   if (((flags & O_RDWR) && !CAN_WRITE(conn)) ||
+   if (((can_access_mask & FILE_WRITE_DATA) && 
!CAN_WRITE(conn)) ||
!can_access_file(conn,fname,psbuf,can_access_mask)) 
{
can_access = False;
}



svn commit: samba r19992 - in branches/SAMBA_3_0/source/tdb: .

2006-12-01 Thread paulg
Author: paulg
Date: 2006-12-01 20:45:43 + (Fri, 01 Dec 2006)
New Revision: 19992

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

Log:
Add support to the tdb Makefile.in for executable extensions and for
separately specifying CPPFLAGS and LDFLAGS.


Modified:
   branches/SAMBA_3_0/source/tdb/Makefile.in


Changeset:
Modified: branches/SAMBA_3_0/source/tdb/Makefile.in
===
--- branches/SAMBA_3_0/source/tdb/Makefile.in   2006-12-01 20:01:09 UTC (rev 
19991)
+++ branches/SAMBA_3_0/source/tdb/Makefile.in   2006-12-01 20:45:43 UTC (rev 
19992)
@@ -12,11 +12,17 @@
 VPATH = @srcdir@:@libreplacedir@
 srcdir = @srcdir@
 builddir = @builddir@
-CFLAGS = -I$(srcdir)/include -Iinclude -I../include [EMAIL PROTECTED]@ @CFLAGS@
+CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -Iinclude -I../include [EMAIL 
PROTECTED]@
+CFLAGS = $(CPPFLAGS) @CFLAGS@
+LDFLAGS = @LDFLAGS@
+EXEEXT = @EXEEXT@
 
 .PHONY: test
 
-PROGS = bin/tdbtool bin/tdbtorture
+PROGS = bin/tdbtool$(EXEEXT) bin/tdbtorture$(EXEEXT)
+PROGS_NOINSTALL = bin/tdbtest$(EXEEXT) bin/tdbdump$(EXEEXT) 
bin/tdbbackup$(EXEEXT)
+ALL_PROGS = $(PROGS) $(PROGS_NOINSTALL)
+
 TDB_OBJ = @TDBOBJ@
 
 DIRS = bin common tools
@@ -26,6 +32,8 @@
 showflags:
@echo 'tdb will be compiled with flags:'
@echo '  CFLAGS = $(CFLAGS)'
+   @echo '  CPPFLAGS = $(CPPFLAGS)'
+   @echo '  LDFLAGS = $(LDFLAGS)'
@echo '  LIBS = $(LIBS)'
 
 .c.o:
@@ -48,28 +56,28 @@
 libtdb.a: $(TDB_OBJ)
ar -rv libtdb.a $(TDB_OBJ)
 
-bin/tdbtest: tools/tdbtest.o libtdb.a
-   $(CC) $(CFLAGS) -o bin/tdbtest tools/tdbtest.o -L. -ltdb -lgdbm
+bin/tdbtest$(EXEEXT): tools/tdbtest.o libtdb.a
+   $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtest tools/tdbtest.o -L. -ltdb 
-lgdbm
 
-bin/tdbtool: tools/tdbtool.o libtdb.a
-   $(CC) $(CFLAGS) -o bin/tdbtool tools/tdbtool.o -L. -ltdb
+bin/tdbtool$(EXEEXT): tools/tdbtool.o libtdb.a
+   $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtool tools/tdbtool.o -L. -ltdb
 
-bin/tdbtorture: tools/tdbtorture.o libtdb.a
-   $(CC) $(CFLAGS) -o bin/tdbtorture tools/tdbtorture.o -L. -ltdb
+bin/tdbtorture$(EXEEXT): tools/tdbtorture.o libtdb.a
+   $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtorture tools/tdbtorture.o -L. 
-ltdb
 
-bin/tdbdump: tools/tdbdump.o libtdb.a
-   $(CC) $(CFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb
+bin/tdbdump$(EXEEXT): tools/tdbdump.o libtdb.a
+   $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb
 
-bin/tdbbackup: tools/tdbbackup.o libtdb.a
-   $(CC) $(CFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb
+bin/tdbbackup$(EXEEXT): tools/tdbbackup.o libtdb.a
+   $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb
 
-test: bin/tdbtorture
-   bin/tdbtorture
+test: bin/tdbtorture$(EXEEXT)
+   bin/tdbtorture$(EXEEXT)
 
 installcheck: test install
 
 clean:
-   rm -f $(PROGS) *.o *.a common/*.o tools/*.o tdb.pc
+   rm -f $(ALL_PROGS) *.o *.a common/*.o tools/*.o tdb.pc
rm -f test.db test.tdb torture.tdb test.gdbm
 
 distclean: clean



svn commit: samba r19991 - in branches/SAMBA_3_0/source: . auth include lib registry rpc_server rpcclient services smbd utils

2006-12-01 Thread vlendec
Author: vlendec
Date: 2006-12-01 20:01:09 + (Fri, 01 Dec 2006)
New Revision: 19991

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

Log:
Sorry for this 2000-liner...

The main thing here is a rewrite of srv_winreg_nt.c. The core functionality
has moved to registry/reg_api.c which is then usable by the rest of Samba as
well.

On that way it fixes creating keys with more than one element in the
path. This did not work before.

Two things that sneaked in (sorry :-) is the change of some routines from
NTSTATUS to WERROR the removed "parent" argument to regkey_open_internal.

Volker

Added:
   branches/SAMBA_3_0/source/registry/reg_api.c
Modified:
   branches/SAMBA_3_0/source/Makefile.in
   branches/SAMBA_3_0/source/auth/auth_util.c
   branches/SAMBA_3_0/source/include/reg_objects.h
   branches/SAMBA_3_0/source/lib/util_reg.c
   branches/SAMBA_3_0/source/registry/reg_frontend.c
   branches/SAMBA_3_0/source/rpc_server/srv_eventlog_nt.c
   branches/SAMBA_3_0/source/rpc_server/srv_winreg_nt.c
   branches/SAMBA_3_0/source/rpcclient/cmd_spoolss.c
   branches/SAMBA_3_0/source/services/services_db.c
   branches/SAMBA_3_0/source/smbd/service.c
   branches/SAMBA_3_0/source/utils/net_rpc_printer.c
   branches/SAMBA_3_0/source/utils/net_rpc_registry.c


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


svn commit: samba r19990 - in branches/SAMBA_3_0/source/registry: .

2006-12-01 Thread vlendec
Author: vlendec
Date: 2006-12-01 19:55:29 + (Fri, 01 Dec 2006)
New Revision: 19990

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

Log:
Fix comment
Modified:
   branches/SAMBA_3_0/source/registry/reg_objects.c


Changeset:
Modified: branches/SAMBA_3_0/source/registry/reg_objects.c
===
--- branches/SAMBA_3_0/source/registry/reg_objects.c2006-12-01 19:48:31 UTC 
(rev 19989)
+++ branches/SAMBA_3_0/source/registry/reg_objects.c2006-12-01 19:55:29 UTC 
(rev 19990)
@@ -75,7 +75,7 @@
 }
  
  /***
- Add a new key to the array
+ Delete a key from the array
  **/
 
 int regsubkey_ctr_delkey( REGSUBKEY_CTR *ctr, const char *keyname )



svn commit: samba r19989 - in branches/SAMBA_4_0/source/lib/tdb: .

2006-12-01 Thread paulg
Author: paulg
Date: 2006-12-01 19:48:31 + (Fri, 01 Dec 2006)
New Revision: 19989

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

Log:
Add support to the tdb Makefile.in for executable extensions and for
separately specifying CPPFLAGS and LDFLAGS.


Modified:
   branches/SAMBA_4_0/source/lib/tdb/Makefile.in


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/Makefile.in
===
--- branches/SAMBA_4_0/source/lib/tdb/Makefile.in   2006-12-01 18:05:09 UTC 
(rev 19988)
+++ branches/SAMBA_4_0/source/lib/tdb/Makefile.in   2006-12-01 19:48:31 UTC 
(rev 19989)
@@ -12,11 +12,17 @@
 VPATH = @srcdir@:@libreplacedir@
 srcdir = @srcdir@
 builddir = @builddir@
-CFLAGS = -I$(srcdir)/include -Iinclude [EMAIL PROTECTED]@ @CFLAGS@
+CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -Iinclude [EMAIL PROTECTED]@
+CFLAGS = $(CPPFLAGS) @CFLAGS@
+LDFLAGS = @LDFLAGS@
+EXEEXT = @EXEEXT@
 
 .PHONY: test
 
-PROGS = bin/tdbtool bin/tdbtorture
+PROGS = bin/tdbtool$(EXEEXT) bin/tdbtorture$(EXEEXT)
+PROGS_NOINSTALL = bin/tdbtest$(EXEEXT) bin/tdbdump$(EXEEXT) 
bin/tdbbackup$(EXEEXT)
+ALL_PROGS = $(PROGS) $(PROGS_NOINSTALL)
+
 TDB_OBJ = @TDBOBJ@ @LIBREPLACEOBJ@
 
 DIRS = bin common tools
@@ -26,6 +32,8 @@
 showflags:
@echo 'tdb will be compiled with flags:'
@echo '  CFLAGS = $(CFLAGS)'
+   @echo '  CPPFLAGS = $(CPPFLAGS)'
+   @echo '  LDFLAGS = $(LDFLAGS)'
@echo '  LIBS = $(LIBS)'
 
 .c.o:
@@ -48,28 +56,28 @@
 libtdb.a: $(TDB_OBJ)
ar -rv libtdb.a $(TDB_OBJ)
 
-bin/tdbtest: tools/tdbtest.o libtdb.a
-   $(CC) $(CFLAGS) -o bin/tdbtest tools/tdbtest.o -L. -ltdb -lgdbm
+bin/tdbtest$(EXEEXT): tools/tdbtest.o libtdb.a
+   $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtest tools/tdbtest.o -L. -ltdb 
-lgdbm
 
-bin/tdbtool: tools/tdbtool.o libtdb.a
-   $(CC) $(CFLAGS) -o bin/tdbtool tools/tdbtool.o -L. -ltdb
+bin/tdbtool$(EXEEXT): tools/tdbtool.o libtdb.a
+   $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtool tools/tdbtool.o -L. -ltdb
 
-bin/tdbtorture: tools/tdbtorture.o libtdb.a
-   $(CC) $(CFLAGS) -o bin/tdbtorture tools/tdbtorture.o -L. -ltdb
+bin/tdbtorture$(EXEEXT): tools/tdbtorture.o libtdb.a
+   $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtorture tools/tdbtorture.o -L. 
-ltdb
 
-bin/tdbdump: tools/tdbdump.o libtdb.a
-   $(CC) $(CFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb
+bin/tdbdump$(EXEEXT): tools/tdbdump.o libtdb.a
+   $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb
 
-bin/tdbbackup: tools/tdbbackup.o libtdb.a
-   $(CC) $(CFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb
+bin/tdbbackup$(EXEEXT): tools/tdbbackup.o libtdb.a
+   $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb
 
-test: bin/tdbtorture
-   bin/tdbtorture
+test: bin/tdbtorture$(EXEEXT)
+   bin/tdbtorture$(EXEEXT)
 
 installcheck: test install
 
 clean:
-   rm -f $(PROGS) *.o *.a common/*.o tools/*.o tdb.pc
+   rm -f $(ALL_PROGS) *.o *.a common/*.o tools/*.o tdb.pc
rm -f test.db test.tdb torture.tdb test.gdbm
 
 distclean: clean



svn commit: samba r19988 - in branches/SAMBA_4_0/source/torture/rpc: .

2006-12-01 Thread metze
Author: metze
Date: 2006-12-01 18:05:09 + (Fri, 01 Dec 2006)
New Revision: 19988

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

Log:
the first LDAP calls for becoming a ads dc

metze
Modified:
   branches/SAMBA_4_0/source/torture/rpc/testjoin.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/testjoin.c
===
--- branches/SAMBA_4_0/source/torture/rpc/testjoin.c2006-12-01 17:30:41 UTC 
(rev 19987)
+++ branches/SAMBA_4_0/source/torture/rpc/testjoin.c2006-12-01 18:05:09 UTC 
(rev 19988)
@@ -631,6 +631,100 @@
 * Open 1st LDAP connection to the DC using admin credentials
 */
 
+   /*
+* LDAP search 1st LDAP connection:
+*
+* Request:
+*  basedn: CN=Configuration,
+*  scope:  one
+*  filter: (cn=Partitions)
+*  attrs:  msDS-Behavior-Version
+* Result:
+*  CN=Partitions,CN=Configuration,
+*  msDS-Behavior-Version:  0
+*/
+
+   /*
+* LDAP search 1st LDAP connection:
+*
+* NOTE: this seems to be a bug! as the messageID of the LDAP message 
is corrupted!
+* 
+* Request:
+*  basedn: CN=Schema,CN=Configuration,
+*  scope:  one
+*  filter: (cn=Partitions)
+*  attrs:  msDS-Behavior-Version
+* Result:
+*  
+*
+*/
+
+   /*
+* LDAP search 1st LDAP connection:
+* 
+* Request:
+*  basedn: 
+*  scope:  base
+*  filter: (objectClass=*)
+*  attrs:  msDS-Behavior-Version
+* Result:
+*  
+*  msDS-Behavior-Version:  0
+*/
+
+   /*
+* LDAP search 1st LDAP connection:
+* 
+* Request:
+*  basedn: CN=Schema,CN=Configuration,
+*  scope:  base
+*  filter: (objectClass=*)
+*  attrs:  objectVersion
+* Result:
+*  CN=Schema,CN=Configuration,
+*  objectVersion:  30
+*/
+
+   /*
+* LDAP search 1st LDAP connection:
+* 
+* Request:
+*  basedn: ""
+*  scope:  base
+*  filter: (objectClass=*)
+*  attrs:  defaultNamingContext
+*  dnsHostName
+* Result:
+*  ""
+*  defaultNamingContext:   
+*  dnsHostName:
+*/
+
+   /*
+* LDAP search 1st LDAP connection:
+* 
+* Request:
+*  basedn: 

+*  scope:  base
+*  filter: (objectClass=*)
+*  attrs:  1.1
+* Result:
+*  CN=Infrastructure,
+*/
+
+   /*
+* LDAP search 1st LDAP connection:
+* 
+* Request:
+*  basedn: 
CN=Windows2003Update,CN=DomainUpdates,CN=System,
+*  scope:  base
+*  filter: (objectClass=*)
+*  attrs:  revision
+* Result:
+*  
CN=Windows2003Update,CN=DomainUpdates,CN=System,
+*  revision:   8
+*/
+
 /* ... */
 
/*



svn commit: samba r19987 - in branches/SAMBA_4_0/source/torture/rpc: .

2006-12-01 Thread metze
Author: metze
Date: 2006-12-01 17:30:41 + (Fri, 01 Dec 2006)
New Revision: 19987

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

Log:
some more notes about how to w2k3 becomes a dc

the strange thing is the DsGetNCChanges() calls are on their on DRSUAPI
connection, but use a bind_handle (policy handle from another connection)

metze
Modified:
   branches/SAMBA_4_0/source/torture/rpc/testjoin.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/testjoin.c
===
--- branches/SAMBA_4_0/source/torture/rpc/testjoin.c2006-12-01 16:37:25 UTC 
(rev 19986)
+++ branches/SAMBA_4_0/source/torture/rpc/testjoin.c2006-12-01 17:30:41 UTC 
(rev 19987)
@@ -621,28 +621,59 @@
 */
 
 /* W2K3: */
+   /*
+* lookup DC:
+* - using nbt name<1C> request and a samlogon mailslot request
+* or
+* - using a DNS SRV _ldap._tcp.dc._msdcs. request and a CLDAP netlogon 
request
+*/
+   /*
+* Open 1st LDAP connection to the DC using admin credentials
+*/
 
-   /* DsAddEntry to create the CN=NTDS 
Settings,CN=,CN=Servers,CN=Default-First-Site-Name, ...
-*
+/* ... */
+
+   /*
+* Open 1st DRSUAPI connection to the DC using admin credentials
+* DsBind with DRSUAPI_DS_BIND_GUID_W2K3 
("6afab99c-6e26-464a-975f-f58f105218bc")
+* (w2k3 does 2 DsBind() calls here..., where is first is unused and 
contains garbage at the end)
 */
 
-   /* replicate CN=Schema,CN=Configuration,...
-* using DRSUAPI_DS_BIND_GUID_W2K3 
("6afab99c-6e26-464a-975f-f58f105218bc")
-*
+   /*
+* DsAddEntry to create the CN=NTDS 
Settings,CN=,CN=Servers,CN=Default-First-Site-Name, ...
+* on the 1st DRSUAPI connection
 */
 
-   /* replicate CN=Configuration,...
-* using DRSUAPI_DS_BIND_GUID_W2K3 
("6afab99c-6e26-464a-975f-f58f105218bc")
-*
+   /*
+* Open 2nd and 3rd DRSUAPI connection to the DC using admin credentials
+* - a DsBind with DRSUAPI_DS_BIND_GUID_W2K3 
("6afab99c-6e26-464a-975f-f58f105218bc")
+*   on the 2nd connection
 */
 
-   /* W2K3: modify userAccountControl from 4096 to 532480 */
+   /*
+* replicate CN=Schema,CN=Configuration,...
+* on the 3rd DRSUAPI connection and the bind_handle from the 2nd 
connection
+*/
+
+   /*
+* replicate CN=Configuration,...
+* on the 3rd DRSUAPI connection and the bind_handle from the 2nd 
connection
+*/
+
+   /*
+* LDAP unbind in the 1st LDAP connection
+*/
+
+   /*
+* Open 2nd LDAP connection to the DC using admin credentials
+*/
+   /* ldap modify userAccountControl from 4096 to 532480 */

-   /* W2K3: modify RDN to OU=Domain Controllers and skip the $ from server 
name */
+   /* ldap modify RDN to OU=Domain Controllers and skip the $ from server 
name */
 
-   /* replicate Domain Partition
-* using DRSUAPI_DS_BIND_GUID_W2K3 
("6afab99c-6e26-464a-975f-f58f105218bc")
-*
+   /*
+* replicate Domain Partition
+* on the 3rd DRSUAPI connection and the bind_handle from the 2nd 
connection
 */
 
/* call DsReplicaUpdateRefs() for all partitions like this:
@@ -662,12 +693,21 @@
 * 0: DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE
 * 1: DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE
 * 1: DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE
-* 1: DRSUAPI_DS_REPLICA_UPDATE_0x0010  
+* 1: DRSUAPI_DS_REPLICA_UPDATE_0x0010
 *
 * 4a0df188-a0b8-47ea-bbe5-e614723f16dd is the objectGUID the 
DsAddEntry() returned for the
 * CN=NTDS 
Settings,CN=,CN=Servers,CN=Default-First-Site-Name, ...
+* on the 2nd!!! DRSUAPI connection
 */
 
+   /*
+* Windows does opens the 4th and 5th DRSUAPI connection...
+* and does a DsBind() with the objectGUID from DsAddEntry() as 
bind_guid
+* on the 4th connection
+*
+* and then 2 full replications of the domain partition on the 5th 
connection
+* with the bind_handle from the 4th connection
+*/
return join;
 }




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

2006-12-01 Thread idra
Author: idra
Date: 2006-12-01 16:37:25 + (Fri, 01 Dec 2006)
New Revision: 19986

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

Log:
ooops

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


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/sesssetup.c
===
--- branches/SAMBA_3_0/source/smbd/sesssetup.c  2006-12-01 16:14:28 UTC (rev 
19985)
+++ branches/SAMBA_3_0/source/smbd/sesssetup.c  2006-12-01 16:37:25 UTC (rev 
19986)
@@ -334,8 +334,6 @@
/* setup the string used by %U */

sub_set_smb_name( real_username );
-C_FR
-C_FREE
reload_services(True);
 
if ( map_domainuser_to_guest ) {



svn commit: samba r19985 - in branches/SAMBA_3_0_24/source/smbd: .

2006-12-01 Thread idra
Author: idra
Date: 2006-12-01 16:14:28 + (Fri, 01 Dec 2006)
New Revision: 19985

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

Log:

sync up woith 3_0


Modified:
   branches/SAMBA_3_0_24/source/smbd/sesssetup.c


Changeset:
Modified: branches/SAMBA_3_0_24/source/smbd/sesssetup.c
===
--- branches/SAMBA_3_0_24/source/smbd/sesssetup.c   2006-12-01 16:13:06 UTC 
(rev 19984)
+++ branches/SAMBA_3_0_24/source/smbd/sesssetup.c   2006-12-01 16:14:28 UTC 
(rev 19985)
@@ -302,8 +302,7 @@
DEBUG(1, ("PAM account restriction prevents user 
login\n"));
data_blob_free(&ap_rep);
data_blob_free(&session_key);
-   talloc_destroy(mem_ctx);
-   TALLOC_FREE(pw);
+   TALLOC_FREE(mem_ctx);
return ERROR_NT(nt_status_squash(ret));
}
}
@@ -327,7 +326,7 @@
SAFE_FREE(client);
data_blob_free(&ap_rep);
data_blob_free(&session_key);
-   talloc_destroy(mem_ctx);
+   TALLOC_FREE(mem_ctx);
return 
ERROR_NT(nt_status_squash(NT_STATUS_LOGON_FAILURE));
}
}
@@ -352,7 +351,6 @@
data_blob_free(&ap_rep);
data_blob_free(&session_key);
TALLOC_FREE(mem_ctx);
-   TALLOC_FREE(pw);
return ERROR_NT(nt_status_squash(ret));
}
 
@@ -366,7 +364,6 @@
data_blob_free(&ap_rep);
data_blob_free(&session_key);
TALLOC_FREE(mem_ctx);
-   TALLOC_FREE(pw);
return ERROR_NT(nt_status_squash(ret));
}
 
@@ -390,7 +387,6 @@
SAFE_FREE(client);
data_blob_free(&ap_rep);
data_blob_free(&session_key);
-   TALLOC_FREE(pw);
TALLOC_FREE( mem_ctx );
TALLOC_FREE( server_info );
return ERROR_NT(nt_status_squash(ret));
@@ -435,7 +431,6 @@
data_blob_free(&ap_rep_wrapped);
data_blob_free(&response);
TALLOC_FREE(mem_ctx);
-   TALLOC_FREE(pw);
 
return -1; /* already replied */
 }



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

2006-12-01 Thread idra
Author: idra
Date: 2006-12-01 16:13:06 + (Fri, 01 Dec 2006)
New Revision: 19984

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

Log:

Must have been drunk yesterday.
Freeing memctx is all we need, fix double free stupidity


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


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/sesssetup.c
===
--- branches/SAMBA_3_0/source/smbd/sesssetup.c  2006-12-01 15:16:37 UTC (rev 
19983)
+++ branches/SAMBA_3_0/source/smbd/sesssetup.c  2006-12-01 16:13:06 UTC (rev 
19984)
@@ -302,8 +302,7 @@
DEBUG(1, ("PAM account restriction prevents user 
login\n"));
data_blob_free(&ap_rep);
data_blob_free(&session_key);
-   talloc_destroy(mem_ctx);
-   TALLOC_FREE(pw);
+   TALLOC_FREE(mem_ctx);
return ERROR_NT(nt_status_squash(ret));
}
}
@@ -327,7 +326,7 @@
SAFE_FREE(client);
data_blob_free(&ap_rep);
data_blob_free(&session_key);
-   talloc_destroy(mem_ctx);
+   TALLOC_FREE(mem_ctx);
return 
ERROR_NT(nt_status_squash(NT_STATUS_LOGON_FAILURE));
}
}
@@ -335,6 +334,8 @@
/* setup the string used by %U */

sub_set_smb_name( real_username );
+C_FR
+C_FREE
reload_services(True);
 
if ( map_domainuser_to_guest ) {
@@ -352,7 +353,6 @@
data_blob_free(&ap_rep);
data_blob_free(&session_key);
TALLOC_FREE(mem_ctx);
-   TALLOC_FREE(pw);
return ERROR_NT(nt_status_squash(ret));
}
 
@@ -366,7 +366,6 @@
data_blob_free(&ap_rep);
data_blob_free(&session_key);
TALLOC_FREE(mem_ctx);
-   TALLOC_FREE(pw);
return ERROR_NT(nt_status_squash(ret));
}
 
@@ -390,7 +389,6 @@
SAFE_FREE(client);
data_blob_free(&ap_rep);
data_blob_free(&session_key);
-   TALLOC_FREE(pw);
TALLOC_FREE( mem_ctx );
TALLOC_FREE( server_info );
return ERROR_NT(nt_status_squash(ret));
@@ -435,7 +433,6 @@
data_blob_free(&ap_rep_wrapped);
data_blob_free(&response);
TALLOC_FREE(mem_ctx);
-   TALLOC_FREE(pw);
 
return -1; /* already replied */
 }



svn commit: samba r19983 - in branches/SAMBA_3_0_24/source: auth smbd

2006-12-01 Thread idra
Author: idra
Date: 2006-12-01 15:16:37 + (Fri, 01 Dec 2006)
New Revision: 19983

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

Log:

sync up pam and memleak patches from SAMBA_3_0


Modified:
   branches/SAMBA_3_0_24/source/auth/auth_domain.c
   branches/SAMBA_3_0_24/source/auth/auth_server.c
   branches/SAMBA_3_0_24/source/auth/auth_unix.c
   branches/SAMBA_3_0_24/source/auth/auth_util.c
   branches/SAMBA_3_0_24/source/smbd/sesssetup.c


Changeset:
Modified: branches/SAMBA_3_0_24/source/auth/auth_domain.c
===
--- branches/SAMBA_3_0_24/source/auth/auth_domain.c 2006-12-01 15:12:22 UTC 
(rev 19982)
+++ branches/SAMBA_3_0_24/source/auth/auth_domain.c 2006-12-01 15:16:37 UTC 
(rev 19983)
@@ -269,6 +269,17 @@
 
if (NT_STATUS_IS_OK(nt_status)) {
(*server_info)->was_mapped |= user_info->was_mapped;
+
+   if ( ! (*server_info)->guest) {
+   /* if a real user check pam account 
restrictions */
+   /* only really perfomed if "obey pam 
restriction" is true */
+   nt_status = 
smb_pam_accountcheck((*server_info)->unix_name);
+   if (  !NT_STATUS_IS_OK(nt_status)) {
+   DEBUG(1, ("PAM account restriction 
prevents user login\n"));
+   cli_shutdown(cli);
+   return nt_status;
+   }
+   }
}
 
netsamlogon_cache_store( user_info->smb_name, &info3 );

Modified: branches/SAMBA_3_0_24/source/auth/auth_server.c
===
--- branches/SAMBA_3_0_24/source/auth/auth_server.c 2006-12-01 15:12:22 UTC 
(rev 19982)
+++ branches/SAMBA_3_0_24/source/auth/auth_server.c 2006-12-01 15:16:37 UTC 
(rev 19983)
@@ -383,7 +383,15 @@
if ( (pass = smb_getpwnam( NULL, user_info->internal_username, 
real_username, True )) != NULL ) 
{
-   nt_status = make_server_info_pw(server_info, 
pass->pw_name, pass);
+   /* if a real user check pam account restrictions */
+   /* only really perfomed if "obey pam restriction" is 
true */
+   nt_status = smb_pam_accountcheck(pass->pw_name);
+   if (  !NT_STATUS_IS_OK(nt_status)) {
+   DEBUG(1, ("PAM account restriction prevents 
user login\n"));
+   } else {
+
+   nt_status = make_server_info_pw(server_info, 
pass->pw_name, pass);
+   }
TALLOC_FREE(pass);
}
else

Modified: branches/SAMBA_3_0_24/source/auth/auth_unix.c
===
--- branches/SAMBA_3_0_24/source/auth/auth_unix.c   2006-12-01 15:12:22 UTC 
(rev 19982)
+++ branches/SAMBA_3_0_24/source/auth/auth_unix.c   2006-12-01 15:16:37 UTC 
(rev 19983)
@@ -110,7 +110,14 @@
 
if (NT_STATUS_IS_OK(nt_status)) {
if (pass) {
-   make_server_info_pw(server_info, pass->pw_name, pass);
+   /* if a real user check pam account restrictions */
+   /* only really perfomed if "obey pam restriction" is 
true */
+   nt_status = smb_pam_accountcheck(pass->pw_name);
+   if (  !NT_STATUS_IS_OK(nt_status)) {
+   DEBUG(1, ("PAM account restriction prevents 
user login\n"));
+   } else {
+   make_server_info_pw(server_info, pass->pw_name, 
pass);
+   }
} else {
/* we need to do somthing more useful here */
nt_status = NT_STATUS_NO_SUCH_USER;

Modified: branches/SAMBA_3_0_24/source/auth/auth_util.c
===
--- branches/SAMBA_3_0_24/source/auth/auth_util.c   2006-12-01 15:12:22 UTC 
(rev 19982)
+++ branches/SAMBA_3_0_24/source/auth/auth_util.c   2006-12-01 15:16:37 UTC 
(rev 19983)
@@ -496,7 +496,7 @@

if ( token )
return token;
-   
+
if ( !(pw = sys_getpwnam( "root" )) ) {
DEBUG(0,("get_root_nt_token: getpwnam\"root\") failed!\n"));
return NULL;

Modified: branches/SAMBA_3_0_24/source/smbd/sesssetup.c
===
--- branches/SAMBA_3_0_24/source/smbd/sesssetup.c   2006-12-01 15:12:22 UTC 
(rev 19982)
+++ branches/SAMBA_3_0_24/source/smbd/sesssetup.c   2006-12-01 15:16:37 UTC 
(rev 19983)
@@ -2

svn commit: samba r19982 - in branches/SAMBA_3_0/source/lib: .

2006-12-01 Thread metze
Author: metze
Date: 2006-12-01 15:12:22 + (Fri, 01 Dec 2006)
New Revision: 19982

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

Log:
>From Michael Adam ([EMAIL PROTECTED]) (thanks!:-)

  Metze: as noted by "shattered" and discussed on the irc,
  here is a patch to lib/sysquotas_linux.c replacing some
  "get"s by "set"s. The other lib/sysquotas*.c files look
  ok to me. But in the linux variant, the problem is not
  in the actual call of quotactl but in the preparation of
  the respective "D" structs. This makes the difference
  between the get and set calls for SMB_USER_FS_QUOTA_TYPE
  and SMB_GROUP_FS_QUOTA_TYPE. 

metze
Modified:
   branches/SAMBA_3_0/source/lib/sysquotas_linux.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/sysquotas_linux.c
===
--- branches/SAMBA_3_0/source/lib/sysquotas_linux.c 2006-12-01 15:11:20 UTC 
(rev 19981)
+++ branches/SAMBA_3_0/source/lib/sysquotas_linux.c 2006-12-01 15:12:22 UTC 
(rev 19982)
@@ -526,9 +526,9 @@
case SMB_USER_FS_QUOTA_TYPE:
id.uid = getuid();
 
-   if ((ret=sys_get_linux_gen_quota(path, bdev, qtype, id, 
dp))) {
-   if ((ret=sys_get_linux_v2_quota(path, bdev, 
qtype, id, dp))) {
-   ret=sys_get_linux_v1_quota(path, bdev, 
qtype, id, dp);
+   if ((ret=sys_set_linux_gen_quota(path, bdev, qtype, id, 
dp))) {
+   if ((ret=sys_set_linux_v2_quota(path, bdev, 
qtype, id, dp))) {
+   ret=sys_set_linux_v1_quota(path, bdev, 
qtype, id, dp);
}
}
 
@@ -541,9 +541,9 @@
case SMB_GROUP_FS_QUOTA_TYPE:
id.gid = getgid();
 
-   if ((ret=sys_get_linux_gen_quota(path, bdev, qtype, id, 
dp))) {
-   if ((ret=sys_get_linux_v2_quota(path, bdev, 
qtype, id, dp))) {
-   ret=sys_get_linux_v1_quota(path, bdev, 
qtype, id, dp);
+   if ((ret=sys_set_linux_gen_quota(path, bdev, qtype, id, 
dp))) {
+   if ((ret=sys_set_linux_v2_quota(path, bdev, 
qtype, id, dp))) {
+   ret=sys_set_linux_v1_quota(path, bdev, 
qtype, id, dp);
}
}
 



svn commit: samba r19981 - in branches/SAMBA_3_0_24/source/lib: .

2006-12-01 Thread metze
Author: metze
Date: 2006-12-01 15:11:20 + (Fri, 01 Dec 2006)
New Revision: 19981

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

Log:
>From Michael Adam ([EMAIL PROTECTED])

  Metze: as noted by "shattered" and discussed on the irc,
  here is a patch to lib/sysquotas_linux.c replacing some
  "get"s by "set"s. The other lib/sysquotas*.c files look
  ok to me. But in the linux variant, the problem is not
  in the actual call of quotactl but in the preparation of
  the respective "D" structs. This makes the difference
  between the get and set calls for SMB_USER_FS_QUOTA_TYPE
  and SMB_GROUP_FS_QUOTA_TYPE. 

metze
Modified:
   branches/SAMBA_3_0_24/source/lib/sysquotas_linux.c


Changeset:
Modified: branches/SAMBA_3_0_24/source/lib/sysquotas_linux.c
===
--- branches/SAMBA_3_0_24/source/lib/sysquotas_linux.c  2006-12-01 15:06:34 UTC 
(rev 19980)
+++ branches/SAMBA_3_0_24/source/lib/sysquotas_linux.c  2006-12-01 15:11:20 UTC 
(rev 19981)
@@ -526,9 +526,9 @@
case SMB_USER_FS_QUOTA_TYPE:
id.uid = getuid();
 
-   if ((ret=sys_get_linux_gen_quota(path, bdev, qtype, id, 
dp))) {
-   if ((ret=sys_get_linux_v2_quota(path, bdev, 
qtype, id, dp))) {
-   ret=sys_get_linux_v1_quota(path, bdev, 
qtype, id, dp);
+   if ((ret=sys_set_linux_gen_quota(path, bdev, qtype, id, 
dp))) {
+   if ((ret=sys_set_linux_v2_quota(path, bdev, 
qtype, id, dp))) {
+   ret=sys_set_linux_v1_quota(path, bdev, 
qtype, id, dp);
}
}
 
@@ -541,9 +541,9 @@
case SMB_GROUP_FS_QUOTA_TYPE:
id.gid = getgid();
 
-   if ((ret=sys_get_linux_gen_quota(path, bdev, qtype, id, 
dp))) {
-   if ((ret=sys_get_linux_v2_quota(path, bdev, 
qtype, id, dp))) {
-   ret=sys_get_linux_v1_quota(path, bdev, 
qtype, id, dp);
+   if ((ret=sys_set_linux_gen_quota(path, bdev, qtype, id, 
dp))) {
+   if ((ret=sys_set_linux_v2_quota(path, bdev, 
qtype, id, dp))) {
+   ret=sys_set_linux_v1_quota(path, bdev, 
qtype, id, dp);
}
}
 



svn commit: samba r19980 - in branches/SAMBA_3_0/source: auth smbd

2006-12-01 Thread idra
Author: idra
Date: 2006-12-01 15:06:34 + (Fri, 01 Dec 2006)
New Revision: 19980

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

Log:

Implement pam account stack checks when obey pam restrictions is true.
It was missing for security=server/domain/ads 

Simo.


Modified:
   branches/SAMBA_3_0/source/auth/auth_domain.c
   branches/SAMBA_3_0/source/auth/auth_server.c
   branches/SAMBA_3_0/source/auth/auth_unix.c
   branches/SAMBA_3_0/source/auth/auth_util.c
   branches/SAMBA_3_0/source/smbd/sesssetup.c


Changeset:
Modified: branches/SAMBA_3_0/source/auth/auth_domain.c
===
--- branches/SAMBA_3_0/source/auth/auth_domain.c2006-12-01 15:04:53 UTC 
(rev 19979)
+++ branches/SAMBA_3_0/source/auth/auth_domain.c2006-12-01 15:06:34 UTC 
(rev 19980)
@@ -269,6 +269,17 @@
 
if (NT_STATUS_IS_OK(nt_status)) {
(*server_info)->was_mapped |= user_info->was_mapped;
+
+   if ( ! (*server_info)->guest) {
+   /* if a real user check pam account 
restrictions */
+   /* only really perfomed if "obey pam 
restriction" is true */
+   nt_status = 
smb_pam_accountcheck((*server_info)->unix_name);
+   if (  !NT_STATUS_IS_OK(nt_status)) {
+   DEBUG(1, ("PAM account restriction 
prevents user login\n"));
+   cli_shutdown(cli);
+   return nt_status;
+   }
+   }
}
 
netsamlogon_cache_store( user_info->smb_name, &info3 );

Modified: branches/SAMBA_3_0/source/auth/auth_server.c
===
--- branches/SAMBA_3_0/source/auth/auth_server.c2006-12-01 15:04:53 UTC 
(rev 19979)
+++ branches/SAMBA_3_0/source/auth/auth_server.c2006-12-01 15:06:34 UTC 
(rev 19980)
@@ -383,7 +383,15 @@
if ( (pass = smb_getpwnam( NULL, user_info->internal_username, 
real_username, True )) != NULL ) 
{
-   nt_status = make_server_info_pw(server_info, 
pass->pw_name, pass);
+   /* if a real user check pam account restrictions */
+   /* only really perfomed if "obey pam restriction" is 
true */
+   nt_status = smb_pam_accountcheck(pass->pw_name);
+   if (  !NT_STATUS_IS_OK(nt_status)) {
+   DEBUG(1, ("PAM account restriction prevents 
user login\n"));
+   } else {
+
+   nt_status = make_server_info_pw(server_info, 
pass->pw_name, pass);
+   }
TALLOC_FREE(pass);
}
else

Modified: branches/SAMBA_3_0/source/auth/auth_unix.c
===
--- branches/SAMBA_3_0/source/auth/auth_unix.c  2006-12-01 15:04:53 UTC (rev 
19979)
+++ branches/SAMBA_3_0/source/auth/auth_unix.c  2006-12-01 15:06:34 UTC (rev 
19980)
@@ -110,7 +110,14 @@
 
if (NT_STATUS_IS_OK(nt_status)) {
if (pass) {
-   make_server_info_pw(server_info, pass->pw_name, pass);
+   /* if a real user check pam account restrictions */
+   /* only really perfomed if "obey pam restriction" is 
true */
+   nt_status = smb_pam_accountcheck(pass->pw_name);
+   if (  !NT_STATUS_IS_OK(nt_status)) {
+   DEBUG(1, ("PAM account restriction prevents 
user login\n"));
+   } else {
+   make_server_info_pw(server_info, pass->pw_name, 
pass);
+   }
} else {
/* we need to do somthing more useful here */
nt_status = NT_STATUS_NO_SUCH_USER;

Modified: branches/SAMBA_3_0/source/auth/auth_util.c
===
--- branches/SAMBA_3_0/source/auth/auth_util.c  2006-12-01 15:04:53 UTC (rev 
19979)
+++ branches/SAMBA_3_0/source/auth/auth_util.c  2006-12-01 15:06:34 UTC (rev 
19980)
@@ -496,7 +496,7 @@

if ( token )
return token;
-   
+
if ( !(pw = sys_getpwnam( "root" )) ) {
DEBUG(0,("get_root_nt_token: getpwnam\"root\") failed!\n"));
return NULL;

Modified: branches/SAMBA_3_0/source/smbd/sesssetup.c
===
--- branches/SAMBA_3_0/source/smbd/sesssetup.c  2006-12-01 15:04:53 UTC (rev 
19979)
+++ branches/SAMBA_3_0/source/smbd/sesssetup.c  2006-12-01 15:06:34 UTC (rev 
19980)
@@ -2

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

2006-12-01 Thread idra
Author: idra
Date: 2006-12-01 15:04:53 + (Fri, 01 Dec 2006)
New Revision: 19979

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

Log:

Fix memleak on pw and change talloc_destroy to TALLOC_FREE for mem_ctx


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


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/sesssetup.c
===
--- branches/SAMBA_3_0/source/smbd/sesssetup.c  2006-12-01 14:54:31 UTC (rev 
19978)
+++ branches/SAMBA_3_0/source/smbd/sesssetup.c  2006-12-01 15:04:53 UTC (rev 
19979)
@@ -335,7 +335,8 @@
SAFE_FREE(client);
data_blob_free(&ap_rep);
data_blob_free(&session_key);
-   talloc_destroy(mem_ctx);
+   TALLOC_FREE(mem_ctx);
+   TALLOC_FREE(pw);
return ERROR_NT(nt_status_squash(ret));
}
 
@@ -348,7 +349,8 @@
SAFE_FREE(client);
data_blob_free(&ap_rep);
data_blob_free(&session_key);
-   talloc_destroy(mem_ctx);
+   TALLOC_FREE(mem_ctx);
+   TALLOC_FREE(pw);
return ERROR_NT(nt_status_squash(ret));
}
 
@@ -372,6 +374,7 @@
SAFE_FREE(client);
data_blob_free(&ap_rep);
data_blob_free(&session_key);
+   TALLOC_FREE(pw);
TALLOC_FREE( mem_ctx );
TALLOC_FREE( server_info );
return ERROR_NT(nt_status_squash(ret));
@@ -415,7 +418,8 @@
data_blob_free(&ap_rep);
data_blob_free(&ap_rep_wrapped);
data_blob_free(&response);
-   talloc_destroy(mem_ctx);
+   TALLOC_FREE(mem_ctx);
+   TALLOC_FREE(pw);
 
return -1; /* already replied */
 }



svn commit: samba r19978 - in branches: SAMBA_3_0/source/lib SAMBA_3_0/source/utils SAMBA_3_0_24/source/lib SAMBA_3_0_24/source/utils

2006-12-01 Thread vlendec
Author: vlendec
Date: 2006-12-01 14:54:31 + (Fri, 01 Dec 2006)
New Revision: 19978

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

Log:
More "net sam policy" improvements. Thanks to Karolin Seeger <[EMAIL PROTECTED]>

Volker
Modified:
   branches/SAMBA_3_0/source/lib/account_pol.c
   branches/SAMBA_3_0/source/utils/net_sam.c
   branches/SAMBA_3_0/source/utils/pdbedit.c
   branches/SAMBA_3_0_24/source/lib/account_pol.c
   branches/SAMBA_3_0_24/source/utils/net_sam.c
   branches/SAMBA_3_0_24/source/utils/pdbedit.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/account_pol.c
===
--- branches/SAMBA_3_0/source/lib/account_pol.c 2006-12-01 14:18:35 UTC (rev 
19977)
+++ branches/SAMBA_3_0/source/lib/account_pol.c 2006-12-01 14:54:31 UTC (rev 
19978)
@@ -83,28 +83,24 @@
{0, NULL, 0, "", NULL}
 };
 
-char *account_policy_names_list(void)
-{
-   char *nl, *p;
-   int i;
-   size_t len = 0;
+void account_policy_names_list(const char ***names, int *num_names)
+{  
+   const char **nl;
+   int i, count;
 
-   for (i=0; account_policy_names[i].string; i++) {
-   len += strlen(account_policy_names[i].string) + 1;
+   for (count=0; account_policy_names[count].string; count++) {
}
-   len++;
-   nl = (char *)SMB_MALLOC(len);
+   nl = SMB_MALLOC_ARRAY(const char *, count);
if (!nl) {
-   return NULL;
+   *num_names = 0;
+   return;
}
-   p = nl;
for (i=0; account_policy_names[i].string; i++) {
-   memcpy(p, account_policy_names[i].string, 
strlen(account_policy_names[i].string) + 1);
-   p[strlen(account_policy_names[i].string)] = '\n';
-   p += strlen(account_policy_names[i].string) + 1;
+   nl[i] = account_policy_names[i].string;
}
-   *p = '\0';
-   return nl;
+   *num_names = count;
+   *names = nl;
+   return;
 }
 
 /

Modified: branches/SAMBA_3_0/source/utils/net_sam.c
===
--- branches/SAMBA_3_0/source/utils/net_sam.c   2006-12-01 14:18:35 UTC (rev 
19977)
+++ branches/SAMBA_3_0/source/utils/net_sam.c   2006-12-01 14:54:31 UTC (rev 
19978)
@@ -365,38 +365,57 @@
const char *account_policy = NULL;
uint32 value, old_value;
int field;
+   char *endptr;
 
 if (argc != 2) {
-d_fprintf(stderr, "usage: net sam policy set" 
+d_fprintf(stderr, "usage: net sam policy set " 
  "\"\"  \n");
 return -1;
 }
 
-   value = strtoul(argv[1], NULL, 10);
account_policy = argv[0];
field = account_policy_name_to_fieldnum(account_policy);
+   value = strtoul(argv[1], &endptr, 10);
 
-   printf("Account policy \"%s\" description: %s\n", account_policy,
-   account_policy_get_desc(field));
+   if (field == 0) {
+   const char **names;
+int i, count;
 
+account_policy_names_list(&names, &count);
+   d_fprintf(stderr, "No account policy \"%s\"!\n\n", argv[0]);
+   d_fprintf(stderr, "Valid account policies are:\n");
+
+   for (i=0; i\"  \n");
 return -1;
 }
 
-   value = strtoul(argv[1], NULL, 10);
account_policy = argv[0];
field = account_policy_name_to_fieldnum(account_policy);
+   value = strtoul(argv[1], &endptr, 10);
 
-   printf("Account policy \"%s\" description: %s\n", account_policy,
-   account_policy_get_desc(field));
+   if (field == 0) {
+   const char **names;
+int i, count;
 
+account_policy_names_list(&names, &count);
+   d_fprintf(stderr, "No account policy \"%s\"!\n\n", argv[0]);
+   d_fprintf(stderr, "Valid account policies are:\n");
+
+   for (i=0; i

svn commit: samba r19977 - in branches: SAMBA_3_0/source/libaddns SAMBA_3_0_24/source/libaddns

2006-12-01 Thread jerry
Author: jerry
Date: 2006-12-01 14:18:35 + (Fri, 01 Dec 2006)
New Revision: 19977

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

Log:
* Fix a crash in the secure DNS update code.  Don't free 
  the host_principal memory while it is still being referenced
  by the gss code.


Modified:
   branches/SAMBA_3_0/source/libaddns/dnsgss.c
   branches/SAMBA_3_0_24/source/libaddns/dnsgss.c


Changeset:
Modified: branches/SAMBA_3_0/source/libaddns/dnsgss.c
===
--- branches/SAMBA_3_0/source/libaddns/dnsgss.c 2006-12-01 09:09:11 UTC (rev 
19976)
+++ branches/SAMBA_3_0/source/libaddns/dnsgss.c 2006-12-01 14:18:35 UTC (rev 
19977)
@@ -243,10 +243,9 @@
major = gss_import_name( &minor, &input_name,
 &nt_host_oid_desc, &targ_name );
 
-   krb5_free_principal( krb_ctx, host_principal );
-   krb5_free_context( krb_ctx );
-
if (major) {
+   krb5_free_principal( krb_ctx, host_principal );
+   krb5_free_context( krb_ctx );
err = ERROR_DNS_GSS_ERROR;
goto error;
}
@@ -254,6 +253,8 @@
err = dns_negotiate_gss_ctx_int(mem_ctx, conn, keyname, targ_name,
gss_ctx);
 
+   krb5_free_principal( krb_ctx, host_principal );
+   krb5_free_context( krb_ctx );
gss_release_name( &minor, &targ_name );
 
  error:

Modified: branches/SAMBA_3_0_24/source/libaddns/dnsgss.c
===
--- branches/SAMBA_3_0_24/source/libaddns/dnsgss.c  2006-12-01 09:09:11 UTC 
(rev 19976)
+++ branches/SAMBA_3_0_24/source/libaddns/dnsgss.c  2006-12-01 14:18:35 UTC 
(rev 19977)
@@ -243,10 +243,9 @@
major = gss_import_name( &minor, &input_name,
 &nt_host_oid_desc, &targ_name );
 
-   krb5_free_principal( krb_ctx, host_principal );
-   krb5_free_context( krb_ctx );
-
if (major) {
+   krb5_free_principal( krb_ctx, host_principal );
+   krb5_free_context( krb_ctx );
err = ERROR_DNS_GSS_ERROR;
goto error;
}
@@ -254,6 +253,8 @@
err = dns_negotiate_gss_ctx_int(mem_ctx, conn, keyname, targ_name,
gss_ctx);
 
+   krb5_free_principal( krb_ctx, host_principal );
+   krb5_free_context( krb_ctx );
gss_release_name( &minor, &targ_name );
 
  error:



svn commit: samba-docs r1002 - in trunk/smbdotconf: logon protocol

2006-12-01 Thread jht
Author: jht
Date: 2006-12-01 13:53:26 + (Fri, 01 Dec 2006)
New Revision: 1002

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

Log:
More cleanups to be done.
Modified:
   trunk/smbdotconf/logon/abortshutdownscript.xml
   trunk/smbdotconf/logon/addgroupscript.xml
   trunk/smbdotconf/logon/addmachinescript.xml
   trunk/smbdotconf/protocol/aclmapfullcontrol.xml


Changeset:
Modified: trunk/smbdotconf/logon/abortshutdownscript.xml
===
--- trunk/smbdotconf/logon/abortshutdownscript.xml  2006-11-28 22:33:45 UTC 
(rev 1001)
+++ trunk/smbdotconf/logon/abortshutdownscript.xml  2006-12-01 13:53:26 UTC 
(rev 1002)
@@ -11,6 +11,6 @@
If the connected user posseses the 
SeRemoteShutdownPrivilege,
right, this command will be run as user.
 
-
+
 /sbin/shutdown -c
 

Modified: trunk/smbdotconf/logon/addgroupscript.xml
===
--- trunk/smbdotconf/logon/addgroupscript.xml   2006-11-28 22:33:45 UTC (rev 
1001)
+++ trunk/smbdotconf/logon/addgroupscript.xml   2006-12-01 13:53:26 UTC (rev 
1002)
@@ -1,18 +1,19 @@
 http://www.samba.org/samba/DTD/samba-doc";>
+   context="G"
+   type="string"
+   advanced="1" developer="1"
+   xmlns:samba="http://www.samba.org/samba/DTD/samba-doc";>
 
-   This is the full pathname to a script that will be run
-   AS ROOT by 
-   
smbd8
-   when a new group is requested. It will expand any %g to the group name passed. This
-   script is only useful for installations using the Windows NT
-   domain administration tools. The script is free to create a
-   group with an arbitrary name to circumvent unix group name
-   restrictions. In that case the script must print the numeric gid
-   of the created group on stdout.
+   
+   This is the full pathname to a script that will be run AS 
ROOT by 
+   
smbd8 when 
a new group is requested. It
+   will expand any %g to the group 
name passed. This script is only useful
+   for installations using the Windows NT domain administration tools. The 
script is free to create a group with
+   an arbitrary name to circumvent unix group name restrictions. In that 
case the script must print the numeric
+   gid of the created group on stdout.
+   
 
+
+
+/usr/sbin/groupadd %g
 

Modified: trunk/smbdotconf/logon/addmachinescript.xml
===
--- trunk/smbdotconf/logon/addmachinescript.xml 2006-11-28 22:33:45 UTC (rev 
1001)
+++ trunk/smbdotconf/logon/addmachinescript.xml 2006-12-01 13:53:26 UTC (rev 
1002)
@@ -4,11 +4,12 @@
  advanced="1" developer="1"
  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc";>
 
-   This is the full pathname to a script that will  be run by
-   smbd
-   8 when a machine is added
-   to Samba's domain and a Unix account matching the machine's name
-   appended with a "$" does not already exist. 
+   
+   This is the full pathname to a script that will  be run by
+   smbd 
8 when a machine is
+   added to Samba's domain and a Unix account matching the machine's name 
appended with a "$" does not
+   already exist.
+   
 
 
 

Modified: trunk/smbdotconf/protocol/aclmapfullcontrol.xml
===
--- trunk/smbdotconf/protocol/aclmapfullcontrol.xml 2006-11-28 22:33:45 UTC 
(rev 1001)
+++ trunk/smbdotconf/protocol/aclmapfullcontrol.xml 2006-12-01 13:53:26 UTC 
(rev 1002)
@@ -1,16 +1,17 @@
 http://www.samba.org/samba/DTD/samba-doc";>
+   context="S"
+   type="boolean"
+   advanced="1" wizard="1"
+   xmlns:samba="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.
-
+
+   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
 



Rev 27: merge from ab in http://samba.org/~tridge/ctdb/

2006-12-01 Thread tridge

revno: 27
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: ctdb
timestamp: Fri 2006-12-01 21:16:32 +1100
message:
  merge from ab
modified:
  common/ctdb_call.c ctdb_call.c-20061128065342-to93h6eejj5kon81-1
  include/ctdb_private.h 
ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13

revno: 12.1.10
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Alexander Bokovoy <[EMAIL PROTECTED]>
branch nick: ctdb
timestamp: Fri 2006-12-01 12:26:21 +0300
message:
  Provide an alternative CTDB_NO_MEMORY_NULL() for functions which return a 
pointer

revno: 12.1.9
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Alexander Bokovoy <[EMAIL PROTECTED]>
branch nick: ctdb
timestamp: Fri 2006-12-01 12:10:18 +0300
message:
  Merge from tridge
=== modified file 'common/ctdb_call.c'
--- a/common/ctdb_call.c2006-12-01 04:45:24 +
+++ b/common/ctdb_call.c2006-12-01 09:26:21 +
@@ -186,7 +186,7 @@
int ret;
 
state = talloc_zero(ctdb, struct ctdb_call_state);
-   CTDB_NO_MEMORY(ctdb, state);
+   CTDB_NO_MEMORY_NULL(ctdb, state);
 
state->state = CTDB_CALL_DONE;
state->node = ctdb->nodes[ctdb->vnn];
@@ -213,11 +213,11 @@
}
 
state = talloc_zero(ctdb, struct ctdb_call_state);
-   CTDB_NO_MEMORY(ctdb, state);
+   CTDB_NO_MEMORY_NULL(ctdb, state);
 
len = sizeof(*state->c) + key.dsize + (call_data?call_data->dsize:0);
state->c = talloc_size(ctdb, len);
-   CTDB_NO_MEMORY(ctdb, state->c);
+   CTDB_NO_MEMORY_NULL(ctdb, state->c);
 
state->c->hdr.length= len;
state->c->hdr.operation = CTDB_REQ_CALL;

=== modified file 'include/ctdb_private.h'
--- a/include/ctdb_private.h2006-12-01 04:45:24 +
+++ b/include/ctdb_private.h2006-12-01 09:26:21 +
@@ -94,6 +94,10 @@
   ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
  return -1; }} while (0)
 
+#define CTDB_NO_MEMORY_NULL(ctdb, p) do { if (!(p)) { \
+  ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
+ return NULL; }} while (0)
+
 /* arbitrary maximum timeout for ctdb operations */
 #define CTDB_REQ_TIMEOUT 10
 



svn commit: samba r19976 - in branches/SAMBA_3_0_24/source/utils: .

2006-12-01 Thread vlendec
Author: vlendec
Date: 2006-12-01 09:09:11 + (Fri, 01 Dec 2006)
New Revision: 19976

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

Log:
merge r19840 from 3_0
Modified:
   branches/SAMBA_3_0_24/source/utils/net_sam.c


Changeset:
Modified: branches/SAMBA_3_0_24/source/utils/net_sam.c
===
--- branches/SAMBA_3_0_24/source/utils/net_sam.c2006-12-01 01:58:43 UTC 
(rev 19975)
+++ branches/SAMBA_3_0_24/source/utils/net_sam.c2006-12-01 09:09:11 UTC 
(rev 19976)
@@ -378,6 +378,13 @@
 
printf("Account policy \"%s\" description: %s\n", account_policy,
account_policy_get_desc(field));
+
+   if (!pdb_get_account_policy(field, &old_value)) {
+fprintf(stderr, "Valid account policy, but unable to "
+"fetch value!\n");
+return -1;
+}
+   
 printf("Account policy \"%s\" value was: %d\n", account_policy,
old_value);