Rev 50: simplified ctdb_call() interface, and made it easier to expand with more parameters later in http://samba.org/~tridge/ctdb

2007-01-24 Thread tridge

revno: 50
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Thu 2007-01-25 16:13:17 +1100
message:
  simplified ctdb_call() interface, and made it easier to expand with more 
parameters later
modified:
  common/ctdb_call.c ctdb_call.c-20061128065342-to93h6eejj5kon81-1
  ctdb_bench.c   ctdb_bench.c-20061219052637-2liagoglohxb6p7s-1
  ctdb_test.cctdb_test.c-20061117234101-o3qt14umlg9en8z0-16
  include/ctdb.h ctdb.h-20061117234101-o3qt14umlg9en8z0-11

Diff too large for email (456, the limit is 200).


svn commit: linux-cifs-client r93 - in branches: linux-2.6-cifs-git-devel/fs/cifs linux-2.6-mainline/fs/cifs

2007-01-24 Thread sfrench
Author: sfrench
Date: 2007-01-25 05:04:14 + (Thu, 25 Jan 2007)
New Revision: 93

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=linux-cifs-client&rev=93

Log:
merge cifs 1.47 from mainline from cifs to svn

Modified:
   branches/linux-2.6-cifs-git-devel/fs/cifs/CHANGES
   branches/linux-2.6-cifs-git-devel/fs/cifs/README
   branches/linux-2.6-cifs-git-devel/fs/cifs/cifs_debug.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/cifsencrypt.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/cifsfs.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/cifsfs.h
   branches/linux-2.6-cifs-git-devel/fs/cifs/cifspdu.h
   branches/linux-2.6-cifs-git-devel/fs/cifs/cifsproto.h
   branches/linux-2.6-cifs-git-devel/fs/cifs/cifssmb.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/connect.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/fcntl.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/file.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/inode.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/ioctl.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/link.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/misc.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/netmisc.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/readdir.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/sess.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/transport.c
   branches/linux-2.6-mainline/fs/cifs/CHANGES
   branches/linux-2.6-mainline/fs/cifs/README
   branches/linux-2.6-mainline/fs/cifs/cifs_debug.c
   branches/linux-2.6-mainline/fs/cifs/cifsencrypt.c
   branches/linux-2.6-mainline/fs/cifs/cifsfs.c
   branches/linux-2.6-mainline/fs/cifs/cifsfs.h
   branches/linux-2.6-mainline/fs/cifs/cifsglob.h
   branches/linux-2.6-mainline/fs/cifs/cifspdu.h
   branches/linux-2.6-mainline/fs/cifs/cifsproto.h
   branches/linux-2.6-mainline/fs/cifs/cifssmb.c
   branches/linux-2.6-mainline/fs/cifs/connect.c
   branches/linux-2.6-mainline/fs/cifs/fcntl.c
   branches/linux-2.6-mainline/fs/cifs/file.c
   branches/linux-2.6-mainline/fs/cifs/inode.c
   branches/linux-2.6-mainline/fs/cifs/ioctl.c
   branches/linux-2.6-mainline/fs/cifs/link.c
   branches/linux-2.6-mainline/fs/cifs/misc.c
   branches/linux-2.6-mainline/fs/cifs/netmisc.c
   branches/linux-2.6-mainline/fs/cifs/readdir.c
   branches/linux-2.6-mainline/fs/cifs/transport.c


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


Rev 48: merge db wrap code from samba4 in http://samba.org/~tridge/ctdb

2007-01-24 Thread tridge

revno: 48
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Thu 2007-01-25 15:11:36 +1100
message:
  merge db wrap code from samba4
added:
  lib/util/db_wrap.c db_wrap.c-20070125041102-mfc39bu6uof09lw6-1
  lib/util/db_wrap.h db_wrap.h-20070125041102-mfc39bu6uof09lw6-2
=== added file 'lib/util/db_wrap.c'
--- a/lib/util/db_wrap.c1970-01-01 00:00:00 +
+++ b/lib/util/db_wrap.c2007-01-25 04:11:36 +
@@ -0,0 +1,83 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   database wrap functions
+
+   Copyright (C) Andrew Tridgell 2004
+   
+   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.
+*/
+
+/*
+  the stupidity of the unix fcntl locking design forces us to never
+  allow a database file to be opened twice in the same process. These
+  wrappers provide convenient access to a tdb or ldb, taking advantage
+  of talloc destructors to ensure that only a single open is done
+*/
+
+#include "includes.h"
+#include "lib/util/dlinklist.h"
+#include "lib/events/events.h"
+#include "lib/tdb/include/tdb.h"
+#include "db_wrap.h"
+
+static struct tdb_wrap *tdb_list;
+
+
+
+/* destroy the last connection to a tdb */
+static int tdb_wrap_destructor(struct tdb_wrap *w)
+{
+   tdb_close(w->tdb);
+   DLIST_REMOVE(tdb_list, w);
+   return 0;
+}   
+
+/*
+  wrapped connection to a tdb database
+  to close just talloc_free() the tdb_wrap pointer
+ */
+struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx,
+  const char *name, int hash_size, int tdb_flags,
+  int open_flags, mode_t mode)
+{
+   struct tdb_wrap *w;
+
+   for (w=tdb_list;w;w=w->next) {
+   if (strcmp(name, w->name) == 0) {
+   return talloc_reference(mem_ctx, w);
+   }
+   }
+
+   w = talloc(mem_ctx, struct tdb_wrap);
+   if (w == NULL) {
+   return NULL;
+   }
+
+   w->name = talloc_strdup(w, name);
+
+   w->tdb = tdb_open(name, hash_size, tdb_flags, 
+ open_flags, mode);
+   if (w->tdb == NULL) {
+   talloc_free(w);
+   return NULL;
+   }
+
+   talloc_set_destructor(w, tdb_wrap_destructor);
+
+   DLIST_ADD(tdb_list, w);
+
+   return w;
+}

=== added file 'lib/util/db_wrap.h'
--- a/lib/util/db_wrap.h1970-01-01 00:00:00 +
+++ b/lib/util/db_wrap.h2007-01-25 04:11:36 +
@@ -0,0 +1,33 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   database wrap headers
+
+   Copyright (C) Andrew Tridgell 2004
+   
+   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.
+*/
+
+
+struct tdb_wrap {
+   struct tdb_context *tdb;
+
+   const char *name;
+   struct tdb_wrap *next, *prev;
+};
+
+struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx,
+  const char *name, int hash_size, int tdb_flags,
+  int open_flags, mode_t mode);



Rev 49: use ctdb_call_info, so struct ctdb_call can be used for top level call in http://samba.org/~tridge/ctdb

2007-01-24 Thread tridge

revno: 49
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Thu 2007-01-25 15:19:16 +1100
message:
  use ctdb_call_info, so struct ctdb_call can be used for top level call
modified:
  common/ctdb_call.c ctdb_call.c-20061128065342-to93h6eejj5kon81-1
  ctdb_bench.c   ctdb_bench.c-20061219052637-2liagoglohxb6p7s-1
  ctdb_test.cctdb_test.c-20061117234101-o3qt14umlg9en8z0-16
  include/ctdb.h ctdb.h-20061117234101-o3qt14umlg9en8z0-11
=== modified file 'common/ctdb_call.c'
--- a/common/ctdb_call.c2007-01-23 00:38:45 +
+++ b/common/ctdb_call.c2007-01-25 04:19:16 +
@@ -49,10 +49,10 @@
   int call_id, TDB_DATA *call_data, TDB_DATA 
*reply_data,
   uint32_t caller)
 {
-   struct ctdb_call *c;
+   struct ctdb_call_info *c;
struct ctdb_registered_call *fn;
 
-   c = talloc(ctdb, struct ctdb_call);
+   c = talloc(ctdb, struct ctdb_call_info);
CTDB_NO_MEMORY(ctdb, c);
 
c->key = key;

=== modified file 'ctdb_bench.c'
--- a/ctdb_bench.c  2006-12-19 05:27:03 +
+++ b/ctdb_bench.c  2007-01-25 04:19:16 +
@@ -50,7 +50,7 @@
 /*
   ctdb call function to increment an integer
 */
-static int incr_func(struct ctdb_call *call)
+static int incr_func(struct ctdb_call_info *call)
 {
if (call->record_data.dsize == 0) {
call->new_data = talloc(call, TDB_DATA);
@@ -70,7 +70,7 @@
 /*
   ctdb call function to fetch a record
 */
-static int fetch_func(struct ctdb_call *call)
+static int fetch_func(struct ctdb_call_info *call)
 {
call->reply_data = &call->record_data;
return 0;

=== modified file 'ctdb_test.c'
--- a/ctdb_test.c   2006-12-01 04:45:24 +
+++ b/ctdb_test.c   2007-01-25 04:19:16 +
@@ -33,7 +33,7 @@
 /*
   add an integer into a record in sorted order
 */
-static int sort_func(struct ctdb_call *call)
+static int sort_func(struct ctdb_call_info *call)
 {
if (call->call_data == NULL ||
call->call_data->dsize != sizeof(int)) {
@@ -64,7 +64,7 @@
 /*
   ctdb call function to fetch a record
 */
-static int fetch_func(struct ctdb_call *call)
+static int fetch_func(struct ctdb_call_info *call)
 {
call->reply_data = &call->record_data;
return 0;

=== modified file 'include/ctdb.h'
--- a/include/ctdb.h2007-01-23 00:38:45 +
+++ b/include/ctdb.h2007-01-25 04:19:16 +
@@ -24,7 +24,7 @@
 /*
   structure passed to a ctdb call function
 */
-struct ctdb_call {
+struct ctdb_call_info {
TDB_DATA key;  /* record key */
TDB_DATA record_data;  /* current data in the record */
TDB_DATA *new_data;/* optionally updated record data */
@@ -85,7 +85,7 @@
 const char *ctdb_errstr(struct ctdb_context *);
 
 /* a ctdb call function */
-typedef int (*ctdb_fn_t)(struct ctdb_call *);
+typedef int (*ctdb_fn_t)(struct ctdb_call_info *);
 
 /*
   setup a ctdb call function



Rev 47: added copies of libs so can be built standalone in http://samba.org/~tridge/ctdb

2007-01-24 Thread tridge


svn commit: samba r21015 - in branches/SAMBA_3_0/source/nsswitch: .

2007-01-24 Thread jerry
Author: jerry
Date: 2007-01-25 02:36:20 + (Thu, 25 Jan 2007)
New Revision: 21015

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

Log:
fix typo that breaks the build
Modified:
   branches/SAMBA_3_0/source/nsswitch/pam_winbind.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
===
--- branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-01-25 02:28:00 UTC 
(rev 21014)
+++ branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-01-25 02:36:20 UTC 
(rev 21015)
@@ -1406,7 +1406,7 @@
 
_PAM_LOG_FUNCTION_ENTER("pam_sm_setcred", pamh, ctrl, flags);
 
-   switch (flag) {
+   switch (flags) {
 
case PAM_DELETE_CRED:
ret = pam_sm_close_session(pamh, flags, argc, argv);



svn commit: samba r21014 - in branches/SAMBA_3_0/source/nsswitch: .

2007-01-24 Thread jerry
Author: jerry
Date: 2007-01-25 02:28:00 + (Thu, 25 Jan 2007)
New Revision: 21014

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

Log:
move some functionss to winbindd_group.c and make static
Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_group.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_passdb.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_group.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_group.c 2007-01-25 02:24:56 UTC 
(rev 21013)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_group.c 2007-01-25 02:28:00 UTC 
(rev 21014)
@@ -31,10 +31,151 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
 
-/***
- Empty static struct for negative caching.
-/
+static void add_member(const char *domain, const char *user,
+  char **pp_members, size_t *p_num_members)
+{
+   fstring name;
 
+   fill_domain_username(name, domain, user, True);
+   safe_strcat(name, ",", sizeof(name)-1);
+   string_append(pp_members, name);
+   *p_num_members += 1;
+}
+
+/**
+ Add member users resulting from sid. Expand if it is a domain group.
+**/
+
+static void add_expanded_sid(const DOM_SID *sid, char **pp_members, size_t 
*p_num_members)
+{
+   DOM_SID dom_sid;
+   uint32 rid;
+   struct winbindd_domain *domain;
+   size_t i;
+
+   char *domain_name = NULL;
+   char *name = NULL;
+   enum lsa_SidType type;
+
+   uint32 num_names;
+   DOM_SID *sid_mem;
+   char **names;
+   uint32 *types;
+
+   NTSTATUS result;
+
+   TALLOC_CTX *mem_ctx = talloc_init("add_expanded_sid");
+
+   if (mem_ctx == NULL) {
+   DEBUG(1, ("talloc_init failed\n"));
+   return;
+   }
+
+   sid_copy(&dom_sid, sid);
+   sid_split_rid(&dom_sid, &rid);
+
+   domain = find_lookup_domain_from_sid(sid);
+
+   if (domain == NULL) {
+   DEBUG(3, ("Could not find domain for sid %s\n",
+ sid_string_static(sid)));
+   goto done;
+   }
+
+   result = domain->methods->sid_to_name(domain, mem_ctx, sid,
+ &domain_name, &name, &type);
+
+   if (!NT_STATUS_IS_OK(result)) {
+   DEBUG(3, ("sid_to_name failed for sid %s\n",
+ sid_string_static(sid)));
+   goto done;
+   }
+
+   DEBUG(10, ("Found name %s, type %d\n", name, type));
+
+   if (type == SID_NAME_USER) {
+   add_member(domain_name, name, pp_members, p_num_members);
+   goto done;
+   }
+
+   if (type != SID_NAME_DOM_GRP) {
+   DEBUG(10, ("Alias member %s neither user nor group, ignore\n",
+  name));
+   goto done;
+   }
+
+   /* Expand the domain group, this must be done via the target domain */
+
+   domain = find_domain_from_sid(sid);
+
+   if (domain == NULL) {
+   DEBUG(3, ("Could not find domain from SID %s\n",
+ sid_string_static(sid)));
+   goto done;
+   }
+
+   result = domain->methods->lookup_groupmem(domain, mem_ctx,
+ sid, &num_names,
+ &sid_mem, &names,
+ &types);
+
+   if (!NT_STATUS_IS_OK(result)) {
+   DEBUG(10, ("Could not lookup group members for %s: %s\n",
+  name, nt_errstr(result)));
+   goto done;
+   }
+
+   for (i=0; iname, names[i], pp_members, p_num_members);
+   }
+
+ done:
+   talloc_destroy(mem_ctx);
+   return;
+}
+
+static BOOL fill_passdb_alias_grmem(struct winbindd_domain *domain,
+DOM_SID *group_sid, 
+size_t *num_gr_mem, char **gr_mem, size_t 
*gr_mem_len)
+{
+   DOM_SID *members;
+   size_t i, num_members;
+
+   *num_gr_mem = 0;
+   *gr_mem = NULL;
+   *gr_mem_len = 0;
+
+   if (!NT_STATUS_IS_OK(pdb_enum_aliasmem(group_sid, &members,
+  &num_members)))
+   return True;
+
+   for (i=0; imethods->sid_to_name(domain, mem_ctx, sid,
- &domain_name, &name, &type);
-
-   if (!NT_STATUS_IS_OK(result)) {
-   DEBUG(3, ("sid_to_name failed for sid %s\n",
- sid_string_static(sid)));
-   goto done;
-   }
-
-   DEBUG(10, ("Found name %s, type %d\n", name, type));
-
-   if (type == SID_NAME_USER) {
- 

svn commit: samba r21013 - in branches/SAMBA_3_0/source/nsswitch: .

2007-01-24 Thread jerry
Author: jerry
Date: 2007-01-25 02:24:56 + (Thu, 25 Jan 2007)
New Revision: 21013

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

Log:
* Remove "inline" keyword 
* Remove anpther check for PAM_SILENT that prevents logging to syslog
* Add missing check for TRY_FIRST_PASS when using authtok (missed 
  from previous merge)


Modified:
   branches/SAMBA_3_0/source/nsswitch/pam_winbind.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
===
--- branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-01-25 01:56:34 UTC 
(rev 21012)
+++ branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-01-25 02:24:56 UTC 
(rev 21013)
@@ -73,7 +73,7 @@
 }
 #endif /* HAVE_PAM_VSYSLOG */
 
-static inline int _pam_log_is_silent(int ctrl)
+static int _pam_log_is_silent(int ctrl)
 {
return (ctrl & WINBIND_SILENT) ? 1 : 0;
 }
@@ -91,7 +91,7 @@
va_end(args);
 }
 
-static inline int _pam_log_is_debug_enabled(int ctrl)
+static int _pam_log_is_debug_enabled(int ctrl)
 {
if (ctrl == -1) {
return 0;
@@ -108,7 +108,7 @@
return 1;
 }
 
-static inline int _pam_log_is_debug_state_enabled(int ctrl)
+static int _pam_log_is_debug_state_enabled(int ctrl)
 {
if (!(ctrl & WINBIND_DEBUG_STATE)) {
return 0;
@@ -1406,7 +1406,7 @@
 
_PAM_LOG_FUNCTION_ENTER("pam_sm_setcred", pamh, ctrl, flags);
 
-   switch (flags & ~PAM_SILENT) {
+   switch (flag) {
 
case PAM_DELETE_CRED:
ret = pam_sm_close_session(pamh, flags, argc, argv);
@@ -1794,7 +1794,7 @@
goto out;
}

-   lctrl = ctrl;
+   lctrl = ctrl & ~WINBIND_TRY_FIRST_PASS_ARG;

if (on(WINBIND_USE_AUTHTOK_ARG, lctrl)) {
lctrl |= WINBIND_USE_FIRST_PASS_ARG;



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

2007-01-24 Thread Jeremy Allison
On Thu, Jan 25, 2007 at 01:56:36AM +, [EMAIL PROTECTED] wrote:
> Author: jerry
> Date: 2007-01-25 01:56:34 + (Thu, 25 Jan 2007)
> New Revision: 21012
> 
> WebSVN: 
> http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21012
> 
> Log:
> Patch from Danilo Almeida @ Centeris (via me):
> 
> Details: Improve PAM logging
> - The improved logging is far tracking down PAM-related bugs
> - PAM_SILENT was being mis-used to suppress syslog output instead of
>   suppressing user output.  This lets PAM_SILENT still log to syslog.
> - Allow logging of item & data state via debug_state config file option.
> - Logging tracks the pam handle used.

I don't think all our platforms support "inline" (and it's not a
C construct). I remember shouting at James Peach for doing the
same thing :-).

Jeremy.


svn commit: samba r21012 - in branches/SAMBA_3_0/source/nsswitch: .

2007-01-24 Thread jerry
Author: jerry
Date: 2007-01-25 01:56:34 + (Thu, 25 Jan 2007)
New Revision: 21012

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

Log:
Patch from Danilo Almeida @ Centeris (via me):

Details: Improve PAM logging
- The improved logging is far tracking down PAM-related bugs
- PAM_SILENT was being mis-used to suppress syslog output instead of
  suppressing user output.  This lets PAM_SILENT still log to syslog.
- Allow logging of item & data state via debug_state config file option.
- Logging tracks the pam handle used.



Modified:
   branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
   branches/SAMBA_3_0/source/nsswitch/pam_winbind.h


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
===
--- branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-01-25 01:18:31 UTC 
(rev 21011)
+++ branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-01-25 01:56:34 UTC 
(rev 21012)
@@ -12,6 +12,18 @@
 
 #include "pam_winbind.h"
 
+#define _PAM_LOG_FUNCTION_ENTER(function, pamh, ctrl, flags) \
+   do { \
+   _pam_log_debug(pamh, ctrl, LOG_DEBUG, "[pamh: 0x%08x] ENTER: " 
function " (flags: 0x%04x)", (uint32) pamh, flags); \
+   _pam_log_state(pamh, ctrl); \
+   } while (0)
+
+#define _PAM_LOG_FUNCTION_LEAVE(function, pamh, ctrl, retval) \
+   do { \
+   _pam_log_debug(pamh, ctrl, LOG_DEBUG, "[pamh: 0x%08x] LEAVE: " 
function " returning %d", (uint32) pamh, retval); \
+   _pam_log_state(pamh, ctrl); \
+   } while (0)
+
 /* data tokens */
 
 #define MAX_PASSWD_TRIES   3
@@ -61,11 +73,16 @@
 }
 #endif /* HAVE_PAM_VSYSLOG */
 
+static inline int _pam_log_is_silent(int ctrl)
+{
+   return (ctrl & WINBIND_SILENT) ? 1 : 0;
+}
+
 static void _pam_log(const pam_handle_t *pamh, int ctrl, int err, const char 
*format, ...)
 {
va_list args;
 
-   if (ctrl & WINBIND_SILENT) {
+   if (_pam_log_is_silent(ctrl)) {
return;
}
 
@@ -74,15 +91,37 @@
va_end(args);
 }
 
-static void _pam_log_debug(const pam_handle_t *pamh, int ctrl, int err, const 
char *format, ...)
+static inline int _pam_log_is_debug_enabled(int ctrl)
 {
-   va_list args;
+   if (ctrl == -1) {
+   return 0;
+   }
 
-   if (ctrl & WINBIND_SILENT) {
-   return;
+   if (_pam_log_is_silent(ctrl)) {
+   return 0;
}
 
if (!(ctrl & WINBIND_DEBUG_ARG)) {
+   return 0;
+   }
+
+   return 1;
+}
+
+static inline int _pam_log_is_debug_state_enabled(int ctrl)
+{
+   if (!(ctrl & WINBIND_DEBUG_STATE)) {
+   return 0;
+   }
+
+   return _pam_log_is_debug_enabled(ctrl);
+}
+
+static void _pam_log_debug(const pam_handle_t *pamh, int ctrl, int err, const 
char *format, ...)
+{
+   va_list args;
+
+   if (!_pam_log_is_debug_enabled(ctrl)) {
return;
}
 
@@ -91,6 +130,74 @@
va_end(args);
 }
 
+static void _pam_log_state_datum(const pam_handle_t *pamh, int ctrl, int 
item_type, const char *key, int is_string)
+{
+   const void *data = NULL;
+   if (item_type != 0) {
+   pam_get_item(pamh, item_type, &data);
+   } else {
+   pam_get_data(pamh, key, &data);
+   }
+   if (data != NULL) {
+   const char *type = (item_type != 0) ? "ITEM" : "DATA";
+   if (is_string != 0) {
+   _pam_log_debug(pamh, ctrl, LOG_DEBUG, "[pamh: 0x%08x] 
STATE: %s(%s) = \"%s\" (0x%08x)", (uint32) pamh, type, key, (const char *) 
data, (uint32) data);
+   } else {
+   _pam_log_debug(pamh, ctrl, LOG_DEBUG, "[pamh: 0x%08x] 
STATE: %s(%s) = 0x%08x", (uint32) pamh, type, key, (uint32) data);
+   }
+   }
+}
+
+#define _PAM_LOG_STATE_DATA_POINTER(pamh, ctrl, module_data_name) \
+   _pam_log_state_datum(pamh, ctrl, 0, module_data_name, 0)
+
+#define _PAM_LOG_STATE_DATA_STRING(pamh, ctrl, module_data_name) \
+   _pam_log_state_datum(pamh, ctrl, 0, module_data_name, 1)
+
+#define _PAM_LOG_STATE_ITEM_POINTER(pamh, ctrl, item_type) \
+   _pam_log_state_datum(pamh, ctrl, item_type, #item_type, 0)
+
+#define _PAM_LOG_STATE_ITEM_STRING(pamh, ctrl, item_type) \
+   _pam_log_state_datum(pamh, ctrl, item_type, #item_type, 1)
+
+#ifdef DEBUG_PASSWORD
+#define _LOG_PASSWORD_AS_STRING 1
+#else
+#define _LOG_PASSWORD_AS_STRING 0
+#endif
+
+#define _PAM_LOG_STATE_ITEM_PASSWORD(pamh, ctrl, item_type) \
+   _pam_log_state_datum(pamh, ctrl, item_type, #item_type, 
_LOG_PASSWORD_AS_STRING)
+
+static void _pam_log_state(const pam_handle_t *pamh, int ctrl)
+{
+   if (!_pam_log_is_debug_state_enabled(ctrl)) {
+   return;
+   }
+
+   _PAM_LOG_STATE_ITEM_STRING(pamh, ctrl, PAM_SERVICE);
+   _PAM_LOG_STATE_ITEM_STRING(pamh, ctrl, PAM_USER);
+   _PAM_LOG_STATE_ITEM_STRING(pamh, 

svn commit: samba r21011 - in branches/SAMBA_3_0/source/nsswitch: .

2007-01-24 Thread jerry
Author: jerry
Date: 2007-01-25 01:18:31 + (Thu, 25 Jan 2007)
New Revision: 21011

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

Log:
Another patch from Danilo Almeida @ Centeris (via me):

Details: Reset the "new password prompt required" state whenever
we do a new auth.  In more detail, in pam_sm_authenticate, if not
settting PAM_WINBIND_NEW_AUTHTOK_REQD, then clean any potentially
present PAM_WINBIND_NEW_AUTHTOK_REQD.


Modified:
   branches/SAMBA_3_0/source/nsswitch/pam_winbind.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
===
--- branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-01-25 00:50:36 UTC 
(rev 21010)
+++ branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-01-25 01:18:31 UTC 
(rev 21011)
@@ -1179,6 +1179,7 @@
int retval = PAM_AUTH_ERR;
dictionary *d = NULL;
char *username_ret = NULL;
+   char *new_authtok_required = NULL;
 
/* parse arguments */
int ctrl = _pam_parse(pamh, flags, argc, argv, &d);
@@ -1227,14 +1228,12 @@
if (retval == PAM_NEW_AUTHTOK_REQD ||
retval == PAM_AUTHTOK_EXPIRED) {
 
-   char *buf;
-
-   if (!asprintf(&buf, "%d", retval)) {
+   if (!asprintf(&new_authtok_required, "%d", retval)) {
retval = PAM_BUF_ERR;
goto out;
}
 
-   pam_set_data( pamh, PAM_WINBIND_NEW_AUTHTOK_REQD, (void *)buf, 
_pam_winbind_cleanup_func);
+   pam_set_data(pamh, PAM_WINBIND_NEW_AUTHTOK_REQD, 
new_authtok_required, _pam_winbind_cleanup_func);
 
retval = PAM_SUCCESS;
goto out;
@@ -1296,6 +1295,10 @@
iniparser_freedict(d);
}
 
+   if (!new_authtok_required) {
+   pam_set_data(pamh, PAM_WINBIND_NEW_AUTHTOK_REQD, NULL, NULL);
+   }
+
return ret;
 }
 



svn commit: samba r21010 - in branches/SAMBA_3_0/source/utils: .

2007-01-24 Thread jerry
Author: jerry
Date: 2007-01-25 00:50:36 + (Thu, 25 Jan 2007)
New Revision: 21010

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

Log:
fix the pstring change in ntlm_auth for require-membership-of in ntlm_auth
Modified:
   branches/SAMBA_3_0/source/utils/ntlm_auth.c


Changeset:
Modified: branches/SAMBA_3_0/source/utils/ntlm_auth.c
===
--- branches/SAMBA_3_0/source/utils/ntlm_auth.c 2007-01-25 00:47:27 UTC (rev 
21009)
+++ branches/SAMBA_3_0/source/utils/ntlm_auth.c 2007-01-25 00:50:36 UTC (rev 
21010)
@@ -272,7 +272,7 @@
fstrcpy(request.data.auth.user, user);
fstrcpy(request.data.auth.pass, pass);
if (require_membership_of_sid)
-   fstrcpy(request.data.auth.require_membership_of_sid, 
require_membership_of_sid);
+   pstrcpy(request.data.auth.require_membership_of_sid, 
require_membership_of_sid);
 
result = winbindd_request_response(WINBINDD_PAM_AUTH, &request, 
&response);
 



svn commit: samba r21009 - in branches/SAMBA_3_0/source/nsswitch: .

2007-01-24 Thread jerry
Author: jerry
Date: 2007-01-25 00:47:27 + (Thu, 25 Jan 2007)
New Revision: 21009

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

Log:
Patch from Danilo Almeida @ Centeris (via me). 

Patch details:

Support most options in pam_winbind.conf; support comma-separated names in
require-membership-of.  Details below:

1) Provides support for almost all config options in pam_winbind.conf
   (all except for use_first_pass, use_authtok, and unknown_ok). 

 - That allows us to work well when invoked via call_modules from
   pam_unix2.conf as well as allowing use of spaces in names used
   w/require_membership_of.

2) Support for comma-separated list of names or SID strings in
   require_membership_of/require-membership-of.

 - Increased require_membership_of field in winbind request from fstring
   (256) to pstring (1024).

 - In PAM side, parse out multiple names or SID strings and convert
   all of them to SID strings.

 - In Winbind side, support membership check against multiple SID strings.



Modified:
   branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_nss.h
   branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
===
--- branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-01-24 22:56:17 UTC 
(rev 21008)
+++ branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-01-25 00:47:27 UTC 
(rev 21009)
@@ -91,21 +91,18 @@
va_end(args);
 }
 
-static int _pam_parse(const pam_handle_t *pamh, int flags, int argc, const 
char **argv, dictionary **d)
+static int _pam_parse(const pam_handle_t *pamh, int flags, int argc, const 
char **argv, dictionary **result_d)
 {
int ctrl = 0;
const char *config_file = NULL;
int i;
const char **v;
+   dictionary *d = NULL;
 
if (flags & PAM_SILENT) {
ctrl |= WINBIND_SILENT;
}
 
-   if (d == NULL) {
-   goto config_from_pam;
-   }
-
for (i=argc,v=argv; i-- > 0; ++v) {
if (!strncasecmp(*v, "config", strlen("config"))) {
ctrl |= WINBIND_CONFIG_FILE;
@@ -118,36 +115,40 @@
config_file = PAM_WINBIND_CONFIG_FILE;
}
 
-   *d = iniparser_load(config_file);
-   if (*d == NULL) {
+   d = iniparser_load(config_file);
+   if (d == NULL) {
goto config_from_pam;
}
 
-   if (iniparser_getboolean(*d, "global:debug", False)) {
+   if (iniparser_getboolean(d, "global:debug", False)) {
ctrl |= WINBIND_DEBUG_ARG;
}
 
-   if (iniparser_getboolean(*d, "global:cached_login", False)) {
+   if (iniparser_getboolean(d, "global:cached_login", False)) {
ctrl |= WINBIND_CACHED_LOGIN;
}
 
-   if (iniparser_getboolean(*d, "global:krb5_auth", False)) {
+   if (iniparser_getboolean(d, "global:krb5_auth", False)) {
ctrl |= WINBIND_KRB5_AUTH;
}
 
-   if (iniparser_getboolean(*d, "global:silent", False)) {
+   if (iniparser_getboolean(d, "global:silent", False)) {
ctrl |= WINBIND_SILENT;
}
 
-   if (iniparser_getstr(*d, "global:krb5_ccache_type") != NULL) {
+   if (iniparser_getstr(d, "global:krb5_ccache_type") != NULL) {
ctrl |= WINBIND_KRB5_CCACHE_TYPE;
}

-   if ((iniparser_getstr(*d, "global:require-membership-of") != NULL) ||
-   (iniparser_getstr(*d, "global:require_membership_of") != NULL)) {
+   if ((iniparser_getstr(d, "global:require-membership-of") != NULL) ||
+   (iniparser_getstr(d, "global:require_membership_of") != NULL)) {
ctrl |= WINBIND_REQUIRED_MEMBERSHIP;
}
 
+   if (iniparser_getboolean(d, "global:try_first_pass", False)) {
+   ctrl |= WINBIND_TRY_FIRST_PASS_ARG;
+   }
+
 config_from_pam:
/* step through arguments */
for (i=argc,v=argv; i-- > 0; ++v) {
@@ -179,6 +180,15 @@
}
 
}
+
+   if (result_d) {
+   *result_d = d;
+   } else {
+   if (d) {
+   iniparser_freedict(d);
+   }
+   }
+
return ctrl;
 };
 
@@ -447,6 +457,147 @@
/* no warning sent */
 }
 
+#define IS_SID_STRING(name) (strncmp("S-", name, 2) == 0)
+
+int safe_append_string(char *dest,
+   const char *src,
+   int dest_buffer_size)
+/**
+ * Append a string, making sure not to overflow and to always return a 
NULL-terminated
+ * string.
+ *
+ * @param dest Destination string buffer (must already be NULL-terminated).
+ * @param src Source string buffer.
+ * @param dest_buffer_size Size of dest buffer in bytes.
+ *
+ * @return 0 if dest buffer is not big enough (no bytes copied), non-zero on 
success.
+ */
+{
+   int dest_le

Build status as of Thu Jan 25 00:00:02 2007

2007-01-24 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-01-24 
00:00:12.0 +
+++ /home/build/master/cache/broken_results.txt 2007-01-25 00:00:57.0 
+
@@ -1,4 +1,4 @@
-Build status as of Wed Jan 24 00:00:02 2007
+Build status as of Thu Jan 25 00:00:02 2007
 
 Build counts:
 Tree Total  Broken Panic 
@@ -9,13 +9,13 @@
 distcc   3  0  0 
 ldb  34 3  0 
 libreplace   32 3  0 
-lorikeet-heimdal 31 17 0 
+lorikeet-heimdal 31 18 0 
 ppp  18 0  0 
-rsync36 10 0 
+rsync36 9  0 
 samba0  0  0 
 samba-docs   0  0  0 
-samba4   34 17 2 
-samba_3_036 11 0 
+samba4   34 17 0 
+samba_3_036 9  0 
 smb-build32 31 0 
 talloc   36 0  0 
 tdb  34 3  0 


svn commit: samba r21008 - in branches/SAMBA_4_0/webapps/install: .

2007-01-24 Thread abartlet
Author: abartlet
Date: 2007-01-24 22:56:17 + (Wed, 24 Jan 2007)
New Revision: 21008

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

Log:
We added a new argument to the provision() function, but I forgot to
update SWAT.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/webapps/install/provision.esp
   branches/SAMBA_4_0/webapps/install/vampire.esp


Changeset:
Modified: branches/SAMBA_4_0/webapps/install/provision.esp
===
--- branches/SAMBA_4_0/webapps/install/provision.esp2007-01-24 19:53:58 UTC 
(rev 21007)
+++ branches/SAMBA_4_0/webapps/install/provision.esp2007-01-24 22:56:17 UTC 
(rev 21008)
@@ -61,7 +61,7 @@
} else {
var paths = provision_default_paths(subobj);
if (!provision(subobj, writefln, false, paths, 
-  session.authinfo.session_info, 
session.authinfo.credentials)) {
+  session.authinfo.session_info, 
session.authinfo.credentials, false)) {
writefln("Provision failed!");
} else if (!provision_dns(subobj, writefln, paths,
  session.authinfo.session_info, 
session.authinfo.credentials)) {

Modified: branches/SAMBA_4_0/webapps/install/vampire.esp
===
--- branches/SAMBA_4_0/webapps/install/vampire.esp  2007-01-24 19:53:58 UTC 
(rev 21007)
+++ branches/SAMBA_4_0/webapps/install/vampire.esp  2007-01-24 22:56:17 UTC 
(rev 21008)
@@ -76,7 +76,7 @@
 
/* Setup a basic database structure, but don't setup any users 
*/
if (!provision(subobj, writefln, true, paths,
-  session_info, credentials)) {
+  session_info, credentials, false)) {
writefln("Provision failed!");
 
/* Join domain */



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

2007-01-24 Thread herb
Author: herb
Date: 2007-01-24 19:53:58 + (Wed, 24 Jan 2007)
New Revision: 21007

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

Log:
move $(SOCKET_WRAPPER_OBJ) to OBJ definition instead of link line like 
all other uses - merge from 3_0_24

Modified:
   branches/SAMBA_3_0/source/Makefile.in


Changeset:
Modified: branches/SAMBA_3_0/source/Makefile.in
===
--- branches/SAMBA_3_0/source/Makefile.in   2007-01-24 19:51:09 UTC (rev 
21006)
+++ branches/SAMBA_3_0/source/Makefile.in   2007-01-24 19:53:58 UTC (rev 
21007)
@@ -843,11 +843,13 @@
iniparser/src/strlib.o
 
 TDBBACKUP_OBJ = tdb/tools/tdbbackup.o tdb/common/tdbback.o $(LIBREPLACE_OBJ) \
-   $(TDBBASE_OBJ)
+   $(TDBBASE_OBJ) $(SOCKET_WRAPPER_OBJ)
 
-TDBTOOL_OBJ = tdb/tools/tdbtool.o $(TDBBASE_OBJ) $(LIBREPLACE_OBJ)
+TDBTOOL_OBJ = tdb/tools/tdbtool.o $(TDBBASE_OBJ) $(LIBREPLACE_OBJ) \
+   $(SOCKET_WRAPPER_OBJ)
 
-TDBDUMP_OBJ = tdb/tools/tdbdump.o $(TDBBASE_OBJ) $(LIBREPLACE_OBJ)
+TDBDUMP_OBJ = tdb/tools/tdbdump.o $(TDBBASE_OBJ) $(LIBREPLACE_OBJ) \
+   $(SOCKET_WRAPPER_OBJ)
 
 NTLM_AUTH_OBJ1 = utils/ntlm_auth.o utils/ntlm_auth_diagnostics.o 
 
@@ -1579,15 +1581,15 @@
 
 bin/[EMAIL PROTECTED]@: $(TDBBACKUP_OBJ) bin/.dummy
@echo Linking $@
-   @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBBACKUP_OBJ) 
$(SOCKET_WRAPPER_OBJ)
+   @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBBACKUP_OBJ)
 
 bin/[EMAIL PROTECTED]@: $(TDBTOOL_OBJ) bin/.dummy
@echo Linking $@
-   @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBTOOL_OBJ) 
$(SOCKET_WRAPPER_OBJ)
+   @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBTOOL_OBJ)
 
 bin/[EMAIL PROTECTED]@: $(TDBDUMP_OBJ) bin/.dummy
@echo Linking $@
-   @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBDUMP_OBJ) 
$(SOCKET_WRAPPER_OBJ)
+   @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBDUMP_OBJ)
 
 bin/[EMAIL PROTECTED]@: bin/[EMAIL PROTECTED]@ torture/t_strcmp.o
$(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) torture/t_strcmp.o -L ./bin 
-lbigballofmud



svn commit: samba r21006 - in branches/SAMBA_3_0_24/source: .

2007-01-24 Thread herb
Author: herb
Date: 2007-01-24 19:51:09 + (Wed, 24 Jan 2007)
New Revision: 21006

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

Log:
move $(SOCKET_WRAPPER_OBJ) to OBJ definition instead of link line like 
all other uses

Modified:
   branches/SAMBA_3_0_24/source/Makefile.in


Changeset:
Modified: branches/SAMBA_3_0_24/source/Makefile.in
===
--- branches/SAMBA_3_0_24/source/Makefile.in2007-01-24 16:15:29 UTC (rev 
21005)
+++ branches/SAMBA_3_0_24/source/Makefile.in2007-01-24 19:51:09 UTC (rev 
21006)
@@ -824,11 +824,13 @@
iniparser/src/strlib.o
 
 TDBBACKUP_OBJ = tdb/tools/tdbbackup.o tdb/common/tdbback.o $(LIBREPLACE_OBJ) \
-   $(TDBBASE_OBJ)
+   $(TDBBASE_OBJ) $(SOCKET_WRAPPER_OBJ)
 
-TDBTOOL_OBJ = tdb/tools/tdbtool.o $(TDBBASE_OBJ) $(LIBREPLACE_OBJ)
+TDBTOOL_OBJ = tdb/tools/tdbtool.o $(TDBBASE_OBJ) $(LIBREPLACE_OBJ) \
+   $(SOCKET_WRAPPER_OBJ)
 
-TDBDUMP_OBJ = tdb/tools/tdbdump.o $(TDBBASE_OBJ) $(LIBREPLACE_OBJ)
+TDBDUMP_OBJ = tdb/tools/tdbdump.o $(TDBBASE_OBJ) $(LIBREPLACE_OBJ) \
+   $(SOCKET_WRAPPER_OBJ)
 
 NTLM_AUTH_OBJ1 = utils/ntlm_auth.o utils/ntlm_auth_diagnostics.o 
 
@@ -1541,15 +1543,15 @@
 
 bin/[EMAIL PROTECTED]@: $(TDBBACKUP_OBJ) bin/.dummy
@echo Linking $@
-   @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBBACKUP_OBJ) 
$(SOCKET_WRAPPER_OBJ)
+   @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBBACKUP_OBJ)
 
 bin/[EMAIL PROTECTED]@: $(TDBTOOL_OBJ) bin/.dummy
@echo Linking $@
-   @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBTOOL_OBJ) 
$(SOCKET_WRAPPER_OBJ)
+   @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBTOOL_OBJ)
 
 bin/[EMAIL PROTECTED]@: $(TDBDUMP_OBJ) bin/.dummy
@echo Linking $@
-   @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBDUMP_OBJ) 
$(SOCKET_WRAPPER_OBJ)
+   @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBDUMP_OBJ)
 
 bin/[EMAIL PROTECTED]@: bin/[EMAIL PROTECTED]@ torture/t_strcmp.o
$(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) torture/t_strcmp.o -L ./bin 
-lbigballofmud



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

2007-01-24 Thread vlendec
Author: vlendec
Date: 2007-01-24 16:15:29 + (Wed, 24 Jan 2007)
New Revision: 21005

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

Log:
Add a debug message for EAGAIN error of setresuid.

Volker

Modified:
   branches/SAMBA_3_0/source/lib/util_sec.c
   branches/SAMBA_3_0_24/source/lib/util_sec.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/util_sec.c
===
--- branches/SAMBA_3_0/source/lib/util_sec.c2007-01-24 15:29:58 UTC (rev 
21004)
+++ branches/SAMBA_3_0/source/lib/util_sec.c2007-01-24 16:15:29 UTC (rev 
21005)
@@ -198,7 +198,13 @@
 {
 #if USE_SETRESUID
 /* Set the effective as well as the real uid. */
-   setresuid(uid,uid,-1);
+   if (setresuid(uid,uid,-1) == -1) {
+   if (errno == EAGAIN) {
+   DEBUG(0, ("setresuid failed with EAGAIN. uid(%d) "
+ "might be over its NPROC limit\n",
+ (int)uid));
+   }
+   }
 #endif
 
 #if USE_SETREUID

Modified: branches/SAMBA_3_0_24/source/lib/util_sec.c
===
--- branches/SAMBA_3_0_24/source/lib/util_sec.c 2007-01-24 15:29:58 UTC (rev 
21004)
+++ branches/SAMBA_3_0_24/source/lib/util_sec.c 2007-01-24 16:15:29 UTC (rev 
21005)
@@ -198,7 +198,13 @@
 {
 #if USE_SETRESUID
 /* Set the effective as well as the real uid. */
-   setresuid(uid,uid,-1);
+   if (setresuid(uid,uid,-1) == -1) {
+   if (errno == EAGAIN) {
+   DEBUG(0, ("setresuid failed with EAGAIN. uid(%d) "
+ "might be over its NPROC limit\n",
+ (int)uid));
+   }
+   }
 #endif
 
 #if USE_SETREUID



Rev 11292: Add documentation, initial support for the buildfarm in file:///home/jelmer/bzr.samba/4.0-perlselftest/

2007-01-24 Thread Jelmer Vernooij

revno: 11292
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij <[EMAIL PROTECTED]>
branch nick: 4.0-perlselftest
timestamp: Wed 2007-01-24 17:00:07 +0100
message:
  Add documentation, initial support for the buildfarm
modified:
  source/script/tests/selftest.pl svn-v2:[EMAIL PROTECTED]
=== modified file 'source/script/tests/selftest.pl'
--- a/source/script/tests/selftest.pl   2007-01-22 23:49:29 +
+++ b/source/script/tests/selftest.pl   2007-01-24 16:00:07 +
@@ -2,6 +2,82 @@
 # Bootstrap Samba and run a number of tests against it.
 # Copyright (C) 2005-2007 Jelmer Vernooij <[EMAIL PROTECTED]>
 # Published under the GNU GPL, v3 or later.
+
+=pod
+
+=head1 NAME
+
+selftest - Samba test runner
+
+=head1 SYNOPSIS
+
+selftest --help
+
+selftest [--target=samba4|samba3|win] [--socket-wrapper] [--quick] [--one] 
PREFIX
+
+=head1 DESCRIPTION
+
+A simple test runner.
+
+=head1 OPTIONS
+
+=over 4
+
+=item I<--help>
+
+Show list of available options.
+   
+=item I<--target samba4|samba3|win>
+
+Specify test target against which to run. Default is 'samba4'.
+
+=item I<--quick>
+
+Run only a limited number of tests. Intended to run in about 30 seconds on 
+moderately recent systems.
+   
+=item I<--socket-wrapper>
+
+Use socket wrapper library for communication with server. Only works 
+when the server is running locally.
+
+Will prevent TCP and UDP ports being opened on the local host but 
+(transparently) redirects these calls to use unix domain sockets.
+
+=item I<--one>
+
+Abort as soon as one test fails.
+
+=back
+
+=head1 ENVIRONMENT
+
+=over 4
+
+=item I
+
+=item I
+
+=item I
+
+=item I
+
+=item I
+
+=item I
+
+=back
+
+=head1 LICENSE
+
+selftest is licensed under the GNU General Public License 
L.
+
+=head1 AUTHOR
+
+Jelmer Vernooij
+
+=cut
+
 use strict;
 use warnings;
 
@@ -11,6 +87,12 @@
 use POSIX;
 use Cwd;
 
+my $opt_help = 0;
+my $opt_target = "samba4";
+my $opt_quick = 0;
+my $opt_socket_wrapper = 0;
+my $opt_one = 0;
+
 sub slapd_start($$) {
my ($conf, $uri) = @_;
 my $oldpath = $ENV{PATH};
@@ -91,12 +173,58 @@
exit $failed;
 }
 
+my $totalfailed = 0;
+my $start = time();
+
+sub run_test_buildfarm()
+{
+   my ($name, $cmd, $i, $total) = @_;
+   print "--==--==--==--==--==--==--==--==--==--==--\n";
+   print "Running test $name (level 0 stdout)\n";
+   print "--==--==--==--==--==--==--==--==--==--==--\n";
+   system("date");
+   print "Testing $name";
+
+   system($cmd);
+
+#  print "SMBD is down! Skipping: $cmd\n";
+#  print "==\n";
+#  print "TEST SKIPPED: $name (reason SMBD is down)\n";
+#  print "==\n";
+#
+   print "ALL OK: $cmd\n";
+   print "==\n";
+   print "TEST PASSED: $name\n";
+   print "==\n";
+
+   my $ret = 0;
+   if ($ret != 0) {
+   $totalfailed++;
+   }
+}
+
+sub run_test_plain()
+{
+   my ($name, $cmd, $i, $total) = @_;
+   my $err = "";
+   if ($totalfailed > 0) { $err = ", $totalfailed errors"; }
+   printf "[$i/$total in " . (time() - $start)."s$err] $name\n";
+   open(RESULT, "$cmd 2>/dev/null|");
+   while () { }
+   close(RESULT);
+   my $ret = 0;
+   if ($ret != 0) {
+   $totalfailed++;
+   exit(1) if ($opt_one);
+   }
+}
+
 sub ShowHelp()
 {
print "Samba test runner
 Copyright (C) Jelmer Vernooij <[EMAIL PROTECTED]>
 
-Usage: $Script PREFIX
+Usage: $Script [OPTIONS] PREFIX
 
 Generic options:
  --help this help page
@@ -108,11 +236,6 @@
exit(0);
 }
 
-my $opt_help = 0;
-my $opt_target = "samba4";
-my $opt_quick = 0;
-my $opt_socket_wrapper = 0;
-my $opt_one = 0;
 
 my $result = GetOptions (
'help|h|?' => \$opt_help,
@@ -160,6 +283,8 @@
 my $testsdir = "$srcdir/script/tests";
 
 my $tls_enabled = not $opt_quick;
+my $from_build_farm = (defined($ENV{RUN_FROM_BUILD_FARM}) and 
+  ($ENV{RUN_FROM_BUILD_FARM} eq "yes"));
 
 $ENV{TLS_ENABLED} = ($tls_enabled?"yes":"no");
 $ENV{LD_LDB_MODULE_PATH} = "$old_pwd/bin/modules/ldb";
@@ -236,18 +361,17 @@
 $ENV{SOCKET_WRAPPER_DEFAULT_IFACE} = 6;
 $ENV{TORTURE_INTERFACES} = 
'127.0.0.6/8,127.0.0.7/8,127.0.0.8/8,127.0.0.9/8,127.0.0.10/8,127.0.0.11/8';
 
-my @torture_options = ("--option=interfaces=$ENV{TORTURE_INTERFACES} 
$ENV{CONFIGURATION}");
+my @torture_options = ();
+push (@torture_options, "--option=interfaces=$ENV{TORTURE_INTERFACES}");
+push (@torture_options, $ENV{CONFIGURATION});
 # ensure any one smbtorture call doesn't run too long
 push (@torture_options, "--maximum-runtime=$torture_maxtime");
 push (@torture_options, "--target=$opt_target");
-push (@torture_options, "--o

svn commit: samba r21004 - in branches: SAMBA_3_0/source/modules SAMBA_3_0_24/source/modules

2007-01-24 Thread jmcd
Author: jmcd
Date: 2007-01-24 15:29:58 + (Wed, 24 Jan 2007)
New Revision: 21004

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

Log:
Patch from Mathias Dietz <[EMAIL PROTECTED]> to fix multi-node
sharemodes in gpfs.

Modified:
   branches/SAMBA_3_0/source/modules/gpfs.c
   branches/SAMBA_3_0_24/source/modules/gpfs.c


Changeset:
Modified: branches/SAMBA_3_0/source/modules/gpfs.c
===
--- branches/SAMBA_3_0/source/modules/gpfs.c2007-01-24 14:59:01 UTC (rev 
21003)
+++ branches/SAMBA_3_0/source/modules/gpfs.c2007-01-24 15:29:58 UTC (rev 
21004)
@@ -57,7 +57,7 @@
DEBUG(10, ("special case am=no_access:%x\n",access_mask));
}
else {  
-   deny |= (share_access & (FILE_SHARE_WRITE|FILE_SHARE_DELETE)) ?
+   deny |= (share_access & FILE_SHARE_WRITE) ?
0 : GPFS_DENY_WRITE;
deny |= (share_access & (FILE_SHARE_READ)) ?
0 : GPFS_DENY_READ;

Modified: branches/SAMBA_3_0_24/source/modules/gpfs.c
===
--- branches/SAMBA_3_0_24/source/modules/gpfs.c 2007-01-24 14:59:01 UTC (rev 
21003)
+++ branches/SAMBA_3_0_24/source/modules/gpfs.c 2007-01-24 15:29:58 UTC (rev 
21004)
@@ -57,7 +57,7 @@
DEBUG(10, ("special case am=no_access:%x\n",access_mask));
}
else {  
-   deny |= (share_access & (FILE_SHARE_WRITE|FILE_SHARE_DELETE)) ?
+   deny |= (share_access & FILE_SHARE_WRITE) ?
0 : GPFS_DENY_WRITE;
deny |= (share_access & (FILE_SHARE_READ)) ?
0 : GPFS_DENY_READ;



svn commit: samba r21003 - in branches: SAMBA_3_0/source/libads SAMBA_3_0_24/source/libads

2007-01-24 Thread gd
Author: gd
Date: 2007-01-24 14:59:01 + (Wed, 24 Jan 2007)
New Revision: 21003

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

Log:
Display LDAP base in debug statement.

Guenther

Modified:
   branches/SAMBA_3_0/source/libads/ldap_utils.c
   branches/SAMBA_3_0_24/source/libads/ldap_utils.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ldap_utils.c
===
--- branches/SAMBA_3_0/source/libads/ldap_utils.c   2007-01-24 14:53:03 UTC 
(rev 21002)
+++ branches/SAMBA_3_0/source/libads/ldap_utils.c   2007-01-24 14:59:01 UTC 
(rev 21003)
@@ -60,8 +60,8 @@
status = ads_do_search_all_args(ads, bp, scope, expr, attrs, 
args, res);
}
if (ADS_ERR_OK(status)) {
-   DEBUG(5,("Search for %s gave %d replies\n",
-expr, ads_count_replies(ads, *res)));
+   DEBUG(5,("Search for %s in <%s> gave %d replies\n",
+   expr, bp, ads_count_replies(ads, *res)));
SAFE_FREE(bp);
return status;
}

Modified: branches/SAMBA_3_0_24/source/libads/ldap_utils.c
===
--- branches/SAMBA_3_0_24/source/libads/ldap_utils.c2007-01-24 14:53:03 UTC 
(rev 21002)
+++ branches/SAMBA_3_0_24/source/libads/ldap_utils.c2007-01-24 14:59:01 UTC 
(rev 21003)
@@ -60,8 +60,8 @@
status = ads_do_search_all_args(ads, bp, scope, expr, attrs, 
args, res);
}
if (ADS_ERR_OK(status)) {
-   DEBUG(5,("Search for %s gave %d replies\n",
-expr, ads_count_replies(ads, *res)));
+   DEBUG(5,("Search for %s in <%s> gave %d replies\n",
+expr, bp, ads_count_replies(ads, *res)));
SAFE_FREE(bp);
return status;
}



svn commit: samba r21002 - in branches/SAMBA_3_0/source: include smbd

2007-01-24 Thread herb
Author: herb
Date: 2007-01-24 14:53:03 + (Wed, 24 Jan 2007)
New Revision: 21002

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

Log:
Get rid of unused macros - merge change from 3_0_24

Modified:
   branches/SAMBA_3_0/source/include/smbprofile.h
   branches/SAMBA_3_0/source/smbd/nttrans.c
   branches/SAMBA_3_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/smbprofile.h
===
--- branches/SAMBA_3_0/source/include/smbprofile.h  2007-01-24 14:39:46 UTC 
(rev 21001)
+++ branches/SAMBA_3_0/source/include/smbprofile.h  2007-01-24 14:53:03 UTC 
(rev 21002)
@@ -757,10 +757,6 @@
 
 extern struct profile_header *profile_h;
 extern struct profile_stats *profile_p;
-extern struct timeval profile_starttime;
-extern struct timeval profile_endtime;
-extern struct timeval profile_starttime_nested;
-extern struct timeval profile_endtime_nested;
 extern BOOL do_profile_flag;
 extern BOOL do_profile_times;
 
@@ -846,8 +842,6 @@
profile_timestamp() - __profstamp_##x); \
}
 
-#define START_PROFILE_NESTED(x) START_PROFILE(x)
-#define END_PROFILE_NESTED(x) END_PROFILE(x)
 
 #else /* WITH_PROFILE */
 
@@ -856,10 +850,8 @@
 #define DO_PROFILE_DEC_INC(x,y)
 #define DO_PROFILE_ADD(x,n)
 #define START_PROFILE(x)
-#define START_PROFILE_NESTED(x)
 #define START_PROFILE_BYTES(x,n)
 #define END_PROFILE(x)
-#define END_PROFILE_NESTED(x)
 
 #endif /* WITH_PROFILE */
 

Modified: branches/SAMBA_3_0/source/smbd/nttrans.c
===
--- branches/SAMBA_3_0/source/smbd/nttrans.c2007-01-24 14:39:46 UTC (rev 
21001)
+++ branches/SAMBA_3_0/source/smbd/nttrans.c2007-01-24 14:53:03 UTC (rev 
21002)
@@ -2744,44 +2744,44 @@
switch(state->call) {
case NT_TRANSACT_CREATE:
{
-   START_PROFILE_NESTED(NT_transact_create);
+   START_PROFILE(NT_transact_create);
outsize = call_nt_transact_create(conn, inbuf, outbuf,
  size, bufsize, 
&state->setup, 
state->setup_count,
&state->param, 
state->total_param, 
&state->data, 
state->total_data,
  
state->max_data_return);
-   END_PROFILE_NESTED(NT_transact_create);
+   END_PROFILE(NT_transact_create);
break;
}
 
case NT_TRANSACT_IOCTL:
{
-   START_PROFILE_NESTED(NT_transact_ioctl);
+   START_PROFILE(NT_transact_ioctl);
outsize = call_nt_transact_ioctl(conn, inbuf, outbuf,
 size, bufsize, 
 &state->setup, 
state->setup_count,
 &state->param, 
state->total_param, 
 &state->data, 
state->total_data, state->max_data_return);
-   END_PROFILE_NESTED(NT_transact_ioctl);
+   END_PROFILE(NT_transact_ioctl);
break;
}
 
case NT_TRANSACT_SET_SECURITY_DESC:
{
-   START_PROFILE_NESTED(NT_transact_set_security_desc);
+   START_PROFILE(NT_transact_set_security_desc);
outsize = call_nt_transact_set_security_desc(conn, 
inbuf, outbuf, 
 size, bufsize, 
 &state->setup, 
state->setup_count,
 &state->param, 
state->total_param, 
 &state->data, 
state->total_data, state->max_data_return);
-   END_PROFILE_NESTED(NT_transact_set_security_desc);
+   END_PROFILE(NT_transact_set_security_desc);
break;
}
 
case NT_TRANSACT_NOTIFY_CHANGE:
{
-   START_PROFILE_NESTED(NT_transact_notify_change);
+   START_PROFILE(NT_transact_notify_change);
outsize = call_nt_transact_notify_change(
conn, inbuf, outbuf, size, bufsize, 
&state->setup, state->setup_count,
@@ -2789,56 +2789,56 @@
&state->data, state->total_data,
state->max_data_return,

svn commit: samba r21001 - in branches/SAMBA_3_0/source: include nsswitch

2007-01-24 Thread jerry
Author: jerry
Date: 2007-01-24 14:39:46 + (Wed, 24 Jan 2007)
New Revision: 21001

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

Log:
* Use a simple '#define LDAPMessage void' to fix the build
  problems in the nss_info interface when HAVE_LDAP is undefined.
* Revert previous ifdef HAVE_ADS brakets
* Remove an unused init function wrapper.



Modified:
   branches/SAMBA_3_0/source/include/includes.h
   branches/SAMBA_3_0/source/include/nss_info.h
   branches/SAMBA_3_0/source/nsswitch/nss_info.c
   branches/SAMBA_3_0/source/nsswitch/nss_info_template.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/includes.h
===
--- branches/SAMBA_3_0/source/include/includes.h2007-01-24 12:46:26 UTC 
(rev 21000)
+++ branches/SAMBA_3_0/source/include/includes.h2007-01-24 14:39:46 UTC 
(rev 21001)
@@ -777,9 +777,6 @@
 
 #ifdef HAVE_LDAP
 #include "ads_protos.h"
-#else
-struct _LDAPMessage;
-typedef struct _LDAPMessage *LDAPMessage;
 #endif
 
 /* We need this after proto.h to reference GetTimeOfDay(). */

Modified: branches/SAMBA_3_0/source/include/nss_info.h
===
--- branches/SAMBA_3_0/source/include/nss_info.h2007-01-24 12:46:26 UTC 
(rev 21000)
+++ branches/SAMBA_3_0/source/include/nss_info.h2007-01-24 14:39:46 UTC 
(rev 21001)
@@ -20,11 +20,15 @@
Boston, MA  02111-1307, USA.   
 */
 
-#ifdef WITH_ADS
-
 #ifndef _IDMAP_NSS_H
 #define _IDMAP_NSS_H
 
+#ifndef HAVE_LDAP
+#  ifndef LDAPMessage
+#define LDAPMessage void
+#  endif
+#endif
+
 /* The interface version specifier */
 
 #define SMB_NSS_INFO_INTERFACE_VERSION   1
@@ -84,9 +88,5 @@
 
 NTSTATUS nss_close( const char *parameters );
 
-NTSTATUS idmap_nss_init_domain( const char *domain );
-
-
 #endif /* _IDMAP_NSS_H_ */
 
-#endif /* WITH_ADS */

Modified: branches/SAMBA_3_0/source/nsswitch/nss_info.c
===
--- branches/SAMBA_3_0/source/nsswitch/nss_info.c   2007-01-24 12:46:26 UTC 
(rev 21000)
+++ branches/SAMBA_3_0/source/nsswitch/nss_info.c   2007-01-24 14:39:46 UTC 
(rev 21001)
@@ -20,8 +20,6 @@
Boston, MA  02111-1307, USA.   
 */
 
-#ifdef WITH_ADS
-
 #include "includes.h"
 #include "nss_info.h"
 
@@ -266,27 +264,3 @@
return NT_STATUS_OK;
 }
 
-/
- Invoke the init function for a given domain's backend
- ***/
-
- NTSTATUS idmap_nss_init_domain( const char *domain )
-{
-   struct nss_domain_entry *p;
-   
-   DEBUG(10,("idmap_nss_init_domain: Searching for %s's init() 
function\n", 
- domain));
-   
-   for ( p=nss_domain_list; p; p=p->next ) {
-   if ( strequal( p->domain, domain ) ) {
-   DEBUG(10,("idmap_nss_init_domain: Calling init function 
for %s\n",
- domain)); 
-   return p->backend->methods->init( p );
-   }
-   }
-   
-   return NT_STATUS_NO_SUCH_DOMAIN;
-}
-
-#endif /* WITH_ADS */
-

Modified: branches/SAMBA_3_0/source/nsswitch/nss_info_template.c
===
--- branches/SAMBA_3_0/source/nsswitch/nss_info_template.c  2007-01-24 
12:46:26 UTC (rev 21000)
+++ branches/SAMBA_3_0/source/nsswitch/nss_info_template.c  2007-01-24 
14:39:46 UTC (rev 21001)
@@ -20,8 +20,6 @@
Boston, MA  02111-1307, USA.   
 */
 
-#ifdef WITH_ADS 
-
 #include "includes.h"
 #include "nss_info.h"
 
@@ -73,9 +71,9 @@
  ***/
 
 static struct nss_info_methods nss_template_methods = {
-   nss_template_init,
-   nss_template_get_info,
-   nss_template_close
+   .init = nss_template_init,
+   .get_nss_info = nss_template_get_info,
+   .close_fn = nss_template_close
 };

 NTSTATUS nss_info_template_init( void )
@@ -85,4 +83,3 @@
  &nss_template_methods);   
 }
 
-#endif /* WITH_ADS */

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c   2007-01-24 12:46:26 UTC 
(rev 21000)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c   2007-01-24 14:39:46 UTC 
(rev 21001)
@@ -125,10 +125,6 @@
return NULL;
}
 
-   /* initialize the nss backend for this domain */
-
-   idmap_nss_init_domain( domain->name );
-
/* set the flag that says we don't own the memory even 
   though we do so that ads_destroy() won't destroy the 
   structure we pass back by refer

Rev 11161: Merge support for deleting keys and setting values by Wilco in file:///home/jelmer/bzr.samba/4.0-regwrite/

2007-01-24 Thread Jelmer Vernooij

revno: 11161
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij <[EMAIL PROTECTED]>
branch nick: 4.0-regwrite
timestamp: Wed 2007-01-24 14:19:46 +0100
message:
  Merge support for deleting keys and setting values by Wilco
modified:
  source/lib/registry/reg_backend_regf.c svn-v2:[EMAIL PROTECTED]

revno: 11153.1.12
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Wilco Baan Hofman <[EMAIL PROTECTED]>
branch nick: 4.0-regwrite
timestamp: Sun 2007-01-21 21:17:38 +0100
message:
  Checkin *UNTESTED* set security descriptor code.
  Theoretically, it should work, but at the moment I have no way of testing 
this. 

revno: 11153.1.11
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Wilco Baan Hofman <[EMAIL PROTECTED]>
branch nick: 4.0-regwrite
timestamp: Sun 2007-01-21 17:24:47 +0100
message:
  Implement regf_del_value
  Revert offsets -> unsigned integers, because value offset in vk may be 
shared with REG_DWORD
  Change error handling for regf_sl_del_entry and regf_sl_add_entry.
  Implement li/lh blocks for regf_sl_add_entry
  Fixed issue when last key was deleted an empty block was allocated.

revno: 11153.1.10
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: svn-v2:[EMAIL PROTECTED]
committer: Wilco Baan Hofman <[EMAIL PROTECTED]>
branch nick: 4.0-regwrite
timestamp: Thu 2007-01-18 02:34:41 +0100
message:
  Merge from upstream.

revno: 11153.1.9
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Wilco Baan Hofman <[EMAIL PROTECTED]>
branch nick: 4.0-regwrite
timestamp: Thu 2007-01-18 02:30:22 +0100
message:
  Add FIXME line regarding deleting last key.

revno: 11153.1.8
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Wilco Baan Hofman <[EMAIL PROTECTED]>
branch nick: 4.0-regwrite
timestamp: Thu 2007-01-18 02:26:02 +0100
message:
  Implement regf_set_value.
  Clarify return error when deleting non-empty key.

revno: 11153.1.7
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Wilco Baan Hofman <[EMAIL PROTECTED]>
branch nick: 4.0-regwrite
timestamp: Wed 2007-01-17 17:06:25 +0100
message:
  Create regf_del_key support
  Fix allocation routines to work with block splits for deletion

Diff too large for email (1005, the limit is 1000).


svn commit: samba r21000 - in branches/SAMBA_4_0/testprogs/ejs: .

2007-01-24 Thread metze
Author: metze
Date: 2007-01-24 12:46:26 + (Wed, 24 Jan 2007)
New Revision: 21000

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

Log:
add some options to control what ldif is dumped

default is dump everything

metze
Modified:
   branches/SAMBA_4_0/testprogs/ejs/minschema.js


Changeset:
Modified: branches/SAMBA_4_0/testprogs/ejs/minschema.js
===
--- branches/SAMBA_4_0/testprogs/ejs/minschema.js   2007-01-24 12:23:42 UTC 
(rev 20999)
+++ branches/SAMBA_4_0/testprogs/ejs/minschema.js   2007-01-24 12:46:26 UTC 
(rev 21000)
@@ -12,13 +12,42 @@
 "POPT_AUTOHELP",
 "POPT_COMMON_SAMBA",
 "POPT_COMMON_CREDENTIALS",
-"verbose");
+"verbose",
+"classes",
+"attributes",
+"subschema",
+"subschema-auto");
 if (options == undefined) {
println("Failed to parse options");
return -1;
 }
 verbose = options["verbose"];
+dump_all = "yes";
+dump_classes = options["classes"];
+dump_attributes = options["attributes"];
+dump_subschema = options["subschema"];
+dump_subschema_auto = options["subschema-auto"];
 
+if (dump_classes != undefined) {
+   dump_all = undefined;
+}
+if (dump_attributes != undefined) {
+   dump_all = undefined;
+}
+if (dump_subschema != undefined) {
+   dump_all = undefined;
+}
+if (dump_subschema_auto != undefined) {
+   dump_all = undefined;
+   dump_subschema = "yes";
+}
+if (dump_all != undefined) {
+   dump_classes = "yes";
+   dump_attributes = "yes";
+   dump_subschema = "yes";
+   dump_subschema_auto = "yes";
+}
+
 if (options.ARGV.length != 2) {
println("Usage: minschema.js  ");
return -1;
@@ -678,6 +707,10 @@
 objectClass: subSchema
 objectCategory: CN=SubSchema,${SCHEMADN}
 ");
+   if (dump_subschema_auto == undefined) {
+   return; 
+   }
+
for (i in objectclasses) {
write_aggregate_objectclass(objectclasses[i]);
}
@@ -776,11 +809,16 @@
 /*
   dump an ldif form of the attributes and objectclasses
 */
-write_ldif(attributes, attrib_attrs);
-write_ldif(objectclasses, class_attrs);
+if (dump_attributes != undefined) {
+   write_ldif(attributes, attrib_attrs);
+}
+if (dump_classes != undefined) {
+   write_ldif(objectclasses, class_attrs);
+}
+if (dump_subschema != undefined) {
+   write_aggregate();
+}
 
-write_aggregate();
-
 if (verbose == undefined) {
exit(0);
 }



svn commit: samba r20999 - in branches/SAMBA_4_0/testprogs/ejs: .

2007-01-24 Thread metze
Author: metze
Date: 2007-01-24 12:23:42 + (Wed, 24 Jan 2007)
New Revision: 20999

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

Log:
- update the list of attributes for classSchema and atttributeSchema objects
- use ${SCHEMADN} instead of CN=Schema,CN=Configuration,${BASEDN}
- do not include autogenerated values: instanceType, cn and name in the ldif 
output
- take care of the systemOnly attribute and a resulting NO-USER-MODIFICATION

metze
Modified:
   branches/SAMBA_4_0/testprogs/ejs/minschema.js


Changeset:
Modified: branches/SAMBA_4_0/testprogs/ejs/minschema.js
===
--- branches/SAMBA_4_0/testprogs/ejs/minschema.js   2007-01-24 11:26:22 UTC 
(rev 20998)
+++ branches/SAMBA_4_0/testprogs/ejs/minschema.js   2007-01-24 12:23:42 UTC 
(rev 20999)
@@ -40,23 +40,70 @@
 objectclasses_expanded = new Object();
 
 /* the attributes we need for objectclasses */
-class_attrs = new Array("objectClass", 
-   "auxiliaryClass", "systemAuxiliaryClass",
-   "possSuperiors", "systemPossSuperiors",
-   "lDAPDisplayName", "governsID",
-   "rDNAttID", "mustContain", "systemMustContain",
-   "mayContain", "systemMayContain",
-   "objectClassCategory", "subClassOf", 
-   "defaultObjectCategory", "defaultHidingValue", 
-   "systemFlags", "systemOnly", 
"defaultSecurityDescriptor",
-   "objectCategory", "possibleInferiors", 
"displaySpecification",
-   "schemaIDGUID");
+class_attrs = new Array("objectClass",
+   "subClassOf",
+   "governsID",
+   "possSuperiors",
+   "mayContain",
+   "mustContain",
+   "auxiliaryClass",
+   "rDNAttID",
+   "showInAdvancedViewOnly",
+   "adminDisplayName",
+   "adminDescription",
+   "objectClassCategory",
+   "lDAPDisplayName",
+   "schemaIDGUID",
+   "systemOnly",
+   "systemPossSuperiors",
+   "systemMayContain",
+   "systemMustContain",
+   "systemAuxiliaryClass",
+   "defaultSecurityDescriptor",
+   "systemFlags",
+   "defaultHidingValue",
+   "objectCategory",
+   "defaultObjectCategory",
 
-attrib_attrs = new Array("objectClass", "lDAPDisplayName", 
-"isSingleValued", "linkID", "systemFlags", 
"systemOnly",
-"schemaIDGUID", "adminDisplayName", "attributeID",
-"attributeSyntax", "oMSyntax", "oMObjectClass");
+   /* this attributes are not used by w2k3 */
+   "schemaFlagsEx",
+   "msDs-IntId",
+   "msDs-Schema-Extensions",
+   "classDisplayName",
+   "isDefunct");
 
+
+attrib_attrs = new Array("objectClass",
+"attributeID",
+"attributeSyntax",
+"isSingleValued",
+"rangeLower",
+"rangeUpper",
+"mAPIID",
+"linkID",
+"showInAdvancedViewOnly",
+"adminDisplayName",
+"oMObjectClass",
+"adminDescription",
+"oMSyntax",
+"searchFlags",
+"extendedCharsAllowed",
+"lDAPDisplayName",
+"schemaIDGUID",
+"attributeSecurityGUID",
+"systemOnly",
+"systemFlags",
+"isMemberOfPartialAttributeSet",
+"objectCategory",
+
+/* this attributes are not used by w2k3 */
+"schemaFlagsEx",
+"msDs-IntId",
+"msDs-Schema-Extensions",
+"classDisplayName",
+"isEphemeral",
+"isDefunct");
+
 /*
   notes:
 
@@ -144,14 +191,14 @@
 
 
 /*
-  fix a string DN to use ${BASEDN}
+  fix a string DN to use ${SCHEMADN}
 */
 function fix_dn(dn) {
-   var s = strstr(dn, rootDse.defaultNamingContext);
+   var s = strstr(dn, rootDse.schemaNamingContext);
if (s == NULL) {
return dn;
}
-   return substr(dn, 0, strlen(dn) - strlen(s)) + "${BASEDN}";
+   return substr(dn, 0, strlen(dn) - strlen(

Rev 11291: Merge upstream in file:///home/jelmer/bzr.samba/4.0-perlselftest/

2007-01-24 Thread Jelmer Vernooij

revno: 11291
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: svn-v2:[EMAIL PROTECTED]
committer: Jelmer Vernooij <[EMAIL PROTECTED]>
branch nick: 4.0-perlselftest
timestamp: Wed 2007-01-24 13:05:47 +0100
message:
  Merge upstream
added:
  source/dsdb/repl/drepl_service.c svn-v2:[EMAIL PROTECTED]
  source/dsdb/repl/drepl_service.h svn-v2:[EMAIL PROTECTED]
  source/dsdb/schema/schema_constructed.c svn-v2:[EMAIL PROTECTED]
  source/heimdal/kdc/config.csvn-v2:[EMAIL PROTECTED]
  source/torture/local/tdr.c svn-v2:[EMAIL PROTECTED]
modified:
  .bzrignore svn-v2:[EMAIL PROTECTED]
  source/auth/kerberos/krb5_init_context.c svn-v2:[EMAIL PROTECTED]
  source/cluster/ctdb/brlock_ctdb.c svn-v2:[EMAIL PROTECTED]
  source/cluster/ctdb/common/ctdb.c svn-v2:[EMAIL PROTECTED]
  source/cluster/ctdb/common/ctdb_call.c svn-v2:[EMAIL PROTECTED]
  source/cluster/ctdb/common/ctdb_ltdb.c svn-v2:[EMAIL PROTECTED]
  source/cluster/ctdb/common/ctdb_util.c svn-v2:[EMAIL PROTECTED]
  source/cluster/ctdb/ctdb_cluster.c svn-v2:[EMAIL PROTECTED]
  source/cluster/ctdb/tcp/tcp_connect.c svn-v2:[EMAIL PROTECTED]
  source/cluster/ctdb/tcp/tcp_init.c svn-v2:[EMAIL PROTECTED]
  source/cluster/ctdb/tcp/tcp_io.c svn-v2:[EMAIL PROTECTED]
  source/dsdb/config.mk  svn-v2:[EMAIL PROTECTED]
  source/dsdb/samdb/ldb_modules/repl_meta_data.c svn-v2:[EMAIL PROTECTED]
  source/heimdal/kdc/default_config.c svn-v2:[EMAIL PROTECTED]
  source/heimdal/kdc/kdc_locl.h  svn-v2:[EMAIL PROTECTED]
  source/kdc/kdc.c   svn-v2:[EMAIL PROTECTED]
  source/lib/events/events_aio.c svn-v2:[EMAIL PROTECTED]
  source/lib/events/events_signal.c svn-v2:[EMAIL PROTECTED]
  source/lib/ldb/ldb_tdb/ldb_cache.c svn-v2:[EMAIL PROTECTED]
  source/lib/replace/replace.h   svn-v2:[EMAIL PROTECTED]
  source/libcli/raw/rawacl.c svn-v2:[EMAIL PROTECTED]
  source/libnet/libnet_join.csvn-v2:[EMAIL PROTECTED]
  source/librpc/idl/notify.idl   svn-v2:[EMAIL PROTECTED]
  source/librpc/ndr/ndr.csvn-v2:[EMAIL PROTECTED]
  source/ntvfs/common/notify.c   svn-v2:[EMAIL PROTECTED]
  source/param/loadparm.csvn-v2:[EMAIL PROTECTED]
  source/param/util.csvn-v2:[EMAIL PROTECTED]
  source/pidl/tests/Util.pm  svn-v2:[EMAIL PROTECTED]
  source/pidl/tests/ndr_align.pl svn-v2:[EMAIL PROTECTED]
  source/pidl/tests/ndr_refptr.pl svn-v2:[EMAIL PROTECTED]
  source/pidl/tests/ndr_tagtype.pl svn-v2:[EMAIL PROTECTED]
  source/script/tests/mktestsetup.sh svn-v2:[EMAIL PROTECTED]
  source/script/tests/test_local.sh svn-v2:[EMAIL PROTECTED]
  source/script/tests/tests_all.sh svn-v2:[EMAIL PROTECTED]
  source/torture/config.mk   svn-v2:[EMAIL PROTECTED]
  source/torture/local/config.mk svn-v2:[EMAIL PROTECTED]
  source/torture/local/event.c   svn-v2:[EMAIL PROTECTED]
  source/torture/local/local.c   svn-v2:[EMAIL PROTECTED]

revno: 11286.1.5.1.24
merged: svn-v2:[EMAIL PROTECTED]
parent: svn-v2:[EMAIL PROTECTED]
committer: abartlet
timestamp: Wed 2007-01-24 09:43:49 +
message:
  Add in more certificate and key blobs, to enable PKINIT.
  
  To automaticly test this, we need to decide if we should ship kinit
  (and possibly and hxtool).
  
  Andrew Bartlett

revno: 11286.1.5.1.23
merged: svn-v2:[EMAIL PROTECTED]
parent: svn-v2:[EMAIL PROTECTED]
committer: tridge
timestamp: Wed 2007-01-24 04:34:19 +
message:
  
  use relative includes for ctdb headers. This works with both
  standalone and built-in ctdb

revno: 11286.1.5.1.22
merged: svn-v2:[EMAIL PROTECTED]
parent: svn-v2:[EMAIL PROTECTED]
committer: tridge
timestamp: Wed 2007-01-24 04:30:44 +
message:
  
  check for errors from event_loop_once()

revno: 11286.1.5.1.21
merged: svn-v2:[EMAIL PROTECTED]
parent: svn-v2:[EMAIL PROTECTED]
committer: tridge
timestamp: Wed 2007-01-24 04:28:17 +
message:
  
  don't mark epoll as set until after the io_submit() succeeds
  
  this is part of the solution to LOCAL-EVENT on fort

revno: 11286.1.5.1.20
merged: svn-v2:[EMAIL PROTECTED]
parent: svn-v2:[EMAIL PROTECTED]
committer: abartlet
timestamp: Wed 2007-01-24 02:48:40 +
message:
  Call out to Heimdal's krb5.conf processing to configure many aspects
  of KDC behaviour.  This should allow PKINIT to be turned on and
  managed with reasonable sanity.
  
  This also means that the krb5.conf in the same directory as the
  smb.conf will always have priority in Samba4, which I think will be

svn commit: samba r20998 - in branches: SAMBA_3_0/source/passdb SAMBA_3_0_24/source/passdb

2007-01-24 Thread vlendec
Author: vlendec
Date: 2007-01-24 11:26:22 + (Wed, 24 Jan 2007)
New Revision: 20998

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

Log:
Fix debug message
Modified:
   branches/SAMBA_3_0/source/passdb/pdb_smbpasswd.c
   branches/SAMBA_3_0_24/source/passdb/pdb_smbpasswd.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/pdb_smbpasswd.c
===
--- branches/SAMBA_3_0/source/passdb/pdb_smbpasswd.c2007-01-24 09:43:49 UTC 
(rev 20997)
+++ branches/SAMBA_3_0/source/passdb/pdb_smbpasswd.c2007-01-24 11:26:22 UTC 
(rev 20998)
@@ -1129,7 +1129,8 @@
size_t new_entry_length;
 
if (strequal(name, pwd->smb_name)) {
-   DEBUG(10, ("add_smbfilepwd_entry: found entry with name 
%s - deleting it.\n", name));
+   DEBUG(10, ("del_smbfilepwd_entry: found entry with "
+  "name %s - deleting it.\n", name));
continue;
}
 

Modified: branches/SAMBA_3_0_24/source/passdb/pdb_smbpasswd.c
===
--- branches/SAMBA_3_0_24/source/passdb/pdb_smbpasswd.c 2007-01-24 09:43:49 UTC 
(rev 20997)
+++ branches/SAMBA_3_0_24/source/passdb/pdb_smbpasswd.c 2007-01-24 11:26:22 UTC 
(rev 20998)
@@ -1129,7 +1129,8 @@
size_t new_entry_length;
 
if (strequal(name, pwd->smb_name)) {
-   DEBUG(10, ("add_smbfilepwd_entry: found entry with name 
%s - deleting it.\n", name));
+   DEBUG(10, ("del_smbfilepwd_entry: found entry with "
+  "name %s - deleting it.\n", name));
continue;
}
 



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

2007-01-24 Thread abartlet
Author: abartlet
Date: 2007-01-24 09:43:49 + (Wed, 24 Jan 2007)
New Revision: 20997

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

Log:
Add in more certificate and key blobs, to enable PKINIT.

To automaticly test this, we need to decide if we should ship kinit
(and possibly and hxtool).

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/script/tests/mktestsetup.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/mktestsetup.sh
===
--- branches/SAMBA_4_0/source/script/tests/mktestsetup.sh   2007-01-24 
08:55:00 UTC (rev 20996)
+++ branches/SAMBA_4_0/source/script/tests/mktestsetup.sh   2007-01-24 
09:43:49 UTC (rev 20997)
@@ -61,7 +61,13 @@
 DHFILE=$TLSDIR/dhparms.pem
 CAFILE=$TLSDIR/ca.pem
 CERTFILE=$TLSDIR/cert.pem
+REQKDC=$TLSDIR/req-kdc.der
+KDCCERTFILE=$TLSDIR/kdc.pem
 KEYFILE=$TLSDIR/key.pem
+ADMINKEYFILE=$TLSDIR/adminkey.pem
+REQADMIN=$TLSDIR/req-admin.der
+ADMINKEYFILE=$TLSDIR/adminkey.pem
+ADMINCERTFILE=$TLSDIR/admincert.pem
 WINBINDD_SOCKET_DIR=$PREFIX_ABS/winbind_socket
 CONFIGURATION="--configfile=$CONFFILE"
 LDAPDIR=$PREFIX_ABS/ldap
@@ -238,11 +244,21 @@
   admin_server = 127.0.0.1:88
   default_domain = samba.example.com
  }
+
+[appdefaults]
+   pkinit_anchors = FILE:$CAFILE
+
+[kdc]
+   enable-pkinit = true
+   pkinit_identity = FILE:$KDCCERTFILE,$KEYFILE
+   pkinit_anchors = FILE:$CAFILE
+
 [domain_realm]
  .samba.example.com = SAMBA.EXAMPLE.COM
 EOF
 export KRB5_CONFIG
 
+#This is specified here to avoid draining entropy on every run
 cat >$DHFILE<$KEYFILE<$ADMINKEYFILE<$CAFILE<$CERTFILE<$KEYFILE<$KDCCERTFILE<$ADMINCERTFILE<$SLAPD_CONF <

svn commit: samba r20996 - in branches/SAMBA_3_0/source/include: .

2007-01-24 Thread abartlet
Author: abartlet
Date: 2007-01-24 08:55:00 + (Wed, 24 Jan 2007)
New Revision: 20996

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

Log:
Build fix from Kai Blin


Modified:
   branches/SAMBA_3_0/source/include/includes.h


Changeset:
Modified: branches/SAMBA_3_0/source/include/includes.h
===
--- branches/SAMBA_3_0/source/include/includes.h2007-01-24 06:30:58 UTC 
(rev 20995)
+++ branches/SAMBA_3_0/source/include/includes.h2007-01-24 08:55:00 UTC 
(rev 20996)
@@ -778,7 +778,8 @@
 #ifdef HAVE_LDAP
 #include "ads_protos.h"
 #else
-typedef LDAPMessage void;
+struct _LDAPMessage;
+typedef struct _LDAPMessage *LDAPMessage;
 #endif
 
 /* We need this after proto.h to reference GetTimeOfDay(). */