svn commit: samba r14032 - in trunk/source/rpc_server: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 07:30:43 + (Wed, 08 Mar 2006)
New Revision: 14032

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

Log:
Coverity bug CID #110. Free all resources correctly
on pipe initialization failure.
Jeremy.

Modified:
   trunk/source/rpc_server/srv_pipe_hnd.c


Changeset:
Modified: trunk/source/rpc_server/srv_pipe_hnd.c
===
--- trunk/source/rpc_server/srv_pipe_hnd.c  2006-03-08 07:30:37 UTC (rev 
14031)
+++ trunk/source/rpc_server/srv_pipe_hnd.c  2006-03-08 07:30:43 UTC (rev 
14032)
@@ -330,6 +330,8 @@
DEBUG(0,("open_rpc_pipe_p: malloc fail for in_data struct.\n"));
talloc_destroy(p->mem_ctx);
talloc_destroy(p->pipe_state_mem_ctx);
+   close_policy_by_pipe(p);
+   SAFE_FREE(p);
return NULL;
}
 



svn commit: samba r14031 - in branches/SAMBA_3_0/source/rpc_server: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 07:30:37 + (Wed, 08 Mar 2006)
New Revision: 14031

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

Log:
Coverity bug CID #110. Free all resources correctly
on pipe initialization failure.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/rpc_server/srv_pipe_hnd.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_server/srv_pipe_hnd.c
===
--- branches/SAMBA_3_0/source/rpc_server/srv_pipe_hnd.c 2006-03-08 07:20:11 UTC 
(rev 14030)
+++ branches/SAMBA_3_0/source/rpc_server/srv_pipe_hnd.c 2006-03-08 07:30:37 UTC 
(rev 14031)
@@ -330,6 +330,8 @@
DEBUG(0,("open_rpc_pipe_p: malloc fail for in_data struct.\n"));
talloc_destroy(p->mem_ctx);
talloc_destroy(p->pipe_state_mem_ctx);
+   close_policy_by_pipe(p);
+   SAFE_FREE(p);
return NULL;
}
 



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

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 07:20:11 + (Wed, 08 Mar 2006)
New Revision: 14030

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

Log:
Fix resource leak in error codepath. Coverity CID #64.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/tdb/tdb.c


Changeset:
Modified: branches/SAMBA_3_0/source/tdb/tdb.c
===
--- branches/SAMBA_3_0/source/tdb/tdb.c 2006-03-08 07:20:10 UTC (rev 14029)
+++ branches/SAMBA_3_0/source/tdb/tdb.c 2006-03-08 07:20:11 UTC (rev 14030)
@@ -1458,10 +1458,14 @@
rec.key_len))
|| memcmp(k, oldkey.dptr, oldkey.dsize) != 0) {
/* No, it wasn't: unlock it and start from scratch */
-   if (unlock_record(tdb, tdb->travlocks.off) != 0)
+   if (unlock_record(tdb, tdb->travlocks.off) != 0) {
+   SAFE_FREE(k);
return tdb_null;
-   if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0)
+   }
+   if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0) 
{
+   SAFE_FREE(k);
return tdb_null;
+   }
tdb->travlocks.off = 0;
}
 



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

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 07:20:10 + (Wed, 08 Mar 2006)
New Revision: 14029

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

Log:
Fix resource leak in error codepath. Coverity CID #64.
Jeremy.

Modified:
   branches/SAMBA_4_0/source/lib/tdb/common/traverse.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/common/traverse.c
===
--- branches/SAMBA_4_0/source/lib/tdb/common/traverse.c 2006-03-08 07:18:18 UTC 
(rev 14028)
+++ branches/SAMBA_4_0/source/lib/tdb/common/traverse.c 2006-03-08 07:20:10 UTC 
(rev 14029)
@@ -289,10 +289,14 @@
rec.key_len))
|| memcmp(k, oldkey.dptr, oldkey.dsize) != 0) {
/* No, it wasn't: unlock it and start from scratch */
-   if (tdb_unlock_record(tdb, tdb->travlocks.off) != 0)
+   if (tdb_unlock_record(tdb, tdb->travlocks.off) != 0) {
+   SAFE_FREE(k);
return tdb_null;
-   if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0)
+   }
+   if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0) 
{
+   SAFE_FREE(k);
return tdb_null;
+   }
tdb->travlocks.off = 0;
}
 



svn commit: samba r14028 - in trunk/source/tdb: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 07:18:18 + (Wed, 08 Mar 2006)
New Revision: 14028

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

Log:
Fix resource leak in error codepath. Coverity CID #64.
Jeremy.

Modified:
   trunk/source/tdb/tdb.c


Changeset:
Modified: trunk/source/tdb/tdb.c
===
--- trunk/source/tdb/tdb.c  2006-03-08 07:13:29 UTC (rev 14027)
+++ trunk/source/tdb/tdb.c  2006-03-08 07:18:18 UTC (rev 14028)
@@ -1458,10 +1458,14 @@
rec.key_len))
|| memcmp(k, oldkey.dptr, oldkey.dsize) != 0) {
/* No, it wasn't: unlock it and start from scratch */
-   if (unlock_record(tdb, tdb->travlocks.off) != 0)
+   if (unlock_record(tdb, tdb->travlocks.off) != 0) {
+   SAFE_FREE(k);
return tdb_null;
-   if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0)
+   }
+   if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0) 
{
+   SAFE_FREE(k);
return tdb_null;
+   }
tdb->travlocks.off = 0;
}
 



svn commit: samba r14027 - in trunk/source/tdb: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 07:13:29 + (Wed, 08 Mar 2006)
New Revision: 14027

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

Log:
Fix resource leak on error exit. Coverity CID #65.
Jeremy.

Modified:
   trunk/source/tdb/tdbback.c


Changeset:
Modified: trunk/source/tdb/tdbback.c
===
--- trunk/source/tdb/tdbback.c  2006-03-08 07:13:23 UTC (rev 14026)
+++ trunk/source/tdb/tdbback.c  2006-03-08 07:13:29 UTC (rev 14027)
@@ -108,6 +108,7 @@
/* stat the old tdb to find its permissions */
if (stat(old_name, &st) != 0) {
perror(old_name);
+   free(tmp_name);
return 1;
}
 
@@ -115,6 +116,7 @@
tdb = tdb_open(old_name, 0, 0, O_RDWR, 0);
if (!tdb) {
printf("Failed to open %s\n", old_name);
+   free(tmp_name);
return 1;
}
 



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

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 07:13:23 + (Wed, 08 Mar 2006)
New Revision: 14026

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

Log:
Fix resource leak on error exit. Coverity CID #65.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/tdb/tdbback.c


Changeset:
Modified: branches/SAMBA_3_0/source/tdb/tdbback.c
===
--- branches/SAMBA_3_0/source/tdb/tdbback.c 2006-03-08 06:51:38 UTC (rev 
14025)
+++ branches/SAMBA_3_0/source/tdb/tdbback.c 2006-03-08 07:13:23 UTC (rev 
14026)
@@ -108,6 +108,7 @@
/* stat the old tdb to find its permissions */
if (stat(old_name, &st) != 0) {
perror(old_name);
+   free(tmp_name);
return 1;
}
 
@@ -115,6 +116,7 @@
tdb = tdb_open(old_name, 0, 0, O_RDWR, 0);
if (!tdb) {
printf("Failed to open %s\n", old_name);
+   free(tmp_name);
return 1;
}
 



svn commit: samba r14025 - branches/SAMBA_3_0/source/rpc_parse trunk/source/rpc_parse

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-08 06:51:38 + (Wed, 08 Mar 2006)
New Revision: 14025

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

Log:
Remove unused code. When we want to export samsync, we better first port
pidl...

Fix Coverity # 15.

Volker

Modified:
   branches/SAMBA_3_0/source/rpc_parse/parse_net.c
   trunk/source/rpc_parse/parse_net.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_parse/parse_net.c
===
--- branches/SAMBA_3_0/source/rpc_parse/parse_net.c 2006-03-08 06:42:45 UTC 
(rev 14024)
+++ branches/SAMBA_3_0/source/rpc_parse/parse_net.c 2006-03-08 06:51:38 UTC 
(rev 14025)
@@ -2240,86 +2240,6 @@
 }
 
 /***
-makes a SAM_ACCOUNT_INFO structure.
-/
-BOOL make_sam_account_info(SAM_ACCOUNT_INFO * info,
-  const UNISTR2 *user_name,
-  const UNISTR2 *full_name,
-  uint32 user_rid, uint32 group_rid,
-  const UNISTR2 *home_dir,
-  const UNISTR2 *dir_drive,
-  const UNISTR2 *log_scr,
-  const UNISTR2 *desc,
-  uint32 acb_info,
-  const UNISTR2 *prof_path,
-  const UNISTR2 *wkstas,
-  const UNISTR2 *unk_str, const UNISTR2 *mung_dial)
-{
-   int len_user_name = user_name != NULL ? user_name->uni_str_len : 0;
-   int len_full_name = full_name != NULL ? full_name->uni_str_len : 0;
-   int len_home_dir = home_dir != NULL ? home_dir->uni_str_len : 0;
-   int len_dir_drive = dir_drive != NULL ? dir_drive->uni_str_len : 0;
-   int len_logon_script = log_scr != NULL ? log_scr->uni_str_len : 0;
-   int len_profile_path = prof_path != NULL ? prof_path->uni_str_len : 0;
-   int len_description = desc != NULL ? desc->uni_str_len : 0;
-   int len_workstations = wkstas != NULL ? wkstas->uni_str_len : 0;
-   int len_unknown_str = unk_str != NULL ? unk_str->uni_str_len : 0;
-   int len_munged_dial = mung_dial != NULL ? mung_dial->uni_str_len : 0;
-
-   DEBUG(5, ("make_sam_account_info\n"));
-
-   make_uni_hdr(&info->hdr_acct_name, len_user_name);
-   make_uni_hdr(&info->hdr_full_name, len_full_name);
-   make_uni_hdr(&info->hdr_home_dir, len_home_dir);
-   make_uni_hdr(&info->hdr_dir_drive, len_dir_drive);
-   make_uni_hdr(&info->hdr_logon_script, len_logon_script);
-   make_uni_hdr(&info->hdr_profile, len_profile_path);
-   make_uni_hdr(&info->hdr_acct_desc, len_description);
-   make_uni_hdr(&info->hdr_workstations, len_workstations);
-   make_uni_hdr(&info->hdr_comment, len_unknown_str);
-   make_uni_hdr(&info->hdr_parameters, len_munged_dial);
-
-   /* not present */
-   make_bufhdr2(&info->hdr_sec_desc, 0, 0, 0);
-
-   info->user_rid = user_rid;
-   info->group_rid = group_rid;
-
-   init_nt_time(&info->logon_time);
-   init_nt_time(&info->logoff_time);
-   init_nt_time(&info->pwd_last_set_time);
-   init_nt_time(&info->acct_expiry_time);
-
-   info->logon_divs = 0xA8;
-   info->ptr_logon_hrs = 0;/* Don't care right now */
-
-   info->bad_pwd_count = 0;
-   info->logon_count = 0;
-   info->acb_info = acb_info;
-   info->nt_pwd_present = 0;
-   info->lm_pwd_present = 0;
-   info->pwd_expired = 0;
-   info->country = 0;
-   info->codepage = 0;
-
-   info->unknown1 = 0x4EC;
-   info->unknown2 = 0;
-
-   copy_unistr2(&info->uni_acct_name, user_name);
-   copy_unistr2(&info->uni_full_name, full_name);
-   copy_unistr2(&info->uni_home_dir, home_dir);
-   copy_unistr2(&info->uni_dir_drive, dir_drive);
-   copy_unistr2(&info->uni_logon_script, log_scr);
-   copy_unistr2(&info->uni_profile, prof_path);
-   copy_unistr2(&info->uni_acct_desc, desc);
-   copy_unistr2(&info->uni_workstations, wkstas);
-   copy_unistr2(&info->uni_comment, unk_str);
-   copy_unistr2(&info->uni_parameters, mung_dial);
-
-   return True;
-}
-
-/***
 reads or writes a structure.
 /
 static BOOL net_io_sam_account_info(const char *desc, SAM_ACCOUNT_INFO *info,

Modified: trunk/source/rpc_parse/parse_net.c
===
--- trunk/source/rpc_parse/parse_net.c  2006-03-08 06:42:45 UTC (rev 14024)
+++ trunk/source/rpc_parse/parse_net.c  2006-03-08 06:51:38 UTC (rev 14025)
@@ -2240,86 +2240,6 @@
 }
 
 /***
-makes a SAM_ACCOUNT_INFO structure.
-***

svn commit: samba r14024 - in trunk/source/printing: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 06:42:45 + (Wed, 08 Mar 2006)
New Revision: 14024

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

Log:
My last bug fix still left a potential null deref.
C- "must try harder" :-).
Jeremy.

Modified:
   trunk/source/printing/print_generic.c


Changeset:
Modified: trunk/source/printing/print_generic.c
===
--- trunk/source/printing/print_generic.c   2006-03-08 06:42:39 UTC (rev 
14023)
+++ trunk/source/printing/print_generic.c   2006-03-08 06:42:45 UTC (rev 
14024)
@@ -200,16 +200,17 @@
*q = NULL;
return 0;
}
+   memset(queue, '\0', sizeof(print_queue_struct)*(numlines+1));
+
+   for (i=0; i

svn commit: samba r14023 - in branches/SAMBA_3_0/source/printing: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 06:42:39 + (Wed, 08 Mar 2006)
New Revision: 14023

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

Log:
My last bug fix still left a potential null deref.
C- "must try harder" :-).
Jeremy.

Modified:
   branches/SAMBA_3_0/source/printing/print_generic.c


Changeset:
Modified: branches/SAMBA_3_0/source/printing/print_generic.c
===
--- branches/SAMBA_3_0/source/printing/print_generic.c  2006-03-08 06:39:33 UTC 
(rev 14022)
+++ branches/SAMBA_3_0/source/printing/print_generic.c  2006-03-08 06:42:39 UTC 
(rev 14023)
@@ -200,16 +200,17 @@
*q = NULL;
return 0;
}
+   memset(queue, '\0', sizeof(print_queue_struct)*(numlines+1));
+
+   for (i=0; i

svn commit: samba r14022 - branches/SAMBA_3_0/source/libsmb trunk/source/libsmb

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-08 06:39:33 + (Wed, 08 Mar 2006)
New Revision: 14022

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

Log:
Fix Coverity bug # 92
Modified:
   branches/SAMBA_3_0/source/libsmb/libsmb_cache.c
   trunk/source/libsmb/libsmb_cache.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/libsmb_cache.c
===
--- branches/SAMBA_3_0/source/libsmb/libsmb_cache.c 2006-03-08 06:36:49 UTC 
(rev 14021)
+++ branches/SAMBA_3_0/source/libsmb/libsmb_cache.c 2006-03-08 06:39:33 UTC 
(rev 14022)
@@ -94,6 +94,7 @@
SAFE_FREE(srvcache->share_name);
SAFE_FREE(srvcache->workgroup);
SAFE_FREE(srvcache->username);
+   SAFE_FREE(srvcache);

return 1;
 }

Modified: trunk/source/libsmb/libsmb_cache.c
===
--- trunk/source/libsmb/libsmb_cache.c  2006-03-08 06:36:49 UTC (rev 14021)
+++ trunk/source/libsmb/libsmb_cache.c  2006-03-08 06:39:33 UTC (rev 14022)
@@ -94,6 +94,7 @@
SAFE_FREE(srvcache->share_name);
SAFE_FREE(srvcache->workgroup);
SAFE_FREE(srvcache->username);
+   SAFE_FREE(srvcache);

return 1;
 }



svn commit: samba r14021 - in trunk/source/lib: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 06:36:49 + (Wed, 08 Mar 2006)
New Revision: 14021

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

Log:
Coverity bug CID #66. Missing free on error exit.
Jeremy.

Modified:
   trunk/source/lib/xfile.c


Changeset:
Modified: trunk/source/lib/xfile.c
===
--- trunk/source/lib/xfile.c2006-03-08 06:36:40 UTC (rev 14020)
+++ trunk/source/lib/xfile.c2006-03-08 06:36:49 UTC (rev 14021)
@@ -96,13 +96,16 @@
XFILE *ret;
 
ret = SMB_MALLOC_P(XFILE);
-   if (!ret) return NULL;
+   if (!ret) {
+   return NULL;
+   }
 
memset(ret, 0, sizeof(XFILE));
 
if ((flags & O_ACCMODE) == O_RDWR) {
/* we don't support RDWR in XFILE - use file 
   descriptors instead */
+   SAFE_FREE(ret);
errno = EINVAL;
return NULL;
}



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

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 06:36:40 + (Wed, 08 Mar 2006)
New Revision: 14020

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

Log:
Coverity bug CID #66. Missing free on error exit.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/lib/xfile.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/xfile.c
===
--- branches/SAMBA_3_0/source/lib/xfile.c   2006-03-08 06:32:36 UTC (rev 
14019)
+++ branches/SAMBA_3_0/source/lib/xfile.c   2006-03-08 06:36:40 UTC (rev 
14020)
@@ -96,13 +96,16 @@
XFILE *ret;
 
ret = SMB_MALLOC_P(XFILE);
-   if (!ret) return NULL;
+   if (!ret) {
+   return NULL;
+   }
 
memset(ret, 0, sizeof(XFILE));
 
if ((flags & O_ACCMODE) == O_RDWR) {
/* we don't support RDWR in XFILE - use file 
   descriptors instead */
+   SAFE_FREE(ret);
errno = EINVAL;
return NULL;
}



svn commit: samba r14019 - in trunk/source/param: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 06:32:36 + (Wed, 08 Mar 2006)
New Revision: 14019

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

Log:
Coverity error CID #27. Missing return -1 on error condition.
Jeremy.

Modified:
   trunk/source/param/loadparm.c


Changeset:
Modified: trunk/source/param/loadparm.c
===
--- trunk/source/param/loadparm.c   2006-03-08 06:32:26 UTC (rev 14018)
+++ trunk/source/param/loadparm.c   2006-03-08 06:32:36 UTC (rev 14019)
@@ -4534,6 +4534,7 @@
if (lines == NULL) {
DEBUG(0,("process_usershare_file: loading file %s owned by %u 
failed.\n",
fname, (unsigned int)sbuf.st_uid ));
+   return -1;
}
 
/* Should we allow printers to be shared... ? */



svn commit: samba r14018 - in branches/SAMBA_3_0/source/param: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 06:32:26 + (Wed, 08 Mar 2006)
New Revision: 14018

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

Log:
Coverity error CID #27. Missing return -1 on error condition.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_3_0/source/param/loadparm.c
===
--- branches/SAMBA_3_0/source/param/loadparm.c  2006-03-08 06:32:21 UTC (rev 
14017)
+++ branches/SAMBA_3_0/source/param/loadparm.c  2006-03-08 06:32:26 UTC (rev 
14018)
@@ -4534,6 +4534,7 @@
if (lines == NULL) {
DEBUG(0,("process_usershare_file: loading file %s owned by %u 
failed.\n",
fname, (unsigned int)sbuf.st_uid ));
+   return -1;
}
 
/* Should we allow printers to be shared... ? */



svn commit: samba r14017 - branches/SAMBA_3_0/source/libads trunk/source/libads

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-08 06:32:21 + (Wed, 08 Mar 2006)
New Revision: 14017

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

Log:
Okay, okay, I have turned a double-free into dead code :-)

Fix Coverity # 214.

Volker

Modified:
   branches/SAMBA_3_0/source/libads/ads_ldap.c
   trunk/source/libads/ads_ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ads_ldap.c
===
--- branches/SAMBA_3_0/source/libads/ads_ldap.c 2006-03-08 06:28:08 UTC (rev 
14016)
+++ branches/SAMBA_3_0/source/libads/ads_ldap.c 2006-03-08 06:32:21 UTC (rev 
14017)
@@ -83,8 +83,6 @@
*dn = talloc_strdup(mem_ctx, dn2);
 
if (!*dn) {
-   ads_memfree(ads, dn2);
-   dn2 = NULL;
rc = ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
goto done;
}

Modified: trunk/source/libads/ads_ldap.c
===
--- trunk/source/libads/ads_ldap.c  2006-03-08 06:28:08 UTC (rev 14016)
+++ trunk/source/libads/ads_ldap.c  2006-03-08 06:32:21 UTC (rev 14017)
@@ -83,8 +83,6 @@
*dn = talloc_strdup(mem_ctx, dn2);
 
if (!*dn) {
-   ads_memfree(ads, dn2);
-   dn2 = NULL;
rc = ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
goto done;
}



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

2006-03-07 Thread tridge
Author: tridge
Date: 2006-03-08 06:28:08 + (Wed, 08 Mar 2006)
New Revision: 14016

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

Log:

use type safe talloc when constructing operation structures in smb server

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


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb/reply.c
===
--- branches/SAMBA_4_0/source/smb_server/smb/reply.c2006-03-08 06:17:00 UTC 
(rev 14015)
+++ branches/SAMBA_4_0/source/smb_server/smb/reply.c2006-03-08 06:28:08 UTC 
(rev 14016)
@@ -45,8 +45,8 @@
}} while (0)

 /* useful wrapper for talloc with NO_MEMORY reply */
-#define REQ_TALLOC(ptr, size) do { \
-   ptr = talloc_size(req, size); \
+#define REQ_TALLOC(ptr, type) do { \
+   ptr = talloc(req, type); \
if (!ptr) { \
smbsrv_send_error(req, NT_STATUS_NO_MEMORY); \
return; \
@@ -233,7 +233,7 @@
 
/* parse request */
REQ_CHECK_WCT(req, 3);
-   REQ_TALLOC(io, sizeof(*io));
+   REQ_TALLOC(io, union smb_ioctl);
 
io->ioctl.level = RAW_IOCTL_IOCTL;
io->ioctl.in.fnum = req_fnum(req, req->in.vwv, VWV(0));
@@ -257,7 +257,7 @@
 {
struct smb_chkpath *io;
 
-   REQ_TALLOC(io, sizeof(*io));
+   REQ_TALLOC(io, struct smb_chkpath);
 
req_pull_ascii4(req, &io->in.path, req->in.data, STR_TERMINATE);
 
@@ -298,7 +298,7 @@
 {
union smb_fileinfo *st;
 
-   REQ_TALLOC(st, sizeof(*st));
+   REQ_TALLOC(st, union smb_fileinfo);

st->getattr.level = RAW_FILEINFO_GETATTR;
 
@@ -329,7 +329,7 @@
 
/* parse request */
REQ_CHECK_WCT(req, 8);
-   REQ_TALLOC(st, sizeof(*st));
+   REQ_TALLOC(st, union smb_setfileinfo);
 
st->setattr.level = RAW_SFILEINFO_SETATTR;
st->setattr.in.attrib = SVAL(req->in.vwv, VWV(0));
@@ -382,7 +382,7 @@
 {
union smb_fsinfo *fs;
 
-   REQ_TALLOC(fs, sizeof(*fs));
+   REQ_TALLOC(fs, union smb_fsinfo);

fs->dskattr.level = RAW_QFS_DSKATTR;
 
@@ -428,7 +428,7 @@
 
/* parse request */
REQ_CHECK_WCT(req, 2);
-   REQ_TALLOC(oi, sizeof(*oi));
+   REQ_TALLOC(oi, union smb_open);
 
oi->openold.level = RAW_OPEN_OPEN;
oi->openold.in.open_mode = SVAL(req->in.vwv, VWV(0));
@@ -500,7 +500,7 @@
 
/* parse the request */
REQ_CHECK_WCT(req, 15);
-   REQ_TALLOC(oi, sizeof(*oi));
+   REQ_TALLOC(oi, union smb_open);
 
oi->openx.level = RAW_OPEN_OPENX;
oi->openx.in.flags= SVAL(req->in.vwv, VWV(2));
@@ -557,7 +557,7 @@
 
/* parse the request */
REQ_CHECK_WCT(req, 3);
-   REQ_TALLOC(oi, sizeof(*oi));
+   REQ_TALLOC(oi, union smb_open);
 
if (CVAL(req->in.hdr, HDR_COM) == SMBmknew) {
oi->mknew.level = RAW_OPEN_MKNEW;
@@ -613,7 +613,7 @@
 
/* parse the request */
REQ_CHECK_WCT(req, 3);
-   REQ_TALLOC(oi, sizeof(*oi));
+   REQ_TALLOC(oi, union smb_open);
 
oi->ctemp.level = RAW_OPEN_CTEMP;
oi->ctemp.in.attrib = SVAL(req->in.vwv, VWV(0));
@@ -648,7 +648,7 @@
 
/* parse the request */
REQ_CHECK_WCT(req, 1);
-   REQ_TALLOC(unl, sizeof(*unl));
+   REQ_TALLOC(unl, struct smb_unlink);

unl->in.attrib = SVAL(req->in.vwv, VWV(0));
 
@@ -763,7 +763,7 @@

/* parse request */
REQ_CHECK_WCT(req, 5);
-   REQ_TALLOC(io, sizeof(*io));
+   REQ_TALLOC(io, union smb_read);
 
io->lockread.level = RAW_READ_LOCKREAD;
io->lockread.in.fnum  = req_fnum(req, req->in.vwv, VWV(0));
@@ -822,7 +822,7 @@
 
/* parse request */
REQ_CHECK_WCT(req, 5);
-   REQ_TALLOC(io, sizeof(*io));
+   REQ_TALLOC(io, union smb_read);

io->read.level = RAW_READ_READ;
io->read.in.fnum  = req_fnum(req, req->in.vwv, VWV(0));
@@ -892,7 +892,7 @@
REQ_CHECK_WCT(req, 10);
}
 
-   REQ_TALLOC(io, sizeof(*io));
+   REQ_TALLOC(io, union smb_read);
 
io->readx.level = RAW_READ_READX;
io->readx.in.fnum  = req_fnum(req, req->in.vwv, VWV(2));
@@ -970,7 +970,7 @@
union smb_write *io;
 
REQ_CHECK_WCT(req, 5);
-   REQ_TALLOC(io, sizeof(*io));
+   REQ_TALLOC(io, union smb_write);
 
io->writeunlock.level = RAW_WRITE_WRITEUNLOCK;
io->writeunlock.in.fnum= req_fnum(req, req->in.vwv, VWV(0));
@@ -1028,7 +1028,7 @@
union smb_write *io;
 
REQ_CHECK_WCT(req, 5);
-   REQ_TALLOC(io, sizeof(*io));
+   REQ_TALLOC(io, union smb_write);
 
io->write.level = RAW_WRITE_WRITE;
io->write.in.fnum= req_fnum(req, req->in.vwv, VWV(0));
@@ -1093,7 +1093,7 @@
REQ_CHECK_WCT(req, 12);
}
 
-   REQ_TALLOC(io, sizeof(*io));
+   REQ_TALLOC(io, uni

svn commit: samba r14015 - in trunk/source/rpc_parse: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 06:17:00 + (Wed, 08 Mar 2006)
New Revision: 14015

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

Log:
Coverity paranoia. Shut it up by making the guarentee
in the code explicit - but this was a false positive (CID #16).
Jeremy.

Modified:
   trunk/source/rpc_parse/parse_buffer.c


Changeset:
Modified: trunk/source/rpc_parse/parse_buffer.c
===
--- trunk/source/rpc_parse/parse_buffer.c   2006-03-08 06:16:54 UTC (rev 
14014)
+++ trunk/source/rpc_parse/parse_buffer.c   2006-03-08 06:17:00 UTC (rev 
14015)
@@ -47,7 +47,7 @@
 {
prs_debug(ps, depth, desc, "prs_rpcbuffer");
depth++;
-   
+
/* reading */
if (UNMARSHALLING(ps)) {
buffer->size=0;
@@ -135,7 +135,12 @@
}
return True;
}
-   
+
+   /* Coverity paranoia. Buffer must be valid. */
+   if (!*buffer) {
+   return False;
+   }
+
return prs_rpcbuffer( desc, ps, depth, *buffer);
 }
 



svn commit: samba r14014 - in branches/SAMBA_3_0/source/rpc_parse: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 06:16:54 + (Wed, 08 Mar 2006)
New Revision: 14014

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

Log:
Coverity paranoia. Shut it up by making the guarentee
in the code explicit - but this was a false positive (CID #16).
Jeremy.

Modified:
   branches/SAMBA_3_0/source/rpc_parse/parse_buffer.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_parse/parse_buffer.c
===
--- branches/SAMBA_3_0/source/rpc_parse/parse_buffer.c  2006-03-08 05:47:51 UTC 
(rev 14013)
+++ branches/SAMBA_3_0/source/rpc_parse/parse_buffer.c  2006-03-08 06:16:54 UTC 
(rev 14014)
@@ -47,7 +47,7 @@
 {
prs_debug(ps, depth, desc, "prs_rpcbuffer");
depth++;
-   
+
/* reading */
if (UNMARSHALLING(ps)) {
buffer->size=0;
@@ -135,7 +135,12 @@
}
return True;
}
-   
+
+   /* Coverity paranoia. Buffer must be valid. */
+   if (!*buffer) {
+   return False;
+   }
+
return prs_rpcbuffer( desc, ps, depth, *buffer);
 }
 



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

2006-03-07 Thread tridge
Author: tridge
Date: 2006-03-08 05:47:51 + (Wed, 08 Mar 2006)
New Revision: 14013

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

Log:

added construction of the notify reply buffer in the nttrans server
code

the RAW-NOTIFY test now passes against the CIFS backend

Modified:
   branches/SAMBA_4_0/source/smb_server/smb/nttrans.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb/nttrans.c
===
--- branches/SAMBA_4_0/source/smb_server/smb/nttrans.c  2006-03-08 05:46:09 UTC 
(rev 14012)
+++ branches/SAMBA_4_0/source/smb_server/smb/nttrans.c  2006-03-08 05:47:51 UTC 
(rev 14013)
@@ -39,17 +39,25 @@
 
 
 /* setup a nttrans reply, given the data and params sizes */
-static void nttrans_setup_reply(struct smbsrv_request *req, 
-  struct smb_nttrans *trans,
-  uint16_t param_size, uint16_t data_size,
-  uint16_t setup_count)
+static NTSTATUS nttrans_setup_reply(struct nttrans_op *op, 
+   struct smb_nttrans *trans,
+   uint16_t param_size, uint16_t data_size,
+   uint16_t setup_count)
 {
trans->out.setup_count = setup_count;
if (setup_count != 0) {
-   trans->out.setup = talloc_zero_array(req, uint16_t, 
setup_count);
+   trans->out.setup = talloc_zero_array(op, uint16_t, setup_count);
+   NT_STATUS_HAVE_NO_MEMORY(trans->out.setup);
}
-   trans->out.params = data_blob_talloc(req, NULL, param_size);
-   trans->out.data = data_blob_talloc(req, NULL, data_size);
+   trans->out.params = data_blob_talloc(op, NULL, param_size);
+   if (param_size != 0) {
+   NT_STATUS_HAVE_NO_MEMORY(trans->out.params.data);
+   }
+   trans->out.data = data_blob_talloc(op, NULL, data_size);
+   if (data_size != 0) {
+   NT_STATUS_HAVE_NO_MEMORY(trans->out.data.data);
+   }
+   return NT_STATUS_OK;
 }
 
 /*
@@ -296,6 +304,7 @@
uint8_t filter;
BOOL fsctl;
DATA_BLOB *blob;
+   NTSTATUS status;
 
/* should have at least 4 setup words */
if (trans->in.setup_count != 4) {
@@ -318,7 +327,9 @@
nt->ntioctl.in.fsctl = fsctl;
nt->ntioctl.in.filter = filter;
 
-   nttrans_setup_reply(req, trans, 0, 0, 1);
+   status = nttrans_setup_reply(op, trans, 0, 0, 1);
+   NT_STATUS_NOT_OK_RETURN(status);
+
trans->out.setup[0] = 0;

return ntvfs_ioctl(req, nt);
@@ -330,7 +341,49 @@
  */
 static NTSTATUS nttrans_notify_change_send(struct nttrans_op *op)
 {
-   return NT_STATUS_NOT_IMPLEMENTED;
+   struct smb_notify *info = talloc_get_type(op->op_info, struct 
smb_notify);
+   size_t size = 0;
+   int i;
+   NTSTATUS status;
+   uint32_t ofs=0;
+   uint8_t *p;
+#define MAX_BYTES_PER_CHAR 3
+   
+   /* work out how big the reply buffer could be */
+   for (i=0;iout.num_changes;i++) {
+   size += 12 + 3 + (1+strlen(info->out.changes[i].name.s)) * 
MAX_BYTES_PER_CHAR;
+   }
+
+   status = nttrans_setup_reply(op, op->trans, size, 0, 0);
+   NT_STATUS_NOT_OK_RETURN(status);
+
+   p = op->trans->out.params.data;
+
+   /* construct the changes buffer */
+   for (i=0;iout.num_changes;i++) {
+   ssize_t len;
+
+   SIVAL(p, 4, info->out.changes[i].action);
+   len = push_string(p + 12, info->out.changes[i].name.s, 
+ op->trans->out.params.length - (ofs+12), 
STR_UNICODE);
+   SIVAL(p, 8, len);
+   
+   ofs += len + 12;
+
+   if (ofs & 3) {
+   int pad = 4 - (ofs & 3);
+   memset(p+ofs, 0, pad);
+   ofs += pad;
+   }
+
+   SIVAL(p, 0, ofs);
+
+   p = op->trans->out.params.data + ofs;
+   }
+
+   op->trans->out.params.length = ofs;
+
+   return NT_STATUS_OK;
 }
 
 /* 



svn commit: samba r14012 - in branches/SAMBA_4_0/source/ntvfs/cifs: .

2006-03-07 Thread tridge
Author: tridge
Date: 2006-03-08 05:46:09 + (Wed, 08 Mar 2006)
New Revision: 14012

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

Log:

added support for the SMBntcancel operation in the cifs ntvfs
backend. This requires keeping a list of outstanding requests so the
MID can be matched. Use a talloc destructor to manage the list.



Modified:
   branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c
===
--- branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c 2006-03-08 03:54:24 UTC 
(rev 14011)
+++ branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c 2006-03-08 05:46:09 UTC 
(rev 14012)
@@ -32,19 +32,24 @@
 #include "smbd/service_stream.h"
 #include "auth/auth.h"
 #include "ntvfs/ntvfs.h"
+#include "include/dlinklist.h"
 
 /* this is stored in ntvfs_private */
 struct cvfs_private {
struct smbcli_tree *tree;
struct smbcli_transport *transport;
struct smbsrv_tcon *tcon;
+   struct async_info *pending;
BOOL map_generic;
 };
 
 
 /* a structure used to pass information to an async handler */
 struct async_info {
+   struct async_info *next, *prev;
+   struct cvfs_private *cvfs;
struct smbsrv_request *req;
+   struct smbcli_request *c_req;
void *parms;
 };
 
@@ -93,11 +98,10 @@
 
machine_account = lp_parm_bool(req->tcon->service, "cifs", 
"use_machine_account", False);
 
-   private = talloc(ntvfs, struct cvfs_private);
+   private = talloc_zero(ntvfs, struct cvfs_private);
if (!private) {
return NT_STATUS_NO_MEMORY;
}
-   ZERO_STRUCTP(private);
 
ntvfs->private_data = private;
 
@@ -184,6 +188,16 @@
 }
 
 /*
+  destroy an async info structure
+*/
+static int async_info_destructor(void *p)
+{
+   struct async_info *async = talloc_get_type(p, struct async_info);
+   DLIST_REMOVE(async->cvfs->pending, async);
+   return 0;
+}
+
+/*
   a handler for simple async replies
   this handler can only be used for functions that don't return any
   parameters (those that just return a status code)
@@ -206,7 +220,11 @@
if (!async) return NT_STATUS_NO_MEMORY; \
async->parms = io; \
async->req = req; \
+   async->cvfs = private; \
+   async->c_req = c_req; \
+   DLIST_ADD(private->pending, async); \
c_req->async.private = async; \
+   talloc_set_destructor(async, async_info_destructor); \
} \
c_req->async.fn = async_fn; \
req->async_states->state |= NTVFS_ASYNC_STATE_ASYNC; \
@@ -673,7 +691,21 @@
 static NTSTATUS cvfs_cancel(struct ntvfs_module_context *ntvfs, 
struct smbsrv_request *req)
 {
-   return NT_STATUS_NOT_IMPLEMENTED;
+   struct cvfs_private *private = ntvfs->private_data;
+
+   /* find the matching request */
+   struct async_info *a;
+   for (a=private->pending;a;a=a->next) {
+   if (SVAL(a->req->in.hdr, HDR_MID) == SVAL(req->in.hdr, 
HDR_MID)) {
+   break;
+   }
+   }
+
+   if (a == NULL) {
+   return NT_STATUS_INVALID_PARAMETER;
+   }
+
+   return smb_raw_ntcancel(a->c_req);
 }
 
 /*



svn commit: samba r14011 - in branches/SAMBA_4_0/source: ntvfs ntvfs/cifs smb_server/smb

2006-03-07 Thread tridge
Author: tridge
Date: 2006-03-08 03:54:24 + (Wed, 08 Mar 2006)
New Revision: 14011

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

Log:

- added a ntvfs_notify op to allow backends to support change notify
- converted the nttrans server side code to be async (needed for change notify)

This is the start of some work on supporting change notify via a new
approach. More soon.

Modified:
   branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c
   branches/SAMBA_4_0/source/ntvfs/ntvfs.h
   branches/SAMBA_4_0/source/ntvfs/ntvfs_interface.c
   branches/SAMBA_4_0/source/smb_server/smb/nttrans.c


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


svn commit: samba r14010 - in trunk/source/client: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 02:05:41 + (Wed, 08 Mar 2006)
New Revision: 14010

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

Log:
Remove last const warning (have to use CONST_DISCARD).
Jeremy.

Modified:
   trunk/source/client/mount.cifs.c


Changeset:
Modified: trunk/source/client/mount.cifs.c
===
--- trunk/source/client/mount.cifs.c2006-03-08 02:05:36 UTC (rev 14009)
+++ trunk/source/client/mount.cifs.c2006-03-08 02:05:41 UTC (rev 14010)
@@ -59,6 +59,8 @@
 #define MS_MOVE 8192 
 #endif 
 
+#define CONST_DISCARD(type, ptr)  ((type) ((void *) (ptr)))
+
 const char *thisprogram;
 int verboseflag = 0;
 static int got_password = 0;
@@ -1206,7 +1208,7 @@
if(pmntfile) {
mountent.mnt_fsname = share_name;
mountent.mnt_dir = mountpoint; 
-   mountent.mnt_type = "cifs"; 
+   mountent.mnt_type = CONST_DISCARD(char *,"cifs"); 
mountent.mnt_opts = malloc(220);
if(mountent.mnt_opts) {
char * mount_user = getusername();



svn commit: samba r14009 - in branches/SAMBA_3_0/source/client: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 02:05:36 + (Wed, 08 Mar 2006)
New Revision: 14009

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

Log:
Remove last const warning (have to use CONST_DISCARD).
Jeremy.

Modified:
   branches/SAMBA_3_0/source/client/mount.cifs.c


Changeset:
Modified: branches/SAMBA_3_0/source/client/mount.cifs.c
===
--- branches/SAMBA_3_0/source/client/mount.cifs.c   2006-03-08 01:43:30 UTC 
(rev 14008)
+++ branches/SAMBA_3_0/source/client/mount.cifs.c   2006-03-08 02:05:36 UTC 
(rev 14009)
@@ -59,6 +59,8 @@
 #define MS_MOVE 8192 
 #endif 
 
+#define CONST_DISCARD(type, ptr)  ((type) ((void *) (ptr)))
+
 const char *thisprogram;
 int verboseflag = 0;
 static int got_password = 0;
@@ -1206,7 +1208,7 @@
if(pmntfile) {
mountent.mnt_fsname = share_name;
mountent.mnt_dir = mountpoint; 
-   mountent.mnt_type = "cifs"; 
+   mountent.mnt_type = CONST_DISCARD(char *,"cifs"); 
mountent.mnt_opts = malloc(220);
if(mountent.mnt_opts) {
char * mount_user = getusername();



svn commit: samba r14008 - in trunk/source/nmbd: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 01:43:30 + (Wed, 08 Mar 2006)
New Revision: 14008

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

Log:
Coverity bug CID #197. Don't compare against 0, we
mean the ttl instead.
Jeremy.

Modified:
   trunk/source/nmbd/nmbd_winsproxy.c


Changeset:
Modified: trunk/source/nmbd/nmbd_winsproxy.c
===
--- trunk/source/nmbd/nmbd_winsproxy.c  2006-03-08 01:43:23 UTC (rev 14007)
+++ trunk/source/nmbd/nmbd_winsproxy.c  2006-03-08 01:43:30 UTC (rev 14008)
@@ -76,7 +76,7 @@
 
/* Add the queried name to the original subnet as a WINS_PROXY_NAME. */
 
-   if(rrec && (rrec == PERMANENT_TTL)) {
+   if(rrec->ttl == PERMANENT_TTL) {
ttl = lp_max_ttl();
}
 



svn commit: samba r14007 - in branches/SAMBA_3_0/source/nmbd: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 01:43:23 + (Wed, 08 Mar 2006)
New Revision: 14007

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

Log:
Coverity bug CID #197. Don't compare against 0, we
mean the ttl instead.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/nmbd/nmbd_winsproxy.c


Changeset:
Modified: branches/SAMBA_3_0/source/nmbd/nmbd_winsproxy.c
===
--- branches/SAMBA_3_0/source/nmbd/nmbd_winsproxy.c 2006-03-08 01:40:15 UTC 
(rev 14006)
+++ branches/SAMBA_3_0/source/nmbd/nmbd_winsproxy.c 2006-03-08 01:43:23 UTC 
(rev 14007)
@@ -76,7 +76,7 @@
 
/* Add the queried name to the original subnet as a WINS_PROXY_NAME. */
 
-   if(rrec && (rrec == PERMANENT_TTL)) {
+   if(rrec->ttl == PERMANENT_TTL) {
ttl = lp_max_ttl();
}
 



svn commit: samba r14006 - in branches/SAMBA_3_0/source/client: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 01:40:15 + (Wed, 08 Mar 2006)
New Revision: 14006

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

Log:
Fix a couple of irritating warnings.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/client/mount.cifs.c


Changeset:
Modified: branches/SAMBA_3_0/source/client/mount.cifs.c
===
--- branches/SAMBA_3_0/source/client/mount.cifs.c   2006-03-08 01:39:58 UTC 
(rev 14005)
+++ branches/SAMBA_3_0/source/client/mount.cifs.c   2006-03-08 01:40:15 UTC 
(rev 14006)
@@ -59,7 +59,7 @@
 #define MS_MOVE 8192 
 #endif 
 
-char * thisprogram;
+const char *thisprogram;
 int verboseflag = 0;
 static int got_password = 0;
 static int got_user = 0;
@@ -301,7 +301,7 @@
 
 static int parse_options(char ** optionsp, int * filesys_flags)
 {
-   char * data;
+   const char * data;
char * percent_char = NULL;
char * value = NULL;
char * next_keyword = NULL;



svn commit: samba r14005 - in trunk/source/client: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 01:39:58 + (Wed, 08 Mar 2006)
New Revision: 14005

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

Log:
Fix a couple of irritating warnings :-).
Jeremy.

Modified:
   trunk/source/client/mount.cifs.c


Changeset:
Modified: trunk/source/client/mount.cifs.c
===
--- trunk/source/client/mount.cifs.c2006-03-08 01:18:23 UTC (rev 14004)
+++ trunk/source/client/mount.cifs.c2006-03-08 01:39:58 UTC (rev 14005)
@@ -59,7 +59,7 @@
 #define MS_MOVE 8192 
 #endif 
 
-char * thisprogram;
+const char *thisprogram;
 int verboseflag = 0;
 static int got_password = 0;
 static int got_user = 0;
@@ -301,7 +301,7 @@
 
 static int parse_options(char ** optionsp, int * filesys_flags)
 {
-   char * data;
+   const char * data;
char * percent_char = NULL;
char * value = NULL;
char * next_keyword = NULL;



svn commit: samba r14003 - in branches/SAMBA_3_0/source/printing: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 01:18:18 + (Wed, 08 Mar 2006)
New Revision: 14003

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

Log:
Clarify code that lead to Coverity report #13.
Not a bug, but better to remove false positives.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/printing/lpq_parse.c
   branches/SAMBA_3_0/source/printing/print_generic.c


Changeset:
Modified: branches/SAMBA_3_0/source/printing/lpq_parse.c
===
--- branches/SAMBA_3_0/source/printing/lpq_parse.c  2006-03-08 01:04:17 UTC 
(rev 14002)
+++ branches/SAMBA_3_0/source/printing/lpq_parse.c  2006-03-08 01:18:18 UTC 
(rev 14003)
@@ -971,7 +971,7 @@
   }
 
   /* in the LPRNG case, we skip lines starting by a space.*/
-  if (line && !ret && (printing_type==PRINT_LPRNG) )
+  if (!ret && (printing_type==PRINT_LPRNG) )
   {
if (line[0]==' ')
return ret;

Modified: branches/SAMBA_3_0/source/printing/print_generic.c
===
--- branches/SAMBA_3_0/source/printing/print_generic.c  2006-03-08 01:04:17 UTC 
(rev 14002)
+++ branches/SAMBA_3_0/source/printing/print_generic.c  2006-03-08 01:18:18 UTC 
(rev 14003)
@@ -193,21 +193,24 @@
/* turn the lpq output into a series of job structures */
qcount = 0;
ZERO_STRUCTP(status);
-   if (numlines)
+   if (numlines) {
queue = SMB_MALLOC_ARRAY(print_queue_struct, numlines+1);
+   if (!queue) {
+   file_lines_free(qlines);
+   *q = NULL;
+   return 0;
+   }
+   }
 
-   if (queue) {
-   memset(queue, '\0', sizeof(print_queue_struct)*(numlines+1));
-   for (i=0; i

svn commit: samba r14004 - in trunk/source/printing: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 01:18:23 + (Wed, 08 Mar 2006)
New Revision: 14004

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

Log:
Clarify code that lead to Coverity report #13.
Not a bug, but better to remove false positives.
Jeremy.

Modified:
   trunk/source/printing/lpq_parse.c
   trunk/source/printing/print_generic.c


Changeset:
Modified: trunk/source/printing/lpq_parse.c
===
--- trunk/source/printing/lpq_parse.c   2006-03-08 01:18:18 UTC (rev 14003)
+++ trunk/source/printing/lpq_parse.c   2006-03-08 01:18:23 UTC (rev 14004)
@@ -971,7 +971,7 @@
   }
 
   /* in the LPRNG case, we skip lines starting by a space.*/
-  if (line && !ret && (printing_type==PRINT_LPRNG) )
+  if (!ret && (printing_type==PRINT_LPRNG) )
   {
if (line[0]==' ')
return ret;

Modified: trunk/source/printing/print_generic.c
===
--- trunk/source/printing/print_generic.c   2006-03-08 01:18:18 UTC (rev 
14003)
+++ trunk/source/printing/print_generic.c   2006-03-08 01:18:23 UTC (rev 
14004)
@@ -193,21 +193,24 @@
/* turn the lpq output into a series of job structures */
qcount = 0;
ZERO_STRUCTP(status);
-   if (numlines)
+   if (numlines) {
queue = SMB_MALLOC_ARRAY(print_queue_struct, numlines+1);
+   if (!queue) {
+   file_lines_free(qlines);
+   *q = NULL;
+   return 0;
+   }
+   }
 
-   if (queue) {
-   memset(queue, '\0', sizeof(print_queue_struct)*(numlines+1));
-   for (i=0; i

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

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 01:04:17 + (Wed, 08 Mar 2006)
New Revision: 14002

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

Log:
Quick fix for Coverity CID #12.
Jeremy

Modified:
   branches/SAMBA_3_0/source/lib/secdesc.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/secdesc.c
===
--- branches/SAMBA_3_0/source/lib/secdesc.c 2006-03-08 01:04:15 UTC (rev 
14001)
+++ branches/SAMBA_3_0/source/lib/secdesc.c 2006-03-08 01:04:17 UTC (rev 
14002)
@@ -73,6 +73,10 @@
goto done;
}
 
+   if (!s1 || !s2) {
+   return False;
+   }
+
/* Check top level stuff */
 
if (s1->revision != s2->revision) {



svn commit: samba r14001 - in trunk/source/lib: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 01:04:15 + (Wed, 08 Mar 2006)
New Revision: 14001

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

Log:
Quick fix for Coverity CID #12.
Jeremy

Modified:
   trunk/source/lib/secdesc.c


Changeset:
Modified: trunk/source/lib/secdesc.c
===
--- trunk/source/lib/secdesc.c  2006-03-08 01:01:40 UTC (rev 14000)
+++ trunk/source/lib/secdesc.c  2006-03-08 01:04:15 UTC (rev 14001)
@@ -73,6 +73,10 @@
goto done;
}
 
+   if (!s1 || !s2) {
+   return False;
+   }
+
/* Check top level stuff */
 
if (s1->revision != s2->revision) {



svn commit: samba r14000 - in trunk/source/lib: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 01:01:40 + (Wed, 08 Mar 2006)
New Revision: 14000

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

Log:
Quick fix for Coverity bug #11.
Jeremy.

Modified:
   trunk/source/lib/secace.c


Changeset:
Modified: trunk/source/lib/secace.c
===
--- trunk/source/lib/secace.c   2006-03-08 01:01:34 UTC (rev 13999)
+++ trunk/source/lib/secace.c   2006-03-08 01:01:40 UTC (rev 14000)
@@ -149,8 +149,14 @@
 {
/* Trivial case */
 
-   if (!s1 && !s2) return True;
+   if (!s1 && !s2) {
+   return True;
+   }
 
+   if (!s1 || !s2) {
+   return False;
+   }
+
/* Check top level stuff */
 
if (s1->type != s2->type || s1->flags != s2->flags ||



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

2006-03-07 Thread jra
Author: jra
Date: 2006-03-08 01:01:34 + (Wed, 08 Mar 2006)
New Revision: 13999

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

Log:
Quick fix for Coverity bug #11.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/lib/secace.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/secace.c
===
--- branches/SAMBA_3_0/source/lib/secace.c  2006-03-08 01:01:14 UTC (rev 
13998)
+++ branches/SAMBA_3_0/source/lib/secace.c  2006-03-08 01:01:34 UTC (rev 
13999)
@@ -149,8 +149,14 @@
 {
/* Trivial case */
 
-   if (!s1 && !s2) return True;
+   if (!s1 && !s2) {
+   return True;
+   }
 
+   if (!s1 || !s2) {
+   return False;
+   }
+
/* Check top level stuff */
 
if (s1->type != s2->type || s1->flags != s2->flags ||



svn commit: samba r13998 - in branches/SAMBA_4_0/source: dsdb/samdb/ldb_modules ldap_server lib/ldb/common lib/ldb/modules lib/ldb/tools

2006-03-07 Thread idra
Author: idra
Date: 2006-03-08 01:01:14 + (Wed, 08 Mar 2006)
New Revision: 13998

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

Log:

>From now on ldb_request() will require an alloced request
By freeing the request you will be sure everything down the path get freed.

this also means you have to steal the results if you want to keep them :)

simo.


Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/extended_dn.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/proxy.c
   branches/SAMBA_4_0/source/ldap_server/ldap_backend.c
   branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
   branches/SAMBA_4_0/source/lib/ldb/modules/paged_results.c
   branches/SAMBA_4_0/source/lib/ldb/modules/sort.c
   branches/SAMBA_4_0/source/lib/ldb/tools/ldbsearch.c


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


Build status as of Wed Mar 8 00:00:02 2006

2006-03-07 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2006-03-07 
00:00:04.0 +
+++ /home/build/master/cache/broken_results.txt 2006-03-08 00:00:04.0 
+
@@ -1,17 +1,17 @@
-Build status as of Tue Mar  7 00:00:02 2006
+Build status as of Wed Mar  8 00:00:02 2006
 
 Build counts:
 Tree Total  Broken Panic 
-ccache   35 6  0 
-distcc   35 4  0 
-lorikeet-heimdal 32 32 0 
-ppp  17 0  0 
+ccache   8  3  0 
+distcc   8  2  0 
+lorikeet-heimdal 30 30 0 
+ppp  15 0  0 
 rsync34 2  0 
-samba3  0  0 
+samba2  0  0 
 samba-docs   0  0  0 
-samba4   36 28 1 
-samba_3_035 8  0 
-smb-build28 6  0 
-talloc   33 14 0 
-tdb  33 3  0 
+samba4   35 28 3 
+samba_3_034 5  0 
+smb-build24 5  0 
+talloc   8  6  0 
+tdb  29 3  0 
 


svn commit: samba r13997 - branches/SAMBA_3_0/source trunk/source

2006-03-07 Thread lmuelle
Author: lmuelle
Date: 2006-03-07 23:04:08 + (Tue, 07 Mar 2006)
New Revision: 13997

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

Log:
Prefix $prefix by default even to rootsbindir as we else run in trouble
if we use ./configure --prefix=dir && make install

Vendors might use ./configure --with-rootsbindir=/sbin && make
DESTDIR=/var/tmp/samba/ install if they use a buildroot.

Thanks to Bj?\195?\182rn Jacke for pointing me at the stderr output of the build
farm.

Modified:
   branches/SAMBA_3_0/source/configure.in
   trunk/source/configure.in


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===
--- branches/SAMBA_3_0/source/configure.in  2006-03-07 21:16:35 UTC (rev 
13996)
+++ branches/SAMBA_3_0/source/configure.in  2006-03-07 23:04:08 UTC (rev 
13997)
@@ -22,7 +22,7 @@
 # ones...
 AC_PREFIX_DEFAULT(/usr/local/samba)
 
-rootsbindir="/sbin"
+rootsbindir="\${prefix}/sbin"
 lockdir="\${VARDIR}/locks"
 piddir="\${VARDIR}/locks"
 mandir="\${prefix}/man"
@@ -66,7 +66,7 @@
 #
 # set root sbin directory location
 AC_ARG_WITH(rootsbindir,
-[  --with-rootsbindir=DIR  Which directory to use for root sbin (/sbin)],
+[  --with-rootsbindir=DIR  Which directory to use for root sbin 
($ac_default_prefix/sbin)],
 [ case "$withval" in
   yes|no)
   #

Modified: trunk/source/configure.in
===
--- trunk/source/configure.in   2006-03-07 21:16:35 UTC (rev 13996)
+++ trunk/source/configure.in   2006-03-07 23:04:08 UTC (rev 13997)
@@ -22,7 +22,7 @@
 # ones...
 AC_PREFIX_DEFAULT(/usr/local/samba)
 
-rootsbindir="/sbin"
+rootsbindir="\${prefix}/sbin"
 lockdir="\${VARDIR}/locks"
 piddir="\${VARDIR}/locks"
 mandir="\${prefix}/man"
@@ -66,7 +66,7 @@
 #
 # set root sbin directory location
 AC_ARG_WITH(rootsbindir,
-[  --with-rootsbindir=DIR  Which directory to use for root sbin (/sbin)],
+[  --with-rootsbindir=DIR  Which directory to use for root sbin 
($ac_default_prefix/sbin)],
 [ case "$withval" in
   yes|no)
   #



svn commit: samba r13996 - in branches/SAMBA_4_0/source/lib/ldb: common include ldb_ildap ldb_ldap ldb_sqlite3 ldb_tdb modules

2006-03-07 Thread idra
Author: idra
Date: 2006-03-07 21:16:35 + (Tue, 07 Mar 2006)
New Revision: 13996

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

Log:

simplify ldb_async_wait() some more


Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
   branches/SAMBA_4_0/source/lib/ldb/include/ldb.h
   branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
   branches/SAMBA_4_0/source/lib/ldb/modules/sort.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
===
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb.c  2006-03-07 21:13:25 UTC 
(rev 13995)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb.c  2006-03-07 21:16:35 UTC 
(rev 13996)
@@ -231,7 +231,7 @@
return status;
 }
 
-int ldb_async_wait(struct ldb_context *ldb, struct ldb_async_handle *handle, 
enum ldb_async_wait_type type)
+int ldb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_type 
type)
 {
return handle->module->ops->async_wait(handle, type);
 }

Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb.h
===
--- branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-03-07 21:13:25 UTC 
(rev 13995)
+++ branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-03-07 21:16:35 UTC 
(rev 13996)
@@ -664,7 +664,7 @@
 
 int ldb_request(struct ldb_context *ldb, struct ldb_request *request);
 
-int ldb_async_wait(struct ldb_context *ldb, struct ldb_async_handle *handle, 
enum ldb_async_wait_type type);
+int ldb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_type 
type);
 
 /**
   Initialise ldbs' global information

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c
===
--- branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c 2006-03-07 
21:13:25 UTC (rev 13995)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c 2006-03-07 
21:16:35 UTC (rev 13996)
@@ -539,7 +539,7 @@
res, &ildb_search_sync_callback, 
ildb->ldap->timeout, &handle);
 
if (ret == LDB_SUCCESS) {
-   ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+   ret = ldb_async_wait(handle, LDB_WAIT_ALL);
talloc_free(handle);
}
 
@@ -616,7 +616,7 @@
if (ret != LDB_SUCCESS)
return ret;
 
-   ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+   ret = ldb_async_wait(handle, LDB_WAIT_ALL);
 
talloc_free(handle);
return ret;
@@ -688,7 +688,7 @@
if (ret != LDB_SUCCESS)
return ret;
 
-   ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+   ret = ldb_async_wait(handle, LDB_WAIT_ALL);
 
talloc_free(handle);
return ret;
@@ -741,7 +741,7 @@
if (ret != LDB_SUCCESS)
return ret;
 
-   ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+   ret = ldb_async_wait(handle, LDB_WAIT_ALL);
 
talloc_free(handle);
return ret;
@@ -813,7 +813,7 @@
if (ret != LDB_SUCCESS)
return ret;
 
-   ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+   ret = ldb_async_wait(handle, LDB_WAIT_ALL);
 
talloc_free(handle);
return ret;

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
===
--- branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c   2006-03-07 
21:13:25 UTC (rev 13995)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c   2006-03-07 
21:16:35 UTC (rev 13996)
@@ -398,7 +398,7 @@
res, &lldb_search_sync_callback, lldb->timeout, 
&handle);
 
if (ret == LDB_SUCCESS) {
-   ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+   ret = ldb_async_wait(handle, LDB_WAIT_ALL);
talloc_free(handle);
}
 
@@ -477,7 +477,7 @@
if (ret != LDB_SUCCESS)
return ret;
 
-   ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+   ret = ldb_async_wait(handle, LDB_WAIT_ALL);
 
talloc_free(handle);
return ret;
@@ -552,7 +552,7 @@
if (ret != LDB_SUCCESS)
return ret;
 
-   ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+   ret = ldb_async_wait(handle, LDB_WAIT_ALL);
 
talloc_free(handle);
return ret;
@@ -615,7 +615,7 @@
if (ret != LDB_SUCCESS)
return ret;
 
-   ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+   ret = ldb_async_wait(handle, LDB_WAIT_ALL);
 
   

svn commit: samba r13995 - in trunk/source/rpc_server: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-07 21:13:25 + (Tue, 07 Mar 2006)
New Revision: 13995

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

Log:
Belt and braces - ensure RPC_BUFFER is valid.
Jeremy.

Modified:
   trunk/source/rpc_server/srv_spoolss_nt.c


Changeset:
Modified: trunk/source/rpc_server/srv_spoolss_nt.c
===
--- trunk/source/rpc_server/srv_spoolss_nt.c2006-03-07 21:13:19 UTC (rev 
13994)
+++ trunk/source/rpc_server/srv_spoolss_nt.c2006-03-07 21:13:25 UTC (rev 
13995)
@@ -4624,11 +4624,13 @@

/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_spoolss_enumprinters\n"));
 
*needed=0;
@@ -4933,11 +4935,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
*needed=0;
 
if (!get_printer_snum(p, handle, &snum))
@@ -5530,11 +5534,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_spoolss_getprinterdriver2\n"));
 
if ( !(printer = find_printer_index_by_hnd( p, handle )) ) {
@@ -6367,9 +6373,12 @@
 {
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) 
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
+   }
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+
r_u->needed = 0;
return WERR_INVALID_PARAM; /* this is what a NT server
returns for AddJob. AddJob
@@ -6579,11 +6588,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_spoolss_enumjobs\n"));
 
*needed=0;
@@ -6944,11 +6955,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_spoolss_enumprinterdrivers\n"));

*needed   = 0;
@@ -7007,11 +7020,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_spoolss_enumforms\n"));
DEBUGADD(5,("Offered buffer size [%d]\n", offered));
DEBUGADD(5,("Info level [%d]\n",  level));
@@ -7114,11 +7129,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
unistr2_to_ascii(form_name, uni_formname, sizeof(form_name)-1);
 
DEBUG(4,("_spoolss_getform\n"));
@@ -7392,11 +7409,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_spoolss_enumports\n"));

*returned=0;
@@ -7800,11 +7819,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer ) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_s

svn commit: samba r13994 - in branches/SAMBA_3_0/source/rpc_server: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-07 21:13:19 + (Tue, 07 Mar 2006)
New Revision: 13994

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

Log:
Belt and braces - ensure RPC_BUFFER is valid.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/rpc_server/srv_spoolss_nt.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_server/srv_spoolss_nt.c
===
--- branches/SAMBA_3_0/source/rpc_server/srv_spoolss_nt.c   2006-03-07 
21:09:53 UTC (rev 13993)
+++ branches/SAMBA_3_0/source/rpc_server/srv_spoolss_nt.c   2006-03-07 
21:13:19 UTC (rev 13994)
@@ -4624,11 +4624,13 @@

/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_spoolss_enumprinters\n"));
 
*needed=0;
@@ -4933,11 +4935,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
*needed=0;
 
if (!get_printer_snum(p, handle, &snum))
@@ -5530,11 +5534,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_spoolss_getprinterdriver2\n"));
 
if ( !(printer = find_printer_index_by_hnd( p, handle )) ) {
@@ -6367,9 +6373,12 @@
 {
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) 
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
+   }
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+
r_u->needed = 0;
return WERR_INVALID_PARAM; /* this is what a NT server
returns for AddJob. AddJob
@@ -6579,11 +6588,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_spoolss_enumjobs\n"));
 
*needed=0;
@@ -6944,11 +6955,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_spoolss_enumprinterdrivers\n"));

*needed   = 0;
@@ -7007,11 +7020,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_spoolss_enumforms\n"));
DEBUGADD(5,("Offered buffer size [%d]\n", offered));
DEBUGADD(5,("Info level [%d]\n",  level));
@@ -7114,11 +7129,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
unistr2_to_ascii(form_name, uni_formname, sizeof(form_name)-1);
 
DEBUG(4,("_spoolss_getform\n"));
@@ -7392,11 +7409,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buffer);
+   buffer = r_u->buffer;
+
DEBUG(4,("_spoolss_enumports\n"));

*returned=0;
@@ -7800,11 +7819,13 @@
 
/* that's an [in out] buffer */
 
-   if ( q_u->buffer ) {
-   rpcbuf_move(q_u->buffer, &r_u->buffer);
-   buffer = r_u->buffer;
+   if (!q_u->buffer ) {
+   return WERR_INVALID_PARAM;
}
 
+   rpcbuf_move(q_u->buffer, &r_u->buf

svn commit: samba r13993 - in branches/SAMBA_4_0/source/lib/ldb/modules: .

2006-03-07 Thread idra
Author: idra
Date: 2006-03-07 21:09:53 + (Tue, 07 Mar 2006)
New Revision: 13993

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

Log:

First prototype of how an async module should be built.
This is NOT tested yet, just compiles.
Committing to share the code and gather comments


Modified:
   branches/SAMBA_4_0/source/lib/ldb/modules/sort.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/modules/sort.c
===
--- branches/SAMBA_4_0/source/lib/ldb/modules/sort.c2006-03-07 21:08:09 UTC 
(rev 13992)
+++ branches/SAMBA_4_0/source/lib/ldb/modules/sort.c2006-03-07 21:09:53 UTC 
(rev 13993)
@@ -43,30 +43,88 @@
int result;
 };
 
-static int build_response(struct ldb_result *res, int result, const char *desc)
+struct sort_async_context {
+   struct ldb_module *module;
+   void *up_context;
+   int (*up_callback)(struct ldb_context *, void *, struct 
ldb_async_result *);
+   int timeout;
+
+   char *attributeName;
+   char *orderingRule;
+   int reverse;
+
+   struct ldb_request *req;
+   struct ldb_message **msgs;
+   char **referrals;
+   struct ldb_control **controls;
+   int num_msgs;
+   int num_refs;
+
+   const struct ldb_attrib_handler *h;
+   int sort_result;
+};
+
+static struct ldb_async_handle *init_handle(void *mem_ctx, struct ldb_module 
*module,
+   void *context,
+   int (*callback)(struct ldb_context 
*, void *, struct ldb_async_result *),
+   int timeout)
 {
+   struct sort_async_context *ac;
+   struct ldb_async_handle *h;
+
+   h = talloc_zero(mem_ctx, struct ldb_async_handle);
+   if (h == NULL) {
+   ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of 
Memory"));
+   return NULL;
+   }
+
+   h->module = module;
+
+   ac = talloc_zero(h, struct sort_async_context);
+   if (ac == NULL) {
+   ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of 
Memory"));
+   talloc_free(h);
+   return NULL;
+   }
+
+   h->private_data = (void *)ac;
+
+   ac->module = module;
+   ac->up_context = context;
+   ac->up_callback = callback;
+   ac->timeout = timeout;
+
+   return h;
+}
+
+static int build_response(void *mem_ctx, struct ldb_control ***ctrls, int 
result, const char *desc)
+{
+   struct ldb_control **controls;
struct ldb_sort_resp_control *resp;
int i;
 
-   if (res->controls) {
-   for (i = 0; res->controls[i]; i++);
-   res->controls = talloc_realloc(res, res->controls, struct 
ldb_control *, i + 2);
+   if (*ctrls) {
+   controls = *ctrls;
+   for (i = 0; controls[i]; i++);
+   controls = talloc_realloc(mem_ctx, controls, struct ldb_control 
*, i + 2);
} else {
i = 0;
-   res->controls = talloc_array(res, struct ldb_control *, 2);
+   controls = talloc_array(mem_ctx, struct ldb_control *, 2);
}
-   if (! res->controls )
+   if (! controls )
return LDB_ERR_OPERATIONS_ERROR;
 
-   res->controls[i+1] = NULL;
-   res->controls[i] = talloc(res->controls, struct ldb_control);
-   if (! res->controls[i] )
+   *ctrls = controls;
+
+   controls[i+1] = NULL;
+   controls[i] = talloc(controls, struct ldb_control);
+   if (! controls[i] )
return LDB_ERR_OPERATIONS_ERROR;
 
-   res->controls[i]->oid = LDB_CONTROL_SORT_RESP_OID;
-   res->controls[i]->critical = 0;
+   controls[i]->oid = LDB_CONTROL_SORT_RESP_OID;
+   controls[i]->critical = 0;
 
-   resp = talloc(res->controls[i], struct ldb_sort_resp_control);
+   resp = talloc(controls[i], struct ldb_sort_resp_control);
if (! resp )
return LDB_ERR_OPERATIONS_ERROR;
 
@@ -76,7 +134,7 @@
if (! resp->attr_desc )
return LDB_ERR_OPERATIONS_ERROR;

-   res->controls[i]->data = resp;
+   controls[i]->data = resp;
 
return LDB_SUCCESS;
 }
@@ -108,23 +166,42 @@
return data->h->comparison_fn(data->ldb, data, &el1->values[0], 
&el2->values[0]);
 }
 
+static int sort_compare_async(struct ldb_message **msg1, struct ldb_message 
**msg2, void *opaque)
+{
+   struct sort_async_context *ac = talloc_get_type(opaque, struct 
sort_async_context);
+   struct ldb_message_element *el1, *el2;
+
+   if (ac->sort_result != 0) {
+   /* an error occurred previously,
+* let's exit the sorting by returning always 0 */
+   return 0;
+   }
+
+   el1 = ldb_msg_find_element(*msg1, ac->attributeName);
+   el2 = ldb_msg_find_element(*msg2, ac->attributeName);
+
+   if (!el1 || !el2

svn commit: samba r13992 - in branches/SAMBA_4_0/source/lib/ldb: common include ldb_ildap ldb_ldap ldb_sqlite3 ldb_tdb

2006-03-07 Thread idra
Author: idra
Date: 2006-03-07 21:08:09 + (Tue, 07 Mar 2006)
New Revision: 13992

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

Log:

change the way ldb_async_wait() works.

I think I should change the name of this function
to ldb_async_process(), any opinions ?


Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
   branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c
   branches/SAMBA_4_0/source/lib/ldb/include/ldb.h
   branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h
   branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
===
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb.c  2006-03-07 21:03:48 UTC 
(rev 13991)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb.c  2006-03-07 21:08:09 UTC 
(rev 13992)
@@ -233,11 +233,7 @@
 
 int ldb_async_wait(struct ldb_context *ldb, struct ldb_async_handle *handle, 
enum ldb_async_wait_type type)
 {
-   struct ldb_module *module;
-
-   FIRST_OP(ldb, async_wait);
-
-   return module->ops->async_wait(module, handle, type);
+   return handle->module->ops->async_wait(handle, type);
 }
 
 /*

Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c
===
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c  2006-03-07 
21:03:48 UTC (rev 13991)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c  2006-03-07 
21:08:09 UTC (rev 13992)
@@ -342,9 +342,3 @@
FIND_OP(module, del_transaction);
return module->ops->del_transaction(module);
 }
-
-int ldb_next_async_wait(struct ldb_module *module, struct ldb_async_handle 
*handle, enum ldb_async_wait_type type)
-{
-   FIND_OP(module, async_wait);
-   return module->ops->async_wait(module, handle, type);
-}

Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb.h
===
--- branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-03-07 21:03:48 UTC 
(rev 13991)
+++ branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-03-07 21:08:09 UTC 
(rev 13992)
@@ -605,6 +605,7 @@
int status;
enum ldb_async_state state;
void *private_data;
+   struct ldb_module *module;
 };
 
 struct ldb_search {

Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h
===
--- branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h 2006-03-07 
21:03:48 UTC (rev 13991)
+++ branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h 2006-03-07 
21:08:09 UTC (rev 13992)
@@ -61,7 +61,7 @@
int (*start_transaction)(struct ldb_module *);
int (*end_transaction)(struct ldb_module *);
int (*del_transaction)(struct ldb_module *);
-   int (*async_wait)(struct ldb_module *, struct ldb_async_handle *, enum 
ldb_async_wait_type);
+   int (*async_wait)(struct ldb_async_handle *, enum ldb_async_wait_type);
 };
 
 typedef int (*ldb_connect_fn) (struct ldb_context *ldb, const char *url, 
unsigned int flags, const char *options[]);

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c
===
--- branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c 2006-03-07 
21:03:48 UTC (rev 13991)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c 2006-03-07 
21:08:09 UTC (rev 13992)
@@ -341,6 +341,8 @@
return LDB_ERR_OPERATIONS_ERROR;
}
 
+   h->module = module;
+
ildb_ac = talloc(h, struct ildb_async_context);
if (ildb_ac == NULL) {
ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of 
Memory"));
@@ -916,7 +918,7 @@
}
 }
 
-static int ildb_async_wait(struct ldb_module *module, struct ldb_async_handle 
*handle, enum ldb_async_wait_type type)
+static int ildb_async_wait(struct ldb_async_handle *handle, enum 
ldb_async_wait_type type)
 {
struct ildb_async_context *ac = talloc_get_type(handle->private_data, 
struct ildb_async_context);
 

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
===
--- branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c   2006-03-07 
21:03:48 UTC (rev 13991)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c   2006-03-07 
21:08:09 UTC (rev 13992)
@@ -76,6 +76,8 @@
return NULL;
}
 
+   h->module = module;
+
ac = talloc(h, struct lldb_async_context);
if (ac == NULL) {
ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of 
Memory"));
@@ -87

svn commit: samba r13991 - branches/SAMBA_3_0/source/libsmb trunk/source/libsmb

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-07 21:03:48 + (Tue, 07 Mar 2006)
New Revision: 13991

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

Log:
Fix Coverity bug # 69
Modified:
   branches/SAMBA_3_0/source/libsmb/samlogon_cache.c
   trunk/source/libsmb/samlogon_cache.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/samlogon_cache.c
===
--- branches/SAMBA_3_0/source/libsmb/samlogon_cache.c   2006-03-07 21:02:11 UTC 
(rev 13990)
+++ branches/SAMBA_3_0/source/libsmb/samlogon_cache.c   2006-03-07 21:03:48 UTC 
(rev 13991)
@@ -208,6 +208,7 @@

if ( !prs_uint32( "timestamp", &ps, 0, &t ) ) {
prs_mem_free( &ps );
+   SAFE_FREE(user);
return False;
}


Modified: trunk/source/libsmb/samlogon_cache.c
===
--- trunk/source/libsmb/samlogon_cache.c2006-03-07 21:02:11 UTC (rev 
13990)
+++ trunk/source/libsmb/samlogon_cache.c2006-03-07 21:03:48 UTC (rev 
13991)
@@ -208,6 +208,7 @@

if ( !prs_uint32( "timestamp", &ps, 0, &t ) ) {
prs_mem_free( &ps );
+   SAFE_FREE(user);
return False;
}




svn commit: samba r13990 - in branches/SAMBA_4_0/source/lib/ldb: common include

2006-03-07 Thread jelmer
Author: jelmer
Date: 2006-03-07 21:02:11 + (Tue, 07 Mar 2006)
New Revision: 13990

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

Log:
Fix issues with function renaming.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c
   branches/SAMBA_4_0/source/lib/ldb/include/includes.h
   branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c
===
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c  2006-03-07 
20:52:43 UTC (rev 13989)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c  2006-03-07 
21:02:11 UTC (rev 13990)
@@ -36,6 +36,10 @@
 #include "includes.h"
 #include "ldb/include/includes.h"
 
+#ifdef _SAMBA_BUILD_
+#include "build.h"
+#endif
+
 #define LDB_MODULE_PREFIX  "modules:"
 #define LDB_MODULE_PREFIX_LEN  8
 

Modified: branches/SAMBA_4_0/source/lib/ldb/include/includes.h
===
--- branches/SAMBA_4_0/source/lib/ldb/include/includes.h2006-03-07 
20:52:43 UTC (rev 13989)
+++ branches/SAMBA_4_0/source/lib/ldb/include/includes.h2006-03-07 
21:02:11 UTC (rev 13990)
@@ -10,8 +10,6 @@
 #include "system/iconv.h"
 #include "system/time.h"
 
-#include "build.h"
-
 /* tell ldb we have the internal ldap code */
 #define HAVE_ILDAP 1
 

Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h
===
--- branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h 2006-03-07 
20:52:43 UTC (rev 13989)
+++ branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h 2006-03-07 
21:02:11 UTC (rev 13990)
@@ -144,7 +144,6 @@
 /* The following definitions come from lib/ldb/common/ldb_ldif.c  */
 int ldb_should_b64_encode(const struct ldb_val *val);
 
-#ifndef _SAMBA_BUILD_
 int ldb_objectclass_init(void);
 int ldb_operational_init(void);
 int ldb_paged_results_init(void);
@@ -155,7 +154,6 @@
 int ldb_ildap_init(void);
 int ldb_tdb_init(void);
 int ldb_sqlite3_init(void);
-#endif
 
 int ldb_match_msg(struct ldb_context *ldb,
  struct ldb_message *msg,



svn commit: samba r13989 - in branches/SAMBA_3_0/source/rpc_parse: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-07 20:52:43 + (Tue, 07 Mar 2006)
New Revision: 13989

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

Log:
Fix for Coverity bug #45 and associated spoolss RPC_BUFFER
problems. Ensure that if the parse succeeds on UNMARSHALL
we have a valid (although possibly empty) RPC_BUFFER returned.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/rpc_parse/parse_buffer.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_parse/parse_buffer.c
===
--- branches/SAMBA_3_0/source/rpc_parse/parse_buffer.c  2006-03-07 20:52:34 UTC 
(rev 13988)
+++ branches/SAMBA_3_0/source/rpc_parse/parse_buffer.c  2006-03-07 20:52:43 UTC 
(rev 13989)
@@ -108,19 +108,34 @@
 
data_p = *buffer ? 0xf000baaa : 0;
 
-   if ( !prs_uint32("ptr", ps, depth, &data_p ))
+   if ( !prs_uint32("ptr", ps, depth, &data_p )) {
return False;
+   }
 
+   /* We must always return a valid buffer pointer even if the
+  client didn't send one - just leave it initialized to null. */
+   if ( UNMARSHALLING(ps) ) {
+   if ( !(*buffer = PRS_ALLOC_MEM(ps, RPC_BUFFER, 1)) ) {
+   return False;
+   }
+   }
+
/* we're done if there is no data */
 
-   if ( !data_p )
+   if (!data_p) {
+   if (UNMARSHALLING(ps)) {
+   RPC_BUFFER *pbuffer = *buffer;
+   /* On unmarshalling we must return a valid,
+  but zero size value RPC_BUFFER. */
+   pbuffer->size = 0;
+   pbuffer->string_at_end = 0;
+   if (!prs_init(&pbuffer->prs, 0, 
prs_get_mem_context(ps), UNMARSHALL)) {
+   return False;
+   }
+   }
return True;
+   }

-   if ( UNMARSHALLING(ps) ) {
-   if ( !(*buffer = PRS_ALLOC_MEM(ps, RPC_BUFFER, 1)) )
-   return False;
-   }
-
return prs_rpcbuffer( desc, ps, depth, *buffer);
 }
 



svn commit: samba r13988 - in trunk/source/rpc_parse: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-07 20:52:34 + (Tue, 07 Mar 2006)
New Revision: 13988

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

Log:
Fix for Coverity bug #45 and associated spoolss RPC_BUFFER
problems. Ensure that if the parse succeeds on UNMARSHALL
we have a valid (although possibly empty) RPC_BUFFER returned.
Jeremy.

Modified:
   trunk/source/rpc_parse/parse_buffer.c


Changeset:
Modified: trunk/source/rpc_parse/parse_buffer.c
===
--- trunk/source/rpc_parse/parse_buffer.c   2006-03-07 20:44:12 UTC (rev 
13987)
+++ trunk/source/rpc_parse/parse_buffer.c   2006-03-07 20:52:34 UTC (rev 
13988)
@@ -108,19 +108,34 @@
 
data_p = *buffer ? 0xf000baaa : 0;
 
-   if ( !prs_uint32("ptr", ps, depth, &data_p ))
+   if ( !prs_uint32("ptr", ps, depth, &data_p )) {
return False;
+   }
 
+   /* We must always return a valid buffer pointer even if the
+  client didn't send one - just leave it initialized to null. */
+   if ( UNMARSHALLING(ps) ) {
+   if ( !(*buffer = PRS_ALLOC_MEM(ps, RPC_BUFFER, 1)) ) {
+   return False;
+   }
+   }
+
/* we're done if there is no data */
 
-   if ( !data_p )
+   if (!data_p) {
+   if (UNMARSHALLING(ps)) {
+   RPC_BUFFER *pbuffer = *buffer;
+   /* On unmarshalling we must return a valid,
+  but zero size value RPC_BUFFER. */
+   pbuffer->size = 0;
+   pbuffer->string_at_end = 0;
+   if (!prs_init(&pbuffer->prs, 0, 
prs_get_mem_context(ps), UNMARSHALL)) {
+   return False;
+   }
+   }
return True;
+   }

-   if ( UNMARSHALLING(ps) ) {
-   if ( !(*buffer = PRS_ALLOC_MEM(ps, RPC_BUFFER, 1)) )
-   return False;
-   }
-
return prs_rpcbuffer( desc, ps, depth, *buffer);
 }
 



svn commit: samba r13987 - branches/SAMBA_3_0/source/libsmb trunk/source/libsmb

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-07 20:44:12 + (Tue, 07 Mar 2006)
New Revision: 13987

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

Log:
Fix Coverity bug # 74. This tool is good...

Thanks,

Volker


Modified:
   branches/SAMBA_3_0/source/libsmb/namequery.c
   trunk/source/libsmb/namequery.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/namequery.c
===
--- branches/SAMBA_3_0/source/libsmb/namequery.c2006-03-07 20:43:40 UTC 
(rev 13986)
+++ branches/SAMBA_3_0/source/libsmb/namequery.c2006-03-07 20:44:12 UTC 
(rev 13987)
@@ -1126,6 +1126,7 @@
/* if it's in the form of an IP address then get the 
lib to interpret it */
if (((*return_iplist)->ip.s_addr = inet_addr(name)) == 
0x ){
DEBUG(1,("internal_resolve_name: inet_addr 
failed on %s\n", name));
+   SAFE_FREE(*return_iplist);
return False;
}
} else {

Modified: trunk/source/libsmb/namequery.c
===
--- trunk/source/libsmb/namequery.c 2006-03-07 20:43:40 UTC (rev 13986)
+++ trunk/source/libsmb/namequery.c 2006-03-07 20:44:12 UTC (rev 13987)
@@ -1126,6 +1126,7 @@
/* if it's in the form of an IP address then get the 
lib to interpret it */
if (((*return_iplist)->ip.s_addr = inet_addr(name)) == 
0x ){
DEBUG(1,("internal_resolve_name: inet_addr 
failed on %s\n", name));
+   SAFE_FREE(*return_iplist);
return False;
}
} else {



svn commit: samba r13986 - in branches/SAMBA_4_0/source/lib/ldb/ldb_ldap: .

2006-03-07 Thread idra
Author: idra
Date: 2006-03-07 20:43:40 + (Tue, 07 Mar 2006)
New Revision: 13986

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

Log:

minor fixes


Modified:
   branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
===
--- branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c   2006-03-07 
20:42:47 UTC (rev 13985)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c   2006-03-07 
20:43:40 UTC (rev 13986)
@@ -713,6 +713,7 @@
char *errmsgp = NULL;
char **referralsp = NULL;
LDAPControl **serverctrlsp = NULL;
+   int ret;
 
type = ldap_msgtype(result);
 
@@ -763,17 +764,19 @@
lldb_add_msg_attr(ac->module->ldb, 
ares->message, attr, bval);
ldap_value_free_len(bval);
} 
-   
-   ldap_memfree(attr);
}
if (berptr) ber_free(berptr, 0);
 
 
ares->type = LDB_REPLY_ENTRY;
handle->state = LDB_ASYNC_PENDING;
-   handle->status = ac->callback(ac->module->ldb, 
ac->context, ares);
-
-   ldap_msgfree(result);
+   ret = ac->callback(ac->module->ldb, ac->context, ares);
+   if (ret != LDB_SUCCESS) {
+   handle->status = ret;
+   }
+   } else {
+   handle->status = LDB_ERR_PROTOCOL_ERROR;
+   handle->state = LDB_ASYNC_DONE;
}
break;
 
@@ -798,7 +801,10 @@
ares->referral = talloc_strdup(ares, *referralsp);
ares->type = LDB_REPLY_REFERRAL;
handle->state = LDB_ASYNC_PENDING;
-   handle->status = ac->callback(ac->module->ldb, ac->context, 
ares);
+   ret = ac->callback(ac->module->ldb, ac->context, ares);
+   if (ret != LDB_SUCCESS) {
+   handle->status = ret;
+   }
 
break;
 
@@ -823,7 +829,10 @@

ares->type = LDB_REPLY_DONE;
handle->state = LDB_ASYNC_DONE;
-   handle->status = ac->callback(ac->module->ldb, ac->context, 
ares);
+   ret = ac->callback(ac->module->ldb, ac->context, ares);
+   if (ret != LDB_SUCCESS) {
+   handle->status = ret;
+   }
 
break;
 
@@ -845,7 +854,8 @@
break;
 
default:
-   handle->state = LDB_ERR_PROTOCOL_ERROR;
+   handle->status = LDB_ERR_PROTOCOL_ERROR;
+   goto error;
}
 
if (matcheddnp) ldap_memfree(matcheddnp);
@@ -856,10 +866,12 @@
if (referralsp) ldap_value_free(referralsp);
if (serverctrlsp) ldap_controls_free(serverctrlsp);
 
+   ldap_msgfree(result);
return handle->status;
 
 error:
handle->state = LDB_ASYNC_DONE;
+   ldap_msgfree(result);
return handle->status;
 }
 



svn commit: samba r13985 - in branches/SAMBA_4_0/source/scripting: . swig

2006-03-07 Thread idra
Author: idra
Date: 2006-03-07 20:42:47 + (Tue, 07 Mar 2006)
New Revision: 13985

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

Log:

Slowly start swig_ldb

dcerpc still need fixing, the produced shared library misses some symbols.
Jelmer, can you look at it while you are playing with the build system ?



Added:
   branches/SAMBA_4_0/source/scripting/swig/ldb.i
Modified:
   branches/SAMBA_4_0/source/scripting/config.mk
   branches/SAMBA_4_0/source/scripting/swig/dcerpc.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/config.mk
===
--- branches/SAMBA_4_0/source/scripting/config.mk   2006-03-07 20:32:08 UTC 
(rev 13984)
+++ branches/SAMBA_4_0/source/scripting/config.mk   2006-03-07 20:42:47 UTC 
(rev 13985)
@@ -8,6 +8,13 @@
 ###
 
 ###
+# Start LIBRARY swig_ldb
+[LIBRARY::swig_ldb]
+REQUIRED_SUBSYSTEMS = ldb
+# End LIBRARY swig_ldb
+###
+
+###
 # Start LIBRARY swig_dcerpc
 [LIBRARY::swig_dcerpc]
 REQUIRED_SUBSYSTEMS = LIBCLI NDR_MISC LIBBASIC CONFIG RPC_NDR_SAMR RPC_NDR_LSA
@@ -15,7 +22,7 @@
 ###
 
 # Swig extensions
-swig: scripting/swig/_tdb.so scripting/swig/_dcerpc.so
+swig: scripting/swig/_tdb.so scripting/swig/_ldb.so scripting/swig/_dcerpc.so
 
 scripting/swig/tdb_wrap.c: scripting/swig/tdb.i
swig -python scripting/swig/tdb.i
@@ -24,6 +31,13 @@
$(SHLD) $(SHLD_FLAGS) -o scripting/swig/_tdb.so 
scripting/swig/tdb_wrap.o \
$(LIBRARY_swig_tdb_LINK_LIST) $(LIBRARY_swig_tdb_LINK_FLAGS)
 
+scripting/swig/ldb_wrap.c: scripting/swig/ldb.i
+   swig -python scripting/swig/ldb.i
+
+scripting/swig/_ldb.so: scripting/swig/ldb_wrap.o 
$(LIBRARY_swig_ldb_DEPEND_LIST)
+   $(SHLD) $(SHLD_FLAGS) -o scripting/swig/_ldb.so 
scripting/swig/ldb_wrap.o \
+   $(LIBRARY_swig_ldb_LINK_LIST) $(LIBRARY_swig_ldb_LINK_FLAGS)
+
 SWIG_INCLUDES = librpc/gen_ndr/samr.i librpc/gen_ndr/lsa.i 
librpc/gen_ndr/spoolss.i
 
 scripting/swig/dcerpc_wrap.c: scripting/swig/dcerpc.i scripting/swig/samba.i 
scripting/swig/status_codes.i $(SWIG_INCLUDES)

Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
===
--- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2006-03-07 20:32:08 UTC 
(rev 13984)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2006-03-07 20:42:47 UTC 
(rev 13985)
@@ -69,8 +69,7 @@
 
 %init  %{
setup_logging("python", DEBUG_STDOUT);  
-   lp_load(dyn_CONFIGFILE, True, False, False);
-   load_interfaces();
+   lp_load();
ntstatus_exception = PyErr_NewException("_dcerpc.NTSTATUS", NULL, NULL);
werror_exception = PyErr_NewException("_dcerpc.WERROR", NULL, NULL);
PyDict_SetItemString(d, "NTSTATUS", ntstatus_exception);

Added: branches/SAMBA_4_0/source/scripting/swig/ldb.i
===
--- branches/SAMBA_4_0/source/scripting/swig/ldb.i  2006-03-07 20:32:08 UTC 
(rev 13984)
+++ branches/SAMBA_4_0/source/scripting/swig/ldb.i  2006-03-07 20:42:47 UTC 
(rev 13985)
@@ -0,0 +1,88 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   Swig interface to ldb.
+
+   Copyright (C) 2005 Tim Potter <[EMAIL PROTECTED]>
+   Copyright (C) 2006 Simo Sorce <[EMAIL PROTECTED]>
+
+ ** NOTE! The following LGPL license applies to the ldb
+ ** library. This does NOT imply that all of Samba is released
+ ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+%module ldb
+
+%{
+
+/* This symbol is used in both includes.h and Python.h which causes an
+   annoying compiler warning. */
+
+#ifdef HAVE_FSTAT
+#undef HAVE_FSTAT
+#endif
+
+#if (__GNUC__ >= 3)
+/** Use gcc attribute to check printf fns.  a1 is the 1-based index of
+ * the parameter containing the format, and a2 the index of the first
+ * argument. Note that some gcc 2.x versions don't handle this
+ * properly **/
+#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
+#else
+#define PRINTF_ATTRIBUTE(a1, a2)
+#endif
+
+/* Include ldb headers */
+
+/* Treat a uint8_t as an unsigned character */
+typedef unsigne

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

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-07 20:32:08 + (Tue, 07 Mar 2006)
New Revision: 13984

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

Log:
Fix Coverity bug # 98
Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
   trunk/source/nsswitch/winbindd_cache.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2006-03-07 20:24:28 UTC 
(rev 13983)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2006-03-07 20:32:08 UTC 
(rev 13984)
@@ -1469,8 +1469,10 @@
 
(*alias_rids) = TALLOC_ARRAY(mem_ctx, uint32, *num_aliases);
 
-   if ((*num_aliases != 0) && ((*alias_rids) == NULL))
+   if ((*num_aliases != 0) && ((*alias_rids) == NULL)) {
+   centry_free(centry);
return NT_STATUS_NO_MEMORY;
+   }
 
for (i=0; i<(*num_aliases); i++)
(*alias_rids)[i] = centry_uint32(centry);

Modified: trunk/source/nsswitch/winbindd_cache.c
===
--- trunk/source/nsswitch/winbindd_cache.c  2006-03-07 20:24:28 UTC (rev 
13983)
+++ trunk/source/nsswitch/winbindd_cache.c  2006-03-07 20:32:08 UTC (rev 
13984)
@@ -1469,8 +1469,10 @@
 
(*alias_rids) = TALLOC_ARRAY(mem_ctx, uint32, *num_aliases);
 
-   if ((*num_aliases != 0) && ((*alias_rids) == NULL))
+   if ((*num_aliases != 0) && ((*alias_rids) == NULL)) {
+   centry_free(centry);
return NT_STATUS_NO_MEMORY;
+   }
 
for (i=0; i<(*num_aliases); i++)
(*alias_rids)[i] = centry_uint32(centry);



svn commit: samba r13983 - branches/SAMBA_3_0/source/smbd trunk/source/smbd

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-07 20:24:28 + (Tue, 07 Mar 2006)
New Revision: 13983

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

Log:
Fix Coverity bug # 111
Modified:
   branches/SAMBA_3_0/source/smbd/lanman.c
   trunk/source/smbd/lanman.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/lanman.c
===
--- branches/SAMBA_3_0/source/smbd/lanman.c 2006-03-07 20:22:26 UTC (rev 
13982)
+++ branches/SAMBA_3_0/source/smbd/lanman.c 2006-03-07 20:24:28 UTC (rev 
13983)
@@ -1082,6 +1082,7 @@
*servers = SMB_REALLOC_ARRAY(*servers,struct 
srv_info_struct, alloced);
if (!*servers) {
DEBUG(0,("get_server_info: failed to enlarge 
servers info struct!\n"));
+   file_lines_free(lines);
return 0;
}
memset((char 
*)((*servers)+count),'\0',sizeof(**servers)*(alloced-count));

Modified: trunk/source/smbd/lanman.c
===
--- trunk/source/smbd/lanman.c  2006-03-07 20:22:26 UTC (rev 13982)
+++ trunk/source/smbd/lanman.c  2006-03-07 20:24:28 UTC (rev 13983)
@@ -1082,6 +1082,7 @@
*servers = SMB_REALLOC_ARRAY(*servers,struct 
srv_info_struct, alloced);
if (!*servers) {
DEBUG(0,("get_server_info: failed to enlarge 
servers info struct!\n"));
+   file_lines_free(lines);
return 0;
}
memset((char 
*)((*servers)+count),'\0',sizeof(**servers)*(alloced-count));



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

2006-03-07 Thread jelmer
Author: jelmer
Date: 2006-03-07 20:22:26 + (Tue, 07 Mar 2006)
New Revision: 13982

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

Log:
Add support for prototypes spread across multiple lines. Try to keep line 
empty after inserting new prototypes.

Modified:
   branches/SAMBA_4_0/source/script/update-proto.pl


Changeset:
Modified: branches/SAMBA_4_0/source/script/update-proto.pl
===
--- branches/SAMBA_4_0/source/script/update-proto.pl2006-03-07 20:14:47 UTC 
(rev 13981)
+++ branches/SAMBA_4_0/source/script/update-proto.pl2006-03-07 20:22:26 UTC 
(rev 13982)
@@ -3,9 +3,6 @@
 #
 # Copyright (C) 2006 Jelmer Vernooij <[EMAIL PROTECTED]>
 # Published under the GNU GPL
-#
-# TODO:
-#  - update for prototypes that span lines
 
 use strict;
 use warnings;
@@ -52,8 +49,8 @@
 
 =head1 BUGS
 
-Prototypes must appear on one line - they can't be split across multiple lines.
-Some things are erroneously recognized as functions
+Strange complex functions are not recognized. In particular those 
+created by macros or returning (without typedef) function pointers.
 
 =head1 LICENSE
 
@@ -89,6 +86,14 @@
'v|verbose' => sub { $verbose += 1; }
 ) or Usage();
 
+sub count($$)
+{
+   my ($t, $s) = @_;
+   my $count = 0;
+   while($s =~ s/^(.)//) { $count++ if $1 eq $t; }
+   return $count;
+}
+
 my $header = shift @ARGV;
 
 sub process_file($)
@@ -96,18 +101,33 @@
my $file = shift;
open (IN, "<$file");
while (my $line = ) {
-   next if ($line =~ /^\s/);
-   next unless ($line =~ /\(/);
-   next if ($line =~ /^\/|[;]|^#|}|^\s*static/);
-   next unless ($line =~ /^([^(]+)(\s+)(\w+)\s*\((.*)\)\s*{*\s*$/);
+   $_ = $line;
+   next if /^\s/;
+   next unless /\(/;
+   next if /^\/|[;]|^#|}|^\s*static/;
+   s/\/\*(.*?)\*\///g;
+   my $public = s/_PUBLIC_//g;
+   s/_PRINTF_ATTRIBUTE\([^)]+\)//g;
+   next unless 
/^(struct\s+\w+|union\s+\w+|\w+)\s+\**\s*(\w+)\s*\((.*)$/;
 
-   my $name = $3;
+   my $name = $2;
 
next if ($name eq "main");
-   next unless ($1 =~ /^[\*\w\s]+$/);
 
-   $line =~ s/}\s*$//g;
-   $line =~ s/\n//g;
+   # Read continuation lines if any
+   my $prn = 1 + count("(", $3) - count(")", $3);
+
+   while ($prn) {
+   my $l = ;
+   $l or die("EOF while parsing function prototype");
+   $line .= $l;
+   $prn += count("(", $l) - count(")", $l);
+   }
+
+   $line =~ s/\n$//;
+
+   # Strip off possible start of function
+   $line =~ s/{\s*$//g;

$new_protos{$name} = "$line;";
}
@@ -131,35 +151,65 @@
%new_protos = ();
 }
 
+my $blankline_due = 0;
+
 open (HDR, "<$header");
 while (my $line = ) {
-   # Insert prototypes that weren't in the header before
-   if ($line =~ /^\/\* New prototypes are inserted above this 
line.*\*\/\s*$/) {
-   insert_new_protos();
-   print "$line\n";
-   next;
+   if ($line eq "\n") {
+   $blankline_due = 1;
+   $line = ;
}
 
# Recognize C files that prototypes came from
-   if ($line =~ /^\/\* The following definitions come from (.*) \*\//) {
+   if ($line =~ /\/\* The following definitions come from (.*) \*\//) {
insert_new_protos();
+   if ($blankline_due) {
+   print "\n";
+   $blankline_due = 0;
+   }
process_file($1);
print "$line";
next;
}
+
+   if ($blankline_due) {
+   print "\n";
+   $blankline_due = 0;
+   }
+
+   # Insert prototypes that weren't in the header before
+   if ($line =~ /\/\* New prototypes are inserted above this 
line.*\*\/\s*/) {
+   insert_new_protos();
+   print "$line\n";
+   next;
+   }

if ($line =~ /^\s*typedef |^\#|^\s*static/) {
print "$line";
next;
}
 
-   unless ($line =~ /^([^(]+)(\s+)(\w+)\s*\((.*)\)\s*;\s*$/)  {
+   $_ = $line;
+   s/\/\*(.*?)\*\///g;
+   my $public = s/_PUBLIC_//g;
+   s/_PRINTF_ATTRIBUTE\([^)]+\)//g;
+   unless (/^(struct\s+\w+|union\s+\w+|\w+)\s+\**\s*(\w+)\s*\((.*)$/) {
print "$line";
next;
}
 
-   my $name = $3;
+   # Read continuation lines if any
+   my $prn = 1 + count("(", $3) - count(")", $3);
 
+   while ($prn) {
+   my $l = ;
+   $l or die("EOF while parsing function prototype");
+ 

svn commit: samba r13981 - branches/SAMBA_3_0/source/auth trunk/source/auth

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-07 20:14:47 + (Tue, 07 Mar 2006)
New Revision: 13981

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

Log:
Fix Coverity bug # 138
Modified:
   branches/SAMBA_3_0/source/auth/auth_util.c
   trunk/source/auth/auth_util.c


Changeset:
Modified: branches/SAMBA_3_0/source/auth/auth_util.c
===
--- branches/SAMBA_3_0/source/auth/auth_util.c  2006-03-07 19:52:26 UTC (rev 
13980)
+++ branches/SAMBA_3_0/source/auth/auth_util.c  2006-03-07 20:14:47 UTC (rev 
13981)
@@ -76,7 +76,7 @@
DEBUG(5,("attempting to make a user_info for %s (%s)\n", 
internal_username, smb_name));
 
*user_info = SMB_MALLOC_P(auth_usersupplied_info);
-   if (!user_info) {
+   if (*user_info == NULL) {
DEBUG(0,("malloc failed for user_info (size %lu)\n", (unsigned 
long)sizeof(*user_info)));
return NT_STATUS_NO_MEMORY;
}

Modified: trunk/source/auth/auth_util.c
===
--- trunk/source/auth/auth_util.c   2006-03-07 19:52:26 UTC (rev 13980)
+++ trunk/source/auth/auth_util.c   2006-03-07 20:14:47 UTC (rev 13981)
@@ -76,7 +76,7 @@
DEBUG(5,("attempting to make a user_info for %s (%s)\n", 
internal_username, smb_name));
 
*user_info = SMB_MALLOC_P(auth_usersupplied_info);
-   if (!user_info) {
+   if (*user_info == NULL) {
DEBUG(0,("malloc failed for user_info (size %lu)\n", (unsigned 
long)sizeof(*user_info)));
return NT_STATUS_NO_MEMORY;
}



svn commit: samba r13980 - branches/SAMBA_3_0/source/smbd trunk/source/smbd

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-07 19:52:26 + (Tue, 07 Mar 2006)
New Revision: 13980

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

Log:
Fix Coverity bug # 63. Jeremy, could you take a look at this?

Thanks,

Volker


Modified:
   branches/SAMBA_3_0/source/smbd/ipc.c
   trunk/source/smbd/ipc.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/ipc.c
===
--- branches/SAMBA_3_0/source/smbd/ipc.c2006-03-07 19:24:28 UTC (rev 
13979)
+++ branches/SAMBA_3_0/source/smbd/ipc.c2006-03-07 19:52:26 UTC (rev 
13980)
@@ -380,7 +380,7 @@
unsigned int dscnt = SVAL(inbuf,smb_vwv11);
unsigned int dsoff = SVAL(inbuf,smb_vwv12);
unsigned int suwcnt = CVAL(inbuf,smb_vwv13);
-   fstring local_machine_name;
+   char *local_machine_name;
START_PROFILE(SMBtrans);
 
memset(name, '\0',sizeof(name));
@@ -542,12 +542,23 @@
 * WinCE wierdness
 */
 
-   fstrcpy( local_machine_name, get_local_machine_name() );
+   asprintf(&local_machine_name, "\\%s\\", get_local_machine_name());
 
-   if (name[0] == '\\' && (StrnCaseCmp(&name[1],local_machine_name, 
strlen(local_machine_name)) == 0) &&
-   (name[strlen(local_machine_name)+1] == '\\'))
-   name_offset = strlen(local_machine_name)+1;
+   if (local_machine_name == NULL) {
+   srv_signing_trans_stop();
+   SAFE_FREE(data);
+   SAFE_FREE(params);
+   SAFE_FREE(setup);
+   END_PROFILE(SMBtrans);
+   return ERROR_NT(NT_STATUS_NO_MEMORY);
+   }
 
+   if (strnequal(name, local_machine_name, strlen(local_machine_name))) {
+   name_offset = strlen(local_machine_name)-1;
+   }
+
+   SAFE_FREE(local_machine_name);
+
if (strnequal(&name[name_offset], "\\PIPE", strlen("\\PIPE"))) {
name_offset += strlen("\\PIPE");
 

Modified: trunk/source/smbd/ipc.c
===
--- trunk/source/smbd/ipc.c 2006-03-07 19:24:28 UTC (rev 13979)
+++ trunk/source/smbd/ipc.c 2006-03-07 19:52:26 UTC (rev 13980)
@@ -380,7 +380,7 @@
unsigned int dscnt = SVAL(inbuf,smb_vwv11);
unsigned int dsoff = SVAL(inbuf,smb_vwv12);
unsigned int suwcnt = CVAL(inbuf,smb_vwv13);
-   fstring local_machine_name;
+   char *local_machine_name;
START_PROFILE(SMBtrans);
 
memset(name, '\0',sizeof(name));
@@ -542,12 +542,23 @@
 * WinCE wierdness
 */
 
-   fstrcpy( local_machine_name, get_local_machine_name() );
+   asprintf(&local_machine_name, "\\%s\\", get_local_machine_name());
 
-   if (name[0] == '\\' && (StrnCaseCmp(&name[1],local_machine_name, 
strlen(local_machine_name)) == 0) &&
-   (name[strlen(local_machine_name)+1] == '\\'))
-   name_offset = strlen(local_machine_name)+1;
+   if (local_machine_name == NULL) {
+   srv_signing_trans_stop();
+   SAFE_FREE(data);
+   SAFE_FREE(params);
+   SAFE_FREE(setup);
+   END_PROFILE(SMBtrans);
+   return ERROR_NT(NT_STATUS_NO_MEMORY);
+   }
 
+   if (strnequal(name, local_machine_name, strlen(local_machine_name))) {
+   name_offset = strlen(local_machine_name)-1;
+   }
+
+   SAFE_FREE(local_machine_name);
+
if (strnequal(&name[name_offset], "\\PIPE", strlen("\\PIPE"))) {
name_offset += strlen("\\PIPE");
 



svn commit: samba r13979 - branches/SAMBA_3_0/source/passdb trunk/source/passdb

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-07 19:24:28 + (Tue, 07 Mar 2006)
New Revision: 13979

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

Log:
We've dereferenced my_methods already, so there's no point in checking for 
!= NULL. Coverity #149.

Volker


Modified:
   branches/SAMBA_3_0/source/passdb/pdb_ldap.c
   trunk/source/passdb/pdb_ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/pdb_ldap.c
===
--- branches/SAMBA_3_0/source/passdb/pdb_ldap.c 2006-03-07 19:18:56 UTC (rev 
13978)
+++ branches/SAMBA_3_0/source/passdb/pdb_ldap.c 2006-03-07 19:24:28 UTC (rev 
13979)
@@ -1516,7 +1516,7 @@
struct ldapsam_privates *ldap_state = (struct ldapsam_privates 
*)my_methods->private_data;
int rc;

-   if (!my_methods || !newpwd || !dn) {
+   if (!newpwd || !dn) {
return NT_STATUS_INVALID_PARAMETER;
}


Modified: trunk/source/passdb/pdb_ldap.c
===
--- trunk/source/passdb/pdb_ldap.c  2006-03-07 19:18:56 UTC (rev 13978)
+++ trunk/source/passdb/pdb_ldap.c  2006-03-07 19:24:28 UTC (rev 13979)
@@ -1516,7 +1516,7 @@
struct ldapsam_privates *ldap_state = (struct ldapsam_privates 
*)my_methods->private_data;
int rc;

-   if (!my_methods || !newpwd || !dn) {
+   if (!newpwd || !dn) {
return NT_STATUS_INVALID_PARAMETER;
}




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

2006-03-07 Thread jra
Author: jra
Date: 2006-03-07 19:18:56 + (Tue, 07 Mar 2006)
New Revision: 13978

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

Log:
Here is why it's essential to use SAFE_FREE instead of free.
If we use free(data.dptr) and then the subsequent tdb_open
fails in _reg_perfcount_get_counter_data() then data.dptr
is left as a non-zero pointer that has been freed. This would
cause it to be reused later on. Coverity bug #162.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/registry/reg_perfcount.c


Changeset:
Modified: branches/SAMBA_3_0/source/registry/reg_perfcount.c
===
--- branches/SAMBA_3_0/source/registry/reg_perfcount.c  2006-03-07 19:18:47 UTC 
(rev 13977)
+++ branches/SAMBA_3_0/source/registry/reg_perfcount.c  2006-03-07 19:18:56 UTC 
(rev 13978)
@@ -499,7 +499,7 @@
obj->counters[obj->NumCounters].CounterType = atoi(buf);
DEBUG(10, ("_reg_perfcount_get_counter_info: Got type [%d] for counter 
[%d].\n",
   obj->counters[obj->NumCounters].CounterType, CounterIndex));
-   free(data.dptr);
+   SAFE_FREE(data.dptr);
 
/* Fetch the actual data */
_reg_perfcount_make_key(&key, buf, PERFCOUNT_MAX_LEN, CounterIndex, "");
@@ -544,7 +544,7 @@
memset(buf, 0, PERFCOUNT_MAX_LEN);
memcpy(buf, data.dptr, data.dsize);
}
-   free(data.dptr);
+   SAFE_FREE(data.dptr);
 
obj->counter_data.ByteLength += dsize + padding;
obj->counter_data.data = TALLOC_REALLOC_ARRAY(ps->mem_ctx,
@@ -694,7 +694,7 @@
return False;
memset(inst->counter_data.data, 0, data.dsize);
memcpy(inst->counter_data.data, data.dptr, data.dsize);
-   free(data.dptr);
+   SAFE_FREE(data.dptr);
 
/* Fetch instance name */
memset(temp, 0, PERFCOUNT_MAX_LEN);
@@ -719,7 +719,7 @@
  uint8,
  inst->NameLength);
memcpy(inst->data, name, inst->NameLength);
-   free(data.dptr);
+   SAFE_FREE(data.dptr);
}
 
inst->ParentObjectTitleIndex = 0;
@@ -807,7 +807,7 @@
DEBUG(3, ("_reg_perfcount_assemble_global: 
Failed to add new relationship for counter [%d].\n", j));
retval = -1;
}
-   free(data.dptr);
+   SAFE_FREE(data.dptr);
}
else
DEBUG(3, ("NULL relationship for counter [%d] using key 
[%s].\n", j, keybuf));
@@ -837,7 +837,7 @@
 
memset(buf, 0, PERFCOUNT_MAX_LEN);
memcpy(buf, data.dptr, data.dsize);
-   free(data.dptr);
+   SAFE_FREE(data.dptr);
 
*retval = atof(buf);
 



svn commit: samba r13977 - in trunk/source/registry: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-07 19:18:47 + (Tue, 07 Mar 2006)
New Revision: 13977

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

Log:
Here is why it's essential to use SAFE_FREE instead of free.
If we use free(data.dptr) and then the subsequent tdb_open
fails in _reg_perfcount_get_counter_data() then data.dptr
is left as a non-zero pointer that has been freed. This would
cause it to be reused later on. Coverity bug #162.
Jeremy.

Modified:
   trunk/source/registry/reg_perfcount.c


Changeset:
Modified: trunk/source/registry/reg_perfcount.c
===
--- trunk/source/registry/reg_perfcount.c   2006-03-07 19:15:05 UTC (rev 
13976)
+++ trunk/source/registry/reg_perfcount.c   2006-03-07 19:18:47 UTC (rev 
13977)
@@ -499,7 +499,7 @@
obj->counters[obj->NumCounters].CounterType = atoi(buf);
DEBUG(10, ("_reg_perfcount_get_counter_info: Got type [%d] for counter 
[%d].\n",
   obj->counters[obj->NumCounters].CounterType, CounterIndex));
-   free(data.dptr);
+   SAFE_FREE(data.dptr);
 
/* Fetch the actual data */
_reg_perfcount_make_key(&key, buf, PERFCOUNT_MAX_LEN, CounterIndex, "");
@@ -544,7 +544,7 @@
memset(buf, 0, PERFCOUNT_MAX_LEN);
memcpy(buf, data.dptr, data.dsize);
}
-   free(data.dptr);
+   SAFE_FREE(data.dptr);
 
obj->counter_data.ByteLength += dsize + padding;
obj->counter_data.data = TALLOC_REALLOC_ARRAY(ps->mem_ctx,
@@ -694,7 +694,7 @@
return False;
memset(inst->counter_data.data, 0, data.dsize);
memcpy(inst->counter_data.data, data.dptr, data.dsize);
-   free(data.dptr);
+   SAFE_FREE(data.dptr);
 
/* Fetch instance name */
memset(temp, 0, PERFCOUNT_MAX_LEN);
@@ -719,7 +719,7 @@
  uint8,
  inst->NameLength);
memcpy(inst->data, name, inst->NameLength);
-   free(data.dptr);
+   SAFE_FREE(data.dptr);
}
 
inst->ParentObjectTitleIndex = 0;
@@ -807,7 +807,7 @@
DEBUG(3, ("_reg_perfcount_assemble_global: 
Failed to add new relationship for counter [%d].\n", j));
retval = -1;
}
-   free(data.dptr);
+   SAFE_FREE(data.dptr);
}
else
DEBUG(3, ("NULL relationship for counter [%d] using key 
[%s].\n", j, keybuf));
@@ -837,7 +837,7 @@
 
memset(buf, 0, PERFCOUNT_MAX_LEN);
memcpy(buf, data.dptr, data.dsize);
-   free(data.dptr);
+   SAFE_FREE(data.dptr);
 
*retval = atof(buf);
 



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

2006-03-07 Thread jelmer
Author: jelmer
Date: 2006-03-07 19:15:05 + (Tue, 07 Mar 2006)
New Revision: 13976

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

Log:
Add simple script for updating existing prototypes in a header file

Added:
   branches/SAMBA_4_0/source/script/update-proto.pl


Changeset:
Added: branches/SAMBA_4_0/source/script/update-proto.pl
===
--- branches/SAMBA_4_0/source/script/update-proto.pl2006-03-07 18:52:48 UTC 
(rev 13975)
+++ branches/SAMBA_4_0/source/script/update-proto.pl2006-03-07 19:15:05 UTC 
(rev 13976)
@@ -0,0 +1,189 @@
+#!/usr/bin/perl
+# Simple script for updating the prototypes in a C header file
+#
+# Copyright (C) 2006 Jelmer Vernooij <[EMAIL PROTECTED]>
+# Published under the GNU GPL
+#
+# TODO:
+#  - update for prototypes that span lines
+
+use strict;
+use warnings;
+use Getopt::Long;
+
+=head1 NAME
+
+update-proto - automatically update prototypes in header files
+
+=head1 SYNOPSIS
+
+update-proto [OPTIONS]  ...
+
+update-proto [OPTIONS]  
+
+=head1 DESCRIPTION
+
+Update-proto makes sure the prototypes in a C header file are current
+by comparing the existing prototypes in a header with the function definition 
+in the source file. It aims to keep the diff between the original header 
+and generated one as small as possible.
+
+New prototypes are inserted before any line that contains the following 
comment:
+
+/* New prototypes are inserted above this line */
+
+It will automatically parse C files after it encounters a line that contains:
+
+/* The following definitions come from FILE */
+
+=head1 OPTIONS
+
+=over 4
+
+=item I<--verbose|-v>
+
+Increase verbosity. Currently only two levels of verbosity are used.
+
+=item I<--help>
+
+Show list of options
+
+=back
+
+=head1 BUGS
+
+Prototypes must appear on one line - they can't be split across multiple lines.
+Some things are erroneously recognized as functions
+
+=head1 LICENSE
+
+update-proto is licensed under the GNU General Public License 
L.
+
+=head1 AUTHOR
+
+update-proto was written by Jelmer Vernooij L<[EMAIL PROTECTED]>.
+   
+=cut
+
+sub Usage()
+{
+   print "Usage: update-proto.pl [OPTIONS]  ...\n";
+   exit 1;
+}
+
+sub Help()
+{
+   print "Usage: update-proto.pl [OPTIONS]  ...\n";
+   print "Options:\n";
+   print " --help  Show this help message\n";
+   print " --verbose   Write changes made to standard 
error\n\n";
+   exit 0;
+}
+
+my %new_protos = ();
+
+my $verbose = 0;
+
+GetOptions(
+   'help|h' => \&Help,
+   'v|verbose' => sub { $verbose += 1; }
+) or Usage();
+
+my $header = shift @ARGV;
+
+sub process_file($)
+{
+   my $file = shift;
+   open (IN, "<$file");
+   while (my $line = ) {
+   next if ($line =~ /^\s/);
+   next unless ($line =~ /\(/);
+   next if ($line =~ /^\/|[;]|^#|}|^\s*static/);
+   next unless ($line =~ /^([^(]+)(\s+)(\w+)\s*\((.*)\)\s*{*\s*$/);
+
+   my $name = $3;
+
+   next if ($name eq "main");
+   next unless ($1 =~ /^[\*\w\s]+$/);
+
+   $line =~ s/}\s*$//g;
+   $line =~ s/\n//g;
+   
+   $new_protos{$name} = "$line;";
+   }
+   close(IN);
+}
+
+process_file($_) foreach (@ARGV);
+
+my $added = 0;
+my $modified = 0;
+my $deleted = 0;
+my $kept = 0;
+
+sub insert_new_protos()
+{
+   foreach (keys %new_protos) {
+   print "$new_protos{$_}\n";
+   print STDERR "Inserted prototype for `$_'\n" if ($verbose);
+   $added+=1;
+   }
+   %new_protos = ();
+}
+
+open (HDR, "<$header");
+while (my $line = ) {
+   # Insert prototypes that weren't in the header before
+   if ($line =~ /^\/\* New prototypes are inserted above this 
line.*\*\/\s*$/) {
+   insert_new_protos();
+   print "$line\n";
+   next;
+   }
+
+   # Recognize C files that prototypes came from
+   if ($line =~ /^\/\* The following definitions come from (.*) \*\//) {
+   insert_new_protos();
+   process_file($1);
+   print "$line";
+   next;
+   }
+   
+   if ($line =~ /^\s*typedef |^\#|^\s*static/) {
+   print "$line";
+   next;
+   }
+
+   unless ($line =~ /^([^(]+)(\s+)(\w+)\s*\((.*)\)\s*;\s*$/)  {
+   print "$line";
+   next;
+   }
+
+   my $name = $3;
+
+   # This prototype is for a function that was removed
+   unless (defined($new_protos{$name})) {
+   $deleted+=1;
+   print STDERR "Removed prototype for `$name'\n" if ($verbose);
+   next;
+   }
+
+   my $nline = $line;
+   chop($nline);
+
+   if ($new_protos{$name} ne $nline) {
+   $modified+=1;
+   print STDERR "Up

svn commit: samba r13975 - in branches/SAMBA_3_0/source: include lib

2006-03-07 Thread jra
Author: jra
Date: 2006-03-07 18:52:48 + (Tue, 07 Mar 2006)
New Revision: 13975

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

Log:
Re-fix Coverity #156 - I had left the hidden arg. inconsistent
between Realloc and realloc_array.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/include/smb_macros.h
   branches/SAMBA_3_0/source/lib/util.c
   branches/SAMBA_3_0/source/lib/util_str.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/smb_macros.h
===
--- branches/SAMBA_3_0/source/include/smb_macros.h  2006-03-07 18:52:45 UTC 
(rev 13974)
+++ branches/SAMBA_3_0/source/include/smb_macros.h  2006-03-07 18:52:48 UTC 
(rev 13975)
@@ -274,7 +274,7 @@
 #define SMB_REALLOC(p,s) Realloc((p),(s),True) /* Always frees p on error or s 
== 0 */
 #define SMB_REALLOC_KEEP_OLD_ON_ERROR(p,s) Realloc((p),(s),False) /* Never 
frees p on error or s == 0 */
 #define SMB_REALLOC_ARRAY(p,type,count) (type 
*)realloc_array((p),sizeof(type),(count),True) /* Always frees p on error or s 
== 0 */
-#define SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(p,type,count) (type 
*)realloc_array((p),sizeof(type),(count),False) /* Always frees p on error or s 
== 0 */
+#define SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(p,type,count) (type 
*)realloc_array((p),sizeof(type),(count),False) /* Never frees p on error or s 
== 0 */
 #define SMB_CALLOC_ARRAY(type,count) (type *)calloc_array(sizeof(type),(count))
 #define SMB_XMALLOC_P(type) (type *)smb_xmalloc_array(sizeof(type),1)
 #define SMB_XMALLOC_ARRAY(type,count) (type 
*)smb_xmalloc_array(sizeof(type),(count))

Modified: branches/SAMBA_3_0/source/lib/util.c
===
--- branches/SAMBA_3_0/source/lib/util.c2006-03-07 18:52:45 UTC (rev 
13974)
+++ branches/SAMBA_3_0/source/lib/util.c2006-03-07 18:52:48 UTC (rev 
13975)
@@ -1009,15 +1009,15 @@
  Type-safe realloc.
 /
 
-void *realloc_array(void *p, size_t el_size, unsigned int count, BOOL 
keep_old_on_error)
+void *realloc_array(void *p, size_t el_size, unsigned int count, BOOL 
free_old_on_error)
 {
if (count >= MAX_ALLOC_SIZE/el_size) {
-   if (!keep_old_on_error) {
+   if (free_old_on_error) {
SAFE_FREE(p);
}
return NULL;
}
-   return Realloc(p, el_size*count, keep_old_on_error);
+   return Realloc(p, el_size*count, free_old_on_error);
 }
 
 /

Modified: branches/SAMBA_3_0/source/lib/util_str.c
===
--- branches/SAMBA_3_0/source/lib/util_str.c2006-03-07 18:52:45 UTC (rev 
13974)
+++ branches/SAMBA_3_0/source/lib/util_str.c2006-03-07 18:52:48 UTC (rev 
13975)
@@ -1779,8 +1779,9 @@
DEBUG(0,("str_list_copy: Unable to re-allocate 
memory"));
str_list_free(&list);
return False;
-   } else
+   } else {
list = rlist;
+   }
memset (&list[num], 0, ((sizeof(char **)) * (S_LIST_ABS 
+1)));
}




svn commit: samba r13974 - in trunk/source: include lib

2006-03-07 Thread jra
Author: jra
Date: 2006-03-07 18:52:45 + (Tue, 07 Mar 2006)
New Revision: 13974

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

Log:
Re-fix Coverity #156 - I had left the hidden arg. inconsistent
between Realloc and realloc_array.
Jeremy.

Modified:
   trunk/source/include/smb_macros.h
   trunk/source/lib/util.c
   trunk/source/lib/util_str.c


Changeset:
Modified: trunk/source/include/smb_macros.h
===
--- trunk/source/include/smb_macros.h   2006-03-07 18:39:52 UTC (rev 13973)
+++ trunk/source/include/smb_macros.h   2006-03-07 18:52:45 UTC (rev 13974)
@@ -274,7 +274,7 @@
 #define SMB_REALLOC(p,s) Realloc((p),(s),True) /* Always frees p on error or s 
== 0 */
 #define SMB_REALLOC_KEEP_OLD_ON_ERROR(p,s) Realloc((p),(s),False) /* Never 
frees p on error or s == 0 */
 #define SMB_REALLOC_ARRAY(p,type,count) (type 
*)realloc_array((p),sizeof(type),(count),True) /* Always frees p on error or s 
== 0 */
-#define SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(p,type,count) (type 
*)realloc_array((p),sizeof(type),(count),False) /* Always frees p on error or s 
== 0 */
+#define SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(p,type,count) (type 
*)realloc_array((p),sizeof(type),(count),False) /* Never frees p on error or s 
== 0 */
 #define SMB_CALLOC_ARRAY(type,count) (type *)calloc_array(sizeof(type),(count))
 #define SMB_XMALLOC_P(type) (type *)smb_xmalloc_array(sizeof(type),1)
 #define SMB_XMALLOC_ARRAY(type,count) (type 
*)smb_xmalloc_array(sizeof(type),(count))

Modified: trunk/source/lib/util.c
===
--- trunk/source/lib/util.c 2006-03-07 18:39:52 UTC (rev 13973)
+++ trunk/source/lib/util.c 2006-03-07 18:52:45 UTC (rev 13974)
@@ -1009,15 +1009,15 @@
  Type-safe realloc.
 /
 
-void *realloc_array(void *p, size_t el_size, unsigned int count, BOOL 
keep_old_on_error)
+void *realloc_array(void *p, size_t el_size, unsigned int count, BOOL 
free_old_on_error)
 {
if (count >= MAX_ALLOC_SIZE/el_size) {
-   if (!keep_old_on_error) {
+   if (free_old_on_error) {
SAFE_FREE(p);
}
return NULL;
}
-   return Realloc(p, el_size*count, keep_old_on_error);
+   return Realloc(p, el_size*count, free_old_on_error);
 }
 
 /

Modified: trunk/source/lib/util_str.c
===
--- trunk/source/lib/util_str.c 2006-03-07 18:39:52 UTC (rev 13973)
+++ trunk/source/lib/util_str.c 2006-03-07 18:52:45 UTC (rev 13974)
@@ -1779,8 +1779,9 @@
DEBUG(0,("str_list_copy: Unable to re-allocate 
memory"));
str_list_free(&list);
return False;
-   } else
+   } else {
list = rlist;
+   }
memset (&list[num], 0, ((sizeof(char **)) * (S_LIST_ABS 
+1)));
}




svn commit: samba r13973 - in branches/SAMBA_4_0/source/lib/ldb/common: .

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 18:39:52 + (Tue, 07 Mar 2006)
New Revision: 13973

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

Log:
fix the build

metze
Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c
===
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c  2006-03-07 
18:16:59 UTC (rev 13972)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c  2006-03-07 
18:39:52 UTC (rev 13973)
@@ -138,8 +138,8 @@
 #define SQLITE3_INIT
 #endif
 
-#ifndef STATIC_LIBLDB_MODULES
-#define STATIC_LIBLDB_MODULES \
+#ifndef STATIC_ldb_MODULES
+#define STATIC_ldb_MODULES \
{   \
LDAP_INIT \
SQLITE3_INIT \
@@ -156,7 +156,7 @@
 
 int ldb_global_init(void)
 {
-   static int (*static_init_fns[])(void) = STATIC_LIBLDB_MODULES;
+   static int (*static_init_fns[])(void) = STATIC_ldb_MODULES;
 
static int initialized = 0;
int ret = 0, i;



svn commit: samba r13972 - in branches/SAMBA_4_0/source/lib/util: .

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 18:16:59 + (Tue, 07 Mar 2006)
New Revision: 13972

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

Log:
fix the build, jelmer can you please take a look at what's going wrong here

metze
Modified:
   branches/SAMBA_4_0/source/lib/util/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/lib/util/config.mk
===
--- branches/SAMBA_4_0/source/lib/util/config.mk2006-03-07 18:00:21 UTC 
(rev 13971)
+++ branches/SAMBA_4_0/source/lib/util/config.mk2006-03-07 18:16:59 UTC 
(rev 13972)
@@ -3,7 +3,7 @@
 MINOR_VERSION = 0
 RELEASE_VERSION = 1
 DESCRIPTION = Generic utility functions
-PUBLIC_PROTO_HEADER = util_proto.h
+PRIVATE_PROTO_HEADER = util_proto.h
 PUBLIC_HEADERS = util.h \
 byteorder.h \
 debug.h \



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

2006-03-07 Thread jra
Author: jra
Date: 2006-03-07 18:00:21 + (Tue, 07 Mar 2006)
New Revision: 13971

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

Log:
Fix Coverity bugs #209 - #213 - it detected mistakes
in the pointer aliasing once realloc could change
a pointer. This was in the bugzilla.samba.org database
as #687 but we never figured out what it was !
Jeremy.

Modified:
   branches/SAMBA_3_0/source/lib/substitute.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/substitute.c
===
--- branches/SAMBA_3_0/source/lib/substitute.c  2006-03-07 18:00:07 UTC (rev 
13970)
+++ branches/SAMBA_3_0/source/lib/substitute.c  2006-03-07 18:00:21 UTC (rev 
13971)
@@ -532,7 +532,9 @@
 {
char *a, *t;
a = alloc_sub_basic(smb_name, str);
-   if (!a) return NULL;
+   if (!a) {
+   return NULL;
+   }
t = talloc_strdup(mem_ctx, a);
SAFE_FREE(a);
return t;
@@ -540,14 +542,14 @@
 
 char *alloc_sub_basic(const char *smb_name, const char *str)
 {
-   char *b, *p, *s, *t, *r, *a_string;
+   char *b, *p, *s, *r, *a_string;
fstring pidstr;
struct passwd *pass;
const char *local_machine_name = get_local_machine_name();
 
-   /* workaround to prevent a crash while lookinf at bug #687 */
+   /* workaround to prevent a crash while looking at bug #687 */

-   if ( !str ) {
+   if (!str) {
DEBUG(0,("alloc_sub_basic: NULL source string!  This should not 
happen\n"));
return NULL;
}
@@ -561,68 +563,75 @@
for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
 
r = NULL;
-   b = t = a_string;
+   b = a_string;

switch (*(p+1)) {
case 'U' : 
r = strdup_lower(smb_name);
-   if (r == NULL) goto error;
-   t = realloc_string_sub(t, "%U", r);
+   if (r == NULL) {
+   goto error;
+   }
+   a_string = realloc_string_sub(a_string, "%U", r);
break;
case 'G' :
r = SMB_STRDUP(smb_name);
-   if (r == NULL) goto error;
+   if (r == NULL) {
+   goto error;
+   }
if ((pass = Get_Pwnam(r))!=NULL) {
-   t = realloc_string_sub(t, "%G", 
gidtoname(pass->pw_gid));
+   a_string = realloc_string_sub(a_string, "%G", 
gidtoname(pass->pw_gid));
} 
break;
case 'D' :
r = strdup_upper(current_user_info.domain);
-   if (r == NULL) goto error;
-   t = realloc_string_sub(t, "%D", r);
+   if (r == NULL) {
+   goto error;
+   }
+   a_string = realloc_string_sub(a_string, "%D", r);
break;
case 'I' :
-   t = realloc_string_sub(t, "%I", client_addr());
+   a_string = realloc_string_sub(a_string, "%I", 
client_addr());
break;
case 'L' : 
-   if (local_machine_name && *local_machine_name)
-   t = realloc_string_sub(t, "%L", 
local_machine_name); 
-   else
-   t = realloc_string_sub(t, "%L", 
global_myname()); 
+   if (local_machine_name && *local_machine_name) {
+   a_string = realloc_string_sub(a_string, "%L", 
local_machine_name); 
+   } else {
+   a_string = realloc_string_sub(a_string, "%L", 
global_myname()); 
+   }
break;
case 'N':
-   t = realloc_string_sub(t, "%N", 
automount_server(smb_name));
+   a_string = realloc_string_sub(a_string, "%N", 
automount_server(smb_name));
break;
case 'M' :
-   t = realloc_string_sub(t, "%M", client_name());
+   a_string = realloc_string_sub(a_string, "%M", 
client_name());
break;
case 'R' :
-   t = realloc_string_sub(t, "%R", remote_proto);
+   a_string = realloc_string_sub(a_string, "%R", 
remote_proto);
break;
case 'T' :
-   t = realloc_string_sub(t, "%T", timestring(False));
+   a_string = realloc_string_sub(a_string, "%T", 
timestring(False))

svn commit: samba r13970 - in trunk/source/lib: .

2006-03-07 Thread jra
Author: jra
Date: 2006-03-07 18:00:07 + (Tue, 07 Mar 2006)
New Revision: 13970

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

Log:
Fix Coverity bugs #209 - #213 - it detected mistakes
in the pointer aliasing once realloc could change
a pointer. This was in the bugzilla.samba.org database
as #687 but we never figured out what it was !
Jeremy.

Modified:
   trunk/source/lib/substitute.c


Changeset:
Modified: trunk/source/lib/substitute.c
===
--- trunk/source/lib/substitute.c   2006-03-07 17:53:28 UTC (rev 13969)
+++ trunk/source/lib/substitute.c   2006-03-07 18:00:07 UTC (rev 13970)
@@ -532,7 +532,9 @@
 {
char *a, *t;
a = alloc_sub_basic(smb_name, str);
-   if (!a) return NULL;
+   if (!a) {
+   return NULL;
+   }
t = talloc_strdup(mem_ctx, a);
SAFE_FREE(a);
return t;
@@ -540,14 +542,14 @@
 
 char *alloc_sub_basic(const char *smb_name, const char *str)
 {
-   char *b, *p, *s, *t, *r, *a_string;
+   char *b, *p, *s, *r, *a_string;
fstring pidstr;
struct passwd *pass;
const char *local_machine_name = get_local_machine_name();
 
-   /* workaround to prevent a crash while lookinf at bug #687 */
+   /* workaround to prevent a crash while looking at bug #687 */

-   if ( !str ) {
+   if (!str) {
DEBUG(0,("alloc_sub_basic: NULL source string!  This should not 
happen\n"));
return NULL;
}
@@ -561,68 +563,75 @@
for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
 
r = NULL;
-   b = t = a_string;
+   b = a_string;

switch (*(p+1)) {
case 'U' : 
r = strdup_lower(smb_name);
-   if (r == NULL) goto error;
-   t = realloc_string_sub(t, "%U", r);
+   if (r == NULL) {
+   goto error;
+   }
+   a_string = realloc_string_sub(a_string, "%U", r);
break;
case 'G' :
r = SMB_STRDUP(smb_name);
-   if (r == NULL) goto error;
+   if (r == NULL) {
+   goto error;
+   }
if ((pass = Get_Pwnam(r))!=NULL) {
-   t = realloc_string_sub(t, "%G", 
gidtoname(pass->pw_gid));
+   a_string = realloc_string_sub(a_string, "%G", 
gidtoname(pass->pw_gid));
} 
break;
case 'D' :
r = strdup_upper(current_user_info.domain);
-   if (r == NULL) goto error;
-   t = realloc_string_sub(t, "%D", r);
+   if (r == NULL) {
+   goto error;
+   }
+   a_string = realloc_string_sub(a_string, "%D", r);
break;
case 'I' :
-   t = realloc_string_sub(t, "%I", client_addr());
+   a_string = realloc_string_sub(a_string, "%I", 
client_addr());
break;
case 'L' : 
-   if (local_machine_name && *local_machine_name)
-   t = realloc_string_sub(t, "%L", 
local_machine_name); 
-   else
-   t = realloc_string_sub(t, "%L", 
global_myname()); 
+   if (local_machine_name && *local_machine_name) {
+   a_string = realloc_string_sub(a_string, "%L", 
local_machine_name); 
+   } else {
+   a_string = realloc_string_sub(a_string, "%L", 
global_myname()); 
+   }
break;
case 'N':
-   t = realloc_string_sub(t, "%N", 
automount_server(smb_name));
+   a_string = realloc_string_sub(a_string, "%N", 
automount_server(smb_name));
break;
case 'M' :
-   t = realloc_string_sub(t, "%M", client_name());
+   a_string = realloc_string_sub(a_string, "%M", 
client_name());
break;
case 'R' :
-   t = realloc_string_sub(t, "%R", remote_proto);
+   a_string = realloc_string_sub(a_string, "%R", 
remote_proto);
break;
case 'T' :
-   t = realloc_string_sub(t, "%T", timestring(False));
+   a_string = realloc_string_sub(a_string, "%T", 
timestring(False));
break;
   

svn commit: samba r13969 - in branches/SAMBA_4_0/source: auth auth/gensec lib/com lib/registry/common ntvfs

2006-03-07 Thread jelmer
Author: jelmer
Date: 2006-03-07 17:53:28 + (Tue, 07 Mar 2006)
New Revision: 13969

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

Log:
Make these names lowercase as well (just like they are now in the buildsystem)

Modified:
   branches/SAMBA_4_0/source/auth/auth.c
   branches/SAMBA_4_0/source/auth/gensec/gensec.c
   branches/SAMBA_4_0/source/lib/com/main.c
   branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c
   branches/SAMBA_4_0/source/ntvfs/ntvfs_base.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/auth.c
===
--- branches/SAMBA_4_0/source/auth/auth.c   2006-03-07 17:49:26 UTC (rev 
13968)
+++ branches/SAMBA_4_0/source/auth/auth.c   2006-03-07 17:53:28 UTC (rev 
13969)
@@ -335,7 +335,7 @@
 
 NTSTATUS server_service_auth_init(void)
 {
-   init_module_fn static_init[] = STATIC_AUTH_MODULES;
+   init_module_fn static_init[] = STATIC_auth_MODULES;
init_module_fn *shared_init = load_samba_modules(NULL, "auth");
 
run_init_functions(static_init);

Modified: branches/SAMBA_4_0/source/auth/gensec/gensec.c
===
--- branches/SAMBA_4_0/source/auth/gensec/gensec.c  2006-03-07 17:49:26 UTC 
(rev 13968)
+++ branches/SAMBA_4_0/source/auth/gensec/gensec.c  2006-03-07 17:53:28 UTC 
(rev 13969)
@@ -1121,7 +1121,7 @@
 {
static BOOL initialized = False;
 
-   init_module_fn static_init[] = STATIC_GENSEC_MODULES;
+   init_module_fn static_init[] = STATIC_gensec_MODULES;
init_module_fn *shared_init = load_samba_modules(NULL, "gensec");
 
if (initialized) return NT_STATUS_OK;

Modified: branches/SAMBA_4_0/source/lib/com/main.c
===
--- branches/SAMBA_4_0/source/lib/com/main.c2006-03-07 17:49:26 UTC (rev 
13968)
+++ branches/SAMBA_4_0/source/lib/com/main.c2006-03-07 17:53:28 UTC (rev 
13969)
@@ -94,7 +94,7 @@
 {
static BOOL initialized = False;

-   init_module_fn static_init[] = STATIC_COM_MODULES; 
+   init_module_fn static_init[] = STATIC_com_MODULES; 
init_module_fn *shared_init;
 
if (initialized) return NT_STATUS_OK;

Modified: branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c
===
--- branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c   
2006-03-07 17:49:26 UTC (rev 13968)
+++ branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c   
2006-03-07 17:53:28 UTC (rev 13969)
@@ -73,7 +73,7 @@
 /** Initialize the registry subsystem */
 _PUBLIC_ NTSTATUS registry_init(void)
 {
-   init_module_fn static_init[] = STATIC_REGISTRY_MODULES;
+   init_module_fn static_init[] = STATIC_registry_MODULES;
init_module_fn *shared_init = load_samba_modules(NULL, "registry");
 
run_init_functions(static_init);

Modified: branches/SAMBA_4_0/source/ntvfs/ntvfs_base.c
===
--- branches/SAMBA_4_0/source/ntvfs/ntvfs_base.c2006-03-07 17:49:26 UTC 
(rev 13968)
+++ branches/SAMBA_4_0/source/ntvfs/ntvfs_base.c2006-03-07 17:53:28 UTC 
(rev 13969)
@@ -163,7 +163,7 @@
 
 NTSTATUS ntvfs_init(void)
 {
-   init_module_fn static_init[] = STATIC_NTVFS_MODULES;
+   init_module_fn static_init[] = STATIC_ntvfs_MODULES;
init_module_fn *shared_init = load_samba_modules(NULL, "ntvfs");
 
run_init_functions(static_init);



svn commit: samba r13968 - branches/SAMBA_3_0/source/utils trunk/source/utils

2006-03-07 Thread jmcd
Author: jmcd
Date: 2006-03-07 17:49:26 + (Tue, 07 Mar 2006)
New Revision: 13968

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

Log:
fix typo, caught by Guenther

Modified:
   branches/SAMBA_3_0/source/utils/net_rpc_samsync.c
   trunk/source/utils/net_rpc_samsync.c


Changeset:
Modified: branches/SAMBA_3_0/source/utils/net_rpc_samsync.c
===
--- branches/SAMBA_3_0/source/utils/net_rpc_samsync.c   2006-03-07 17:15:18 UTC 
(rev 13967)
+++ branches/SAMBA_3_0/source/utils/net_rpc_samsync.c   2006-03-07 17:49:26 UTC 
(rev 13968)
@@ -1464,7 +1464,7 @@
if (!*homedir) {
pstr_sprintf(homedir, "/home/%s", username);
} else {
-   pstr_sprintf(homedir, "dev/null");
+   pstr_sprintf(homedir, "/dev/null");
}
}   
 

Modified: trunk/source/utils/net_rpc_samsync.c
===
--- trunk/source/utils/net_rpc_samsync.c2006-03-07 17:15:18 UTC (rev 
13967)
+++ trunk/source/utils/net_rpc_samsync.c2006-03-07 17:49:26 UTC (rev 
13968)
@@ -1464,7 +1464,7 @@
if (!*homedir) {
pstr_sprintf(homedir, "/home/%s", username);
} else {
-   pstr_sprintf(homedir, "dev/null");
+   pstr_sprintf(homedir, "/dev/null");
}
}   
 



svn commit: samba r13967 - in branches/SAMBA_4_0/source: . build/m4 build/smb_build

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 17:15:18 + (Tue, 07 Mar 2006)
New Revision: 13967

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

Log:
change the standard visibility to "default" public again
for modules, libraries and subsystems

metze
Modified:
   branches/SAMBA_4_0/source/build/m4/check_cc.m4
   branches/SAMBA_4_0/source/build/smb_build/input.pm
   branches/SAMBA_4_0/source/build/smb_build/output.pm
   branches/SAMBA_4_0/source/configure.in


Changeset:
Modified: branches/SAMBA_4_0/source/build/m4/check_cc.m4
===
--- branches/SAMBA_4_0/source/build/m4/check_cc.m4  2006-03-07 17:02:50 UTC 
(rev 13966)
+++ branches/SAMBA_4_0/source/build/m4/check_cc.m4  2006-03-07 17:15:18 UTC 
(rev 13967)
@@ -137,7 +137,6 @@
visibility_attribute=yes
],[
AC_MSG_RESULT(no)
-   VISIBILITY_CFLAGS=""
])
CFLAGS="$OLD_CFLAGS"
 fi

Modified: branches/SAMBA_4_0/source/build/smb_build/input.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/input.pm  2006-03-07 17:02:50 UTC 
(rev 13966)
+++ branches/SAMBA_4_0/source/build/smb_build/input.pm  2006-03-07 17:15:18 UTC 
(rev 13967)
@@ -160,7 +160,11 @@
}
 
unless (defined($part->{STANDARD_VISIBILITY})) {
-   $part->{STANDARD_VISIBILITY} = "hidden";
+   if ($part->{TYPE} eq "BINARY") {
+   $part->{STANDARD_VISIBILITY} = "hidden";
+   } else {
+   $part->{STANDARD_VISIBILITY} = "default";
+   }
}
 
unless (defined($part->{EXTRA_CFLAGS})) {

Modified: branches/SAMBA_4_0/source/build/smb_build/output.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/output.pm 2006-03-07 17:02:50 UTC 
(rev 13966)
+++ branches/SAMBA_4_0/source/build/smb_build/output.pm 2006-03-07 17:15:18 UTC 
(rev 13967)
@@ -111,7 +111,7 @@
$part->{OUTPUT_TYPE} = "OBJLIST";
}
 
-   if (($part->{STANDARD_VISIBILITY} ne "hidden") and 
+   if (($part->{STANDARD_VISIBILITY} ne "default") and 
($config->{visibility_attribute} eq "yes")) {
$part->{EXTRA_CFLAGS} .= " 
-fvisibility=$part->{STANDARD_VISIBILITY}";
}

Modified: branches/SAMBA_4_0/source/configure.in
===
--- branches/SAMBA_4_0/source/configure.in  2006-03-07 17:02:50 UTC (rev 
13966)
+++ branches/SAMBA_4_0/source/configure.in  2006-03-07 17:15:18 UTC (rev 
13967)
@@ -52,7 +52,7 @@
 
 #
 # add *_CFLAGS only for the real build
-CFLAGS="${CFLAGS} ${VISIBILITY_CFLAGS} ${DEVELOPER_CFLAGS}"
+CFLAGS="${CFLAGS} ${DEVELOPER_CFLAGS}"
 
 #
 # final configure stuff



svn commit: samba-web r925 - in trunk/news/announcements: .

2006-03-07 Thread deryck
Author: deryck
Date: 2006-03-07 17:07:26 + (Tue, 07 Mar 2006)
New Revision: 925

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

Log:
Add news item linking to samba4WINS project and press release.

deryck
Added:
   trunk/news/announcements/samba4wins.html


Changeset:
Added: trunk/news/announcements/samba4wins.html
===
--- trunk/news/announcements/samba4wins.html2006-03-07 16:45:28 UTC (rev 
924)
+++ trunk/news/announcements/samba4wins.html2006-03-07 17:07:26 UTC (rev 
925)
@@ -0,0 +1,33 @@
+samba4WINS, Replicating WINS Server
+
+
+  samba4WINS is a replicating WINS server designed to run in
+  parallel with Samba 3 servers, version 3.0.21 and higher.  From
+  SerNet's http://enterprisesamba.org/index.php?id=89";>press 
+  release:
+  
+  
+  Initiated by http://sernet.com";>SerNet and sponsored by 
+  Computacenter, Fujitsu Siemens
+  Computers (FSC) and LiSoG e.V. it became possible to develop a free
+  software needed by many users: the replicating WINS server - samba4WINS.
+  Due to this solution WINS server running with Windows in a lot of
+  environments can be migrated to Linux.
+  
+  The urgent need to solve customer problems at the project partners
+  Computacenter and FSC in October 2005 urged the plan to develop a new
+  concept for WINS server within the Samba4-project.
+  Until now Samba3 offers the possibility to start a WINS server but
+  it cannot synchronize in a ring with other WINS servers, an ability that
+  is requested in many complex networks.
+  Even after complete migration to Linux/Unix/Samba Windows servers are
+  still inevitable in those networks. This remarkable cost factor will be
+  abolished with samba4WINS.
+  
+  
+  For more or for downloads, see the 
+  http://enterprisesamba.org/index.php?id=88";>samba4WINS site 
(on
+  http://enterprisesamba.org/";>Enterprise Samba).
+
+
+   



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

2006-03-07 Thread jra
Author: jra
Date: 2006-03-07 17:02:50 + (Tue, 07 Mar 2006)
New Revision: 13966

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

Log:
Shut Coverity up (bug #208)- this code is still under development :-).
Jeremy.

Modified:
   trunk/source/smbd/trans2.c


Changeset:
Modified: trunk/source/smbd/trans2.c
===
--- trunk/source/smbd/trans2.c  2006-03-07 16:56:31 UTC (rev 13965)
+++ trunk/source/smbd/trans2.c  2006-03-07 17:02:50 UTC (rev 13966)
@@ -3511,13 +3511,17 @@
 
case SMB_QUERY_POSIX_LOCK:
{
-   NTSTATUS status;
+   NTSTATUS status = NT_STATUS_INVALID_LEVEL;
SMB_BIG_UINT count;
SMB_BIG_UINT offset;
uint16 lock_pid;
enum brl_type lock_type;
 
-   switch (SVAL(lock_data, POSIX_LOCK_TYPE_OFFSET)) {
+   if (total_data != POSIX_LOCK_DATA_SIZE) {
+   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   }
+
+   switch (SVAL(pdata, POSIX_LOCK_TYPE_OFFSET)) {
case POSIX_LOCK_TYPE_READ:
lock_type = READ_LOCK;
break;
@@ -3531,15 +3535,15 @@
return 
ERROR_NT(NT_STATUS_INVALID_PARAMETER);
}
 
-   lock_pid = (uint16)IVAL(lock_data, 
POSIX_LOCK_PID_OFFSET);
+   lock_pid = (uint16)IVAL(pdata, POSIX_LOCK_PID_OFFSET);
 #if defined(HAVE_LONGLONG)
-   offset = (((SMB_BIG_UINT) 
IVAL(lock_data,(POSIX_LOCK_START_OFFSET+4))) << 32) |
-   ((SMB_BIG_UINT) 
IVAL(lock_data,POSIX_LOCK_START_OFFSET));
-   count = (((SMB_BIG_UINT) 
IVAL(lock_data,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
-   ((SMB_BIG_UINT) 
IVAL(lock_data,POSIX_LOCK_LEN_OFFSET));
+   offset = (((SMB_BIG_UINT) 
IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
+   ((SMB_BIG_UINT) 
IVAL(pdata,POSIX_LOCK_START_OFFSET));
+   count = (((SMB_BIG_UINT) 
IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
+   ((SMB_BIG_UINT) 
IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
 #else /* HAVE_LONGLONG */
-   offset = 
(SMB_BIG_UINT)IVAL(lock_data,POSIX_LOCK_START_OFFSET);
-   count = 
(SMB_BIG_UINT)IVAL(lock_data,POSIX_LOCK_LEN_OFFSET);
+   offset = 
(SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_START_OFFSET);
+   count = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
 #endif /* HAVE_LONGLONG */
 
 #if 0
@@ -3553,16 +3557,19 @@
&my_lock_ctx);
 #endif
 
-   if (!NT_STATUS_IS_OK(status)) {
+   if (ERROR_WAS_LOCK_DENIED(status)) {
/* Here we need to report who has it locked... 
*/
data_size = POSIX_LOCK_DATA_SIZE;
-   memcpy(pdata, lock_data, POSIX_LOCK_DATA_SIZE);
-   } else {
+   /* FIXME - Coverity tmp fix. */
+   memset(pdata, '\0', POSIX_LOCK_DATA_SIZE);
+   } else if (NT_STATUS_IS_OK(status)) {
/* For success we just return a copy of what we 
sent
   with the lock type set to 
POSIX_LOCK_TYPE_UNLOCK. */
data_size = POSIX_LOCK_DATA_SIZE;
memcpy(pdata, lock_data, POSIX_LOCK_DATA_SIZE);
SSVAL(pdata, 
POSIX_LOCK_TYPE_OFFSET,POSIX_LOCK_TYPE_UNLOCK);
+   } else {
+   return ERROR_NT(status);
}
break;
}



svn commit: samba r13965 - branches/SAMBA_3_0/source/libads trunk/source/libads

2006-03-07 Thread gd
Author: gd
Date: 2006-03-07 16:56:31 + (Tue, 07 Mar 2006)
New Revision: 13965

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

Log:
Make sure we always reset the userAccountControl bits when re-joining
with an existing account.

Guenther


Modified:
   branches/SAMBA_3_0/source/libads/ldap.c
   trunk/source/libads/ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ldap.c
===
--- branches/SAMBA_3_0/source/libads/ldap.c 2006-03-07 16:51:56 UTC (rev 
13964)
+++ branches/SAMBA_3_0/source/libads/ldap.c 2006-03-07 16:56:31 UTC (rev 
13965)
@@ -1526,9 +1526,9 @@
if (!exists) {
ads_mod_str(ctx, &mods, "cn", machine_name);
ads_mod_str(ctx, &mods, "sAMAccountName", samAccountName);
-   ads_mod_str(ctx, &mods, "userAccountControl", controlstr);
ads_mod_strlist(ctx, &mods, "objectClass", objectClass);
}
+   ads_mod_str(ctx, &mods, "userAccountControl", controlstr);
ads_mod_str(ctx, &mods, "dNSHostName", my_fqdn);
ads_mod_str(ctx, &mods, "userPrincipalName", host_upn);
ads_mod_strlist(ctx, &mods, "servicePrincipalName", 
servicePrincipalName);

Modified: trunk/source/libads/ldap.c
===
--- trunk/source/libads/ldap.c  2006-03-07 16:51:56 UTC (rev 13964)
+++ trunk/source/libads/ldap.c  2006-03-07 16:56:31 UTC (rev 13965)
@@ -1526,9 +1526,9 @@
if (!exists) {
ads_mod_str(ctx, &mods, "cn", machine_name);
ads_mod_str(ctx, &mods, "sAMAccountName", samAccountName);
-   ads_mod_str(ctx, &mods, "userAccountControl", controlstr);
ads_mod_strlist(ctx, &mods, "objectClass", objectClass);
}
+   ads_mod_str(ctx, &mods, "userAccountControl", controlstr);
ads_mod_str(ctx, &mods, "dNSHostName", my_fqdn);
ads_mod_str(ctx, &mods, "userPrincipalName", host_upn);
ads_mod_strlist(ctx, &mods, "servicePrincipalName", 
servicePrincipalName);



svn commit: samba r13964 - in branches/SAMBA_4_0/source: param script

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 16:51:56 + (Tue, 07 Mar 2006)
New Revision: 13964

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

Log:
make lp_* functions public

metze
Modified:
   branches/SAMBA_4_0/source/param/loadparm.c
   branches/SAMBA_4_0/source/script/mkproto.pl


Changeset:
Modified: branches/SAMBA_4_0/source/param/loadparm.c
===
--- branches/SAMBA_4_0/source/param/loadparm.c  2006-03-07 16:50:51 UTC (rev 
13963)
+++ branches/SAMBA_4_0/source/param/loadparm.c  2006-03-07 16:51:56 UTC (rev 
13964)
@@ -802,119 +802,119 @@
 #define FN_LOCAL_INTEGER(fn_name,val) \
  int fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : 
sDefault.val);}
 
-FN_GLOBAL_INTEGER(lp_server_role, &Globals.server_role)
-FN_GLOBAL_LIST(lp_smb_ports, &Globals.smb_ports)
-FN_GLOBAL_INTEGER(lp_nbt_port, &Globals.nbt_port)
-FN_GLOBAL_INTEGER(lp_dgram_port, &Globals.dgram_port)
-FN_GLOBAL_INTEGER(lp_cldap_port, &Globals.cldap_port)
-FN_GLOBAL_INTEGER(lp_krb5_port, &Globals.krb5_port)
-FN_GLOBAL_INTEGER(lp_kpasswd_port, &Globals.kpasswd_port)
-FN_GLOBAL_INTEGER(lp_web_port, &Globals.web_port)
-FN_GLOBAL_STRING(lp_dos_charset, &Globals.dos_charset)
-FN_GLOBAL_STRING(lp_swat_directory, &Globals.swat_directory)
-FN_GLOBAL_BOOL(lp_tls_enabled, &Globals.tls_enabled)
-FN_GLOBAL_STRING(lp_tls_keyfile, &Globals.tls_keyfile)
-FN_GLOBAL_STRING(lp_tls_certfile, &Globals.tls_certfile)
-FN_GLOBAL_STRING(lp_tls_cafile, &Globals.tls_cafile)
-FN_GLOBAL_STRING(lp_tls_crlfile, &Globals.tls_crlfile)
-FN_GLOBAL_STRING(lp_unix_charset, &Globals.unix_charset)
-FN_GLOBAL_STRING(lp_display_charset, &Globals.display_charset)
-FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile)
-FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile)
-FN_GLOBAL_STRING(lp_sam_url, &Globals.szSAM_URL)
-FN_GLOBAL_STRING(lp_spoolss_url, &Globals.szSPOOLSS_URL)
-FN_GLOBAL_STRING(lp_wins_config_url, &Globals.szWINS_CONFIG_URL)
-FN_GLOBAL_STRING(lp_wins_url, &Globals.szWINS_URL)
-FN_GLOBAL_CONST_STRING(lp_winbind_separator, &Globals.szWinbindSeparator)
-FN_GLOBAL_CONST_STRING(lp_winbindd_socket_directory, 
&Globals.szWinbinddSocketDirectory)
-FN_GLOBAL_BOOL(lp_winbind_sealed_pipes, &Globals.bWinbindSealedPipes)
-FN_GLOBAL_STRING(lp_private_dir, &Globals.szPrivateDir)
-FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString)
-FN_GLOBAL_STRING(lp_lockdir, &Globals.szLockDir)
-FN_GLOBAL_STRING(lp_setupdir, &Globals.szSetupDir)
-FN_GLOBAL_STRING(lp_ncalrpc_dir, &Globals.ncalrpc_dir)
-FN_GLOBAL_STRING(lp_piddir, &Globals.szPidDir)
-FN_GLOBAL_LIST(lp_dcerpc_endpoint_servers, &Globals.dcerpc_ep_servers)
-FN_GLOBAL_LIST(lp_server_services, &Globals.server_services)
-FN_GLOBAL_STRING(lp_ntptr_providor, &Globals.ntptr_providor)
-FN_GLOBAL_STRING(lp_auto_services, &Globals.szAutoServices)
-FN_GLOBAL_STRING(lp_passwd_chat, &Globals.szPasswdChat)
-FN_GLOBAL_LIST(lp_passwordserver, &Globals.szPasswordServers)
-FN_GLOBAL_LIST(lp_name_resolve_order, &Globals.szNameResolveOrder)
-FN_GLOBAL_STRING(lp_realm, &Globals.szRealm)
-FN_GLOBAL_STRING(lp_socket_options, &Globals.socket_options)
-FN_GLOBAL_STRING(lp_workgroup, &Globals.szWorkgroup)
-FN_GLOBAL_STRING(lp_netbios_name, &Globals.szNetbiosName)
-FN_GLOBAL_STRING(lp_netbios_scope, &Globals.szNetbiosScope)
-FN_GLOBAL_LIST(lp_wins_server_list, &Globals.szWINSservers)
-FN_GLOBAL_LIST(lp_interfaces, &Globals.szInterfaces)
-FN_GLOBAL_STRING(lp_socket_address, &Globals.szSocketAddress)
-FN_GLOBAL_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases)
-FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_server_role, &Globals.server_role)
+_PUBLIC_ FN_GLOBAL_LIST(lp_smb_ports, &Globals.smb_ports)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_nbt_port, &Globals.nbt_port)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_dgram_port, &Globals.dgram_port)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_cldap_port, &Globals.cldap_port)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_krb5_port, &Globals.krb5_port)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_kpasswd_port, &Globals.kpasswd_port)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_web_port, &Globals.web_port)
+_PUBLIC_ FN_GLOBAL_STRING(lp_dos_charset, &Globals.dos_charset)
+_PUBLIC_ FN_GLOBAL_STRING(lp_swat_directory, &Globals.swat_directory)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_tls_enabled, &Globals.tls_enabled)
+_PUBLIC_ FN_GLOBAL_STRING(lp_tls_keyfile, &Globals.tls_keyfile)
+_PUBLIC_ FN_GLOBAL_STRING(lp_tls_certfile, &Globals.tls_certfile)
+_PUBLIC_ FN_GLOBAL_STRING(lp_tls_cafile, &Globals.tls_cafile)
+_PUBLIC_ FN_GLOBAL_STRING(lp_tls_crlfile, &Globals.tls_crlfile)
+_PUBLIC_ FN_GLOBAL_STRING(lp_unix_charset, &Globals.unix_charset)
+_PUBLIC_ FN_GLOBAL_STRING(lp_display_charset, &Globals.display_charset)
+_PUBLIC_ FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile)
+_PUBLIC_ FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile)
+_PUBLIC_ FN_GLOBAL_STRING(lp_sam_url, &Globals.szSAM_URL)
+_PUBLIC_ FN_GLOBAL_STRING(lp_spoolss_url, &Globals.szSPOOLSS_URL)
+_PUBLIC_ F

svn commit: samba r13963 - in branches/SAMBA_4_0/source: .

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 16:50:51 + (Tue, 07 Mar 2006)
New Revision: 13963

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

Log:
make symbols public

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


Changeset:
Modified: branches/SAMBA_4_0/source/dynconfig.c
===
--- branches/SAMBA_4_0/source/dynconfig.c   2006-03-07 16:50:07 UTC (rev 
13962)
+++ branches/SAMBA_4_0/source/dynconfig.c   2006-03-07 16:50:51 UTC (rev 
13963)
@@ -43,58 +43,58 @@
  **/
 
 /** Directory with super-user binaries */
-const char *dyn_SBINDIR = SBINDIR;
+_PUBLIC_ const char *dyn_SBINDIR = SBINDIR;
 
 /** Directory with generic binaries */
-const char *dyn_BINDIR = BINDIR;
+_PUBLIC_ const char *dyn_BINDIR = BINDIR;
 
 /**< Location of smb.conf file. **/
-const char *dyn_CONFIGFILE = CONFIGFILE; 
+_PUBLIC_ const char *dyn_CONFIGFILE = CONFIGFILE; 
 
 /** Log file directory. **/
-const char *dyn_LOGFILEBASE = LOGFILEBASE; 
+_PUBLIC_ const char *dyn_LOGFILEBASE = LOGFILEBASE; 
 
 /** Directory for local RPC (ncalrpc: transport) */
-const char *dyn_NCALRPCDIR = NCALRPCDIR;
+_PUBLIC_ const char *dyn_NCALRPCDIR = NCALRPCDIR;
 
 /** Statically configured LanMan hosts. **/
-const char *dyn_LMHOSTSFILE = LMHOSTSFILE; 
+_PUBLIC_ const char *dyn_LMHOSTSFILE = LMHOSTSFILE; 
 
 /** Samba library directory. */
-const char *dyn_LIBDIR = LIBDIR;
+_PUBLIC_ const char *dyn_LIBDIR = LIBDIR;
 
-const char *dyn_MODULESDIR = MODULESDIR;
+_PUBLIC_ const char *dyn_MODULESDIR = MODULESDIR;
 
 /** Shared library extension */
-const char *dyn_SHLIBEXT = SHLIBEXT;
+_PUBLIC_ const char *dyn_SHLIBEXT = SHLIBEXT;
 
 /**
  * @brief Directory holding lock files.
  *
  * Not writable, but used to set a default in the parameter table.
  **/
-const char *dyn_LOCKDIR = LOCKDIR;
+_PUBLIC_ const char *dyn_LOCKDIR = LOCKDIR;
 
 /** pid file directory */
-const char *dyn_PIDDIR  = PIDDIR;
+_PUBLIC_ const char *dyn_PIDDIR  = PIDDIR;
 
 /** Private data directory; holds ldb files and the like */
-const char *dyn_PRIVATE_DIR = PRIVATE_DIR;
+_PUBLIC_ const char *dyn_PRIVATE_DIR = PRIVATE_DIR;
 
 /** SWAT data file (images, etc) directory */
-const char *dyn_SWATDIR = SWATDIR;
+_PUBLIC_ const char *dyn_SWATDIR = SWATDIR;
 
 /** SETUP files (source files used by the provision) */
-const char *dyn_SETUPDIR = SETUPDIR;
+_PUBLIC_ const char *dyn_SETUPDIR = SETUPDIR;
 
 /** EJS Javascript library includes */
-const char *dyn_JSDIR = JSDIR;
+_PUBLIC_ const char *dyn_JSDIR = JSDIR;
 
 /** Where to find the winbindd socket */
 
-const char *dyn_WINBINDD_SOCKET_DIR = WINBINDD_SOCKET_DIR;
+_PUBLIC_ const char *dyn_WINBINDD_SOCKET_DIR = WINBINDD_SOCKET_DIR;
 
-const char *samba_version_string(void)
+_PUBLIC_ const char *samba_version_string(void)
 {
const char *official_string = SAMBA_VERSION_OFFICIAL_STRING;
 #ifdef SAMBA_VERSION_RELEASE_NICKNAME



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

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 16:50:07 + (Tue, 07 Mar 2006)
New Revision: 13962

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

Log:
make functions public

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/stream/packet.c
===
--- branches/SAMBA_4_0/source/lib/stream/packet.c   2006-03-07 16:49:35 UTC 
(rev 13961)
+++ branches/SAMBA_4_0/source/lib/stream/packet.c   2006-03-07 16:50:07 UTC 
(rev 13962)
@@ -80,7 +80,7 @@
 /*
   initialise a packet receiver
 */
-struct packet_context *packet_init(TALLOC_CTX *mem_ctx)
+_PUBLIC_ struct packet_context *packet_init(TALLOC_CTX *mem_ctx)
 {
struct packet_context *pc = talloc_zero(mem_ctx, struct packet_context);
if (pc != NULL) {
@@ -93,7 +93,7 @@
 /*
   set the request callback, called when a full request is ready
 */
-void packet_set_callback(struct packet_context *pc, packet_callback_fn_t 
callback)
+_PUBLIC_ void packet_set_callback(struct packet_context *pc, 
packet_callback_fn_t callback)
 {
pc->callback = callback;
 }
@@ -101,7 +101,7 @@
 /*
   set the error handler
 */
-void packet_set_error_handler(struct packet_context *pc, 
packet_error_handler_fn_t handler)
+_PUBLIC_ void packet_set_error_handler(struct packet_context *pc, 
packet_error_handler_fn_t handler)
 {
pc->error_handler = handler;
 }
@@ -109,7 +109,7 @@
 /*
   set the private pointer passed to the callback functions
 */
-void packet_set_private(struct packet_context *pc, void *private)
+_PUBLIC_ void packet_set_private(struct packet_context *pc, void *private)
 {
pc->private = private;
 }
@@ -120,7 +120,7 @@
  STATUS_MORE_ENTRIES == blob is not complete yet
  any error == blob is not a valid 
 */
-void packet_set_full_request(struct packet_context *pc, 
packet_full_request_fn_t callback)
+_PUBLIC_ void packet_set_full_request(struct packet_context *pc, 
packet_full_request_fn_t callback)
 {
pc->full_request = callback;
 }
@@ -128,7 +128,7 @@
 /*
   set a tls context to use. You must either set a tls_context or a 
socket_context
 */
-void packet_set_tls(struct packet_context *pc, struct tls_context *tls)
+_PUBLIC_ void packet_set_tls(struct packet_context *pc, struct tls_context 
*tls)
 {
pc->tls = tls;
 }
@@ -136,7 +136,7 @@
 /*
   set a socket context to use. You must either set a tls_context or a 
socket_context
 */
-void packet_set_socket(struct packet_context *pc, struct socket_context *sock)
+_PUBLIC_ void packet_set_socket(struct packet_context *pc, struct 
socket_context *sock)
 {
pc->sock = sock;
 }
@@ -148,7 +148,7 @@
   time on a socket. This can matter for code that relies on not
   getting more than one packet per event
 */
-void packet_set_event_context(struct packet_context *pc, struct event_context 
*ev)
+_PUBLIC_ void packet_set_event_context(struct packet_context *pc, struct 
event_context *ev)
 {
pc->ev = ev;
 }
@@ -156,7 +156,7 @@
 /*
   tell the packet layer the fde for the socket
 */
-void packet_set_fde(struct packet_context *pc, struct fd_event *fde)
+_PUBLIC_ void packet_set_fde(struct packet_context *pc, struct fd_event *fde)
 {
pc->fde = fde;
 }
@@ -166,7 +166,7 @@
   requests at once on one connection. You must have set the
   event_context and fde
 */
-void packet_set_serialise(struct packet_context *pc)
+_PUBLIC_ void packet_set_serialise(struct packet_context *pc)
 {
pc->serialise = True;
 }
@@ -175,7 +175,7 @@
   tell the packet layer how much to read when starting a new packet
   this ensures it doesn't overread
 */
-void packet_set_initial_read(struct packet_context *pc, uint32_t initial_read)
+_PUBLIC_ void packet_set_initial_read(struct packet_context *pc, uint32_t 
initial_read)
 {
pc->initial_read = initial_read;
 }
@@ -183,7 +183,7 @@
 /*
   tell the packet system not to steal/free blobs given to packet_send()
 */
-void packet_set_nofree(struct packet_context *pc)
+_PUBLIC_ void packet_set_nofree(struct packet_context *pc)
 {
pc->nofree = True;
 }
@@ -237,7 +237,7 @@
   call this when the socket becomes readable to kick off the whole
   stream parsing process
 */
-void packet_recv(struct packet_context *pc)
+_PUBLIC_ void packet_recv(struct packet_context *pc)
 {
size_t npending;
NTSTATUS status;
@@ -422,7 +422,7 @@
 /*
   temporarily disable receiving 
 */
-void packet_recv_disable(struct packet_context *pc)
+_PUBLIC_ void packet_recv_disable(struct packet_context *pc)
 {
EVENT_FD_NOT_READABLE(pc->fde);
pc->recv_disable = True;
@@ -431,7 +431,7 @@
 /*
   re-enable receiving 
 */
-void packet_recv_enable(struct packet_context *pc)
+_PUBLIC_ void packet_recv_enable(struct packet_context *pc)
 {
EVENT_FD_READABLE(pc->fde);
pc->recv_disable = False;
@@ -443,7 +443,7 @@
 /*
   trigger a run of the send queue
 */
-void packet_q

svn commit: samba r13961 - in branches/SAMBA_4_0/source/dsdb/samdb: .

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 16:49:35 + (Tue, 07 Mar 2006)
New Revision: 13961

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

Log:
make function public

metze
Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/samdb_privilege.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/samdb_privilege.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/samdb_privilege.c  2006-03-07 
16:41:04 UTC (rev 13960)
+++ branches/SAMBA_4_0/source/dsdb/samdb/samdb_privilege.c  2006-03-07 
16:49:35 UTC (rev 13961)
@@ -75,7 +75,7 @@
   setup the privilege mask for this security token based on our
   local SAM
 */
-NTSTATUS samdb_privilege_setup(struct security_token *token)
+_PUBLIC_ NTSTATUS samdb_privilege_setup(struct security_token *token)
 {
void *samctx;
TALLOC_CTX *mem_ctx;



svn commit: samba-web r924 - in trunk/support: .

2006-03-07 Thread deryck
Author: deryck
Date: 2006-03-07 16:45:28 + (Tue, 07 Mar 2006)
New Revision: 924

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

Log:
New support provider in Ireland and Austria.
Updates to an existing listing in Canada.

deryck
Added:
   trunk/support/ireland.html
Modified:
   trunk/support/austria.html
   trunk/support/canada.html
   trunk/support/countries.html


Changeset:
Modified: trunk/support/austria.html
===
--- trunk/support/austria.html  2006-03-02 21:02:11 UTC (rev 923)
+++ trunk/support/austria.html  2006-03-07 16:45:28 UTC (rev 924)
@@ -141,5 +141,31 @@
 Schulung und Supportdienstleistungen für Samba Netzwerke jeder 
Größe.
 
 
+
+
+Salzburg
+
+Company: CTS Consulting & Trade Service, http://www.ctseuro.com";>http://www.ctseuro.com
+Contact: Karl M. Joch, mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]
 
+keywords: SAMBA, FreeBSD, Linux, Support, Consulting,
+  Installation, System Administration
+
+Experience: Domain Browsing, Logon-Scripts, SAMBA Integration into Domains,
+SAMBA as Domain Master, Printing
+
+Unix expirience since 1978. Reference customers from 5 to 6 users
+working throuout europe and eastern europe.
+
+contact:
+CTS Consulting & Trade Service
+A-5020 Salzburg, Fuerstallergasse 36
+
+http://www.ctseuro.com";>http://www.ctseuro.com
+Tel: +43-662-621559-0
+Fax: +43-662-621559-22
+FWD: 716621 (VOIP)
+E164.ORG: 8829900273500 (VOIP)
+
+
 

Modified: trunk/support/canada.html
===
--- trunk/support/canada.html   2006-03-02 21:02:11 UTC (rev 923)
+++ trunk/support/canada.html   2006-03-07 16:45:28 UTC (rev 924)
@@ -215,22 +215,31 @@
 
 
 
-
+
 
 Quebec
 
 Savoir-faire Linux inc.
 
-5505 Boulevard St-Laurent, #2027
+5505 Boulevard St-Laurent, #3030
 Montreal (Quebec) H2T 1S6
-Canada
+CANADA
 
-phone: (514) 276-5468
+275, rue du Parvis, Office 310
+Quebec (Quebec) G1K 6G7
+CANADA
+
+Phone: (514) 276-5468
 Fax  : (514) 994-2207
+Website : http://www.savoirfairelinux.com";>http://www.savoirfairelinux.com
+E-mail : mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]
 
-We provide many UNIX/windows services for our clients.  Our products are
-secure and fast.  Please contact us for a quote.  Please visit our site 
-at http://www.third-net.com";>www.third-net.com for more 
information.
+Savoir-faire Linux is an IT consulting firm committed to providing
+businesses with high-quality, effective, innovative, secure and
+openended solutions for projects involving technological framework,
+integration, operations, development and personnel training related to
+all opensourced systems and especially the Linux platform.
+We offer Consulting services, development team, hosting services, etc.
 
 
 

Modified: trunk/support/countries.html
===
--- trunk/support/countries.html2006-03-02 21:02:11 UTC (rev 923)
+++ trunk/support/countries.html2006-03-07 16:45:28 UTC (rev 924)
@@ -20,6 +20,7 @@
  Hungary
  India  
  Indonesia
+ Ireland
  Italy
  Latvia
  Malaysia

Added: trunk/support/ireland.html
===
--- trunk/support/ireland.html  2006-03-02 21:02:11 UTC (rev 923)
+++ trunk/support/ireland.html  2006-03-07 16:45:28 UTC (rev 924)
@@ -0,0 +1,27 @@
+
+  Samba Support--Ireland
+
+
+Commercial Support -- Ireland
+
+
+
+TWise Ltd
+Experience powering your business
+Kilmullen, Portarlington
+Co. Laois, Ireland
+Web: http://www.ITwise.net/";>http://www.ITwise.net/
+Email: mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]
+Phone: +353 87 6184366
+
+ITWise is a leading provider of IT consultancy in Ireland. Company is
+comprised of consultants from various backgrounds, who provide expertise
+across our solutions range. We possess vast experience in IT, small to large
+business applications. We specialize in commercial support for numerous open
+source software products including business applications, firewalls, network
+monitoring, virus and spam control, intrusion detection and many more. All
+kinds of Unix and all modern world technologies are at your reach with ITWise.
+
+
+
+



svn commit: samba r13960 - in branches/SAMBA_4_0/source: auth auth/credentials auth/gensec auth/ntlmssp bin/install build/smb_build dsdb/samdb/ldb_modules gtk kdc lib lib/com lib/ldb lib/registry lib/

2006-03-07 Thread jelmer
Author: jelmer
Date: 2006-03-07 16:41:04 + (Tue, 07 Mar 2006)
New Revision: 13960

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

Log:
Generate makefile rules for installing/removing shared modules.

Modified:
   branches/SAMBA_4_0/source/auth/config.mk
   branches/SAMBA_4_0/source/auth/credentials/config.mk
   branches/SAMBA_4_0/source/auth/gensec/config.mk
   branches/SAMBA_4_0/source/auth/ntlmssp/config.mk
   branches/SAMBA_4_0/source/bin/install/
   branches/SAMBA_4_0/source/build/smb_build/TODO
   branches/SAMBA_4_0/source/build/smb_build/makefile.pm
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/config.mk
   branches/SAMBA_4_0/source/gtk/config.mk
   branches/SAMBA_4_0/source/kdc/config.mk
   branches/SAMBA_4_0/source/lib/basic.mk
   branches/SAMBA_4_0/source/lib/com/config.mk
   branches/SAMBA_4_0/source/lib/ldb/config.mk
   branches/SAMBA_4_0/source/lib/registry/config.mk
   branches/SAMBA_4_0/source/lib/tdb/config.mk
   branches/SAMBA_4_0/source/lib/util/config.mk
   branches/SAMBA_4_0/source/libcli/auth/config.mk
   branches/SAMBA_4_0/source/libcli/config.mk
   branches/SAMBA_4_0/source/libcli/ldap/config.mk
   branches/SAMBA_4_0/source/libcli/smb2/config.mk
   branches/SAMBA_4_0/source/librpc/config.mk
   branches/SAMBA_4_0/source/nbt_server/config.mk
   branches/SAMBA_4_0/source/ntptr/config.mk
   branches/SAMBA_4_0/source/ntvfs/config.mk
   branches/SAMBA_4_0/source/ntvfs/posix/config.mk
   branches/SAMBA_4_0/source/ntvfs/unixuid/config.mk
   branches/SAMBA_4_0/source/rpc_server/config.mk
   branches/SAMBA_4_0/source/scripting/ejs/config.mk
   branches/SAMBA_4_0/source/smb_server/smb/config.mk
   branches/SAMBA_4_0/source/smb_server/smb2/config.mk
   branches/SAMBA_4_0/source/smbd/config.mk
   branches/SAMBA_4_0/source/torture/config.mk
   branches/SAMBA_4_0/source/torture/local/config.mk


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


svn commit: samba r13959 - in branches/SAMBA_4_0/source/lib/util: .

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 16:37:35 + (Tue, 07 Mar 2006)
New Revision: 13959

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

Log:
make more functions public

metze
Modified:
   branches/SAMBA_4_0/source/lib/util/dprintf.c
   branches/SAMBA_4_0/source/lib/util/util_file.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/util/dprintf.c
===
--- branches/SAMBA_4_0/source/lib/util/dprintf.c2006-03-07 16:33:36 UTC 
(rev 13958)
+++ branches/SAMBA_4_0/source/lib/util/dprintf.c2006-03-07 16:37:35 UTC 
(rev 13959)
@@ -31,7 +31,7 @@
 
 #include "includes.h"
 
-int d_vfprintf(FILE *f, const char *format, va_list ap) _PRINTF_ATTRIBUTE(2,0)
+_PUBLIC_ int d_vfprintf(FILE *f, const char *format, va_list ap) 
_PRINTF_ATTRIBUTE(2,0)
 {
char *p, *p2;
int ret, maxlen, clen;
@@ -71,7 +71,7 @@
 }
 
 
-int d_fprintf(FILE *f, const char *format, ...) _PRINTF_ATTRIBUTE(2,3)
+_PUBLIC_ int d_fprintf(FILE *f, const char *format, ...) _PRINTF_ATTRIBUTE(2,3)
 {
int ret;
va_list ap;
@@ -85,7 +85,7 @@
 
 static FILE *outfile;
 
-int d_printf(const char *format, ...) _PRINTF_ATTRIBUTE(1,2)
+_PUBLIC_ int d_printf(const char *format, ...) _PRINTF_ATTRIBUTE(1,2)
 {
int ret;
va_list ap;
@@ -101,7 +101,7 @@
 
 /* interactive programs need a way of tell d_*() to write to stderr instead
of stdout */
-void display_set_stderr(void)
+_PUBLIC_ void display_set_stderr(void)
 {
outfile = stderr;
 }

Modified: branches/SAMBA_4_0/source/lib/util/util_file.c
===
--- branches/SAMBA_4_0/source/lib/util/util_file.c  2006-03-07 16:33:36 UTC 
(rev 13958)
+++ branches/SAMBA_4_0/source/lib/util/util_file.c  2006-03-07 16:37:35 UTC 
(rev 13959)
@@ -364,7 +364,7 @@
return (stat(path, &st) == 0);
 }
 
-int vfdprintf(int fd, const char *format, va_list ap) _PRINTF_ATTRIBUTE(2,0)
+_PUBLIC_ int vfdprintf(int fd, const char *format, va_list ap) 
_PRINTF_ATTRIBUTE(2,0)
 {
char *p;
int len, ret;
@@ -379,7 +379,7 @@
return ret;
 }
 
-int fdprintf(int fd, const char *format, ...) _PRINTF_ATTRIBUTE(2,3)
+_PUBLIC_ int fdprintf(int fd, const char *format, ...) _PRINTF_ATTRIBUTE(2,3)
 {
va_list ap;
int ret;



svn commit: samba r13958 - branches/SAMBA_3_0/source/rpc_client trunk/source/rpc_client

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-07 16:33:36 + (Tue, 07 Mar 2006)
New Revision: 13958

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

Log:
Fix Coverity Bug # 141
Modified:
   branches/SAMBA_3_0/source/rpc_client/cli_spoolss.c
   trunk/source/rpc_client/cli_spoolss.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_client/cli_spoolss.c
===
--- branches/SAMBA_3_0/source/rpc_client/cli_spoolss.c  2006-03-07 16:29:25 UTC 
(rev 13957)
+++ branches/SAMBA_3_0/source/rpc_client/cli_spoolss.c  2006-03-07 16:33:36 UTC 
(rev 13958)
@@ -384,7 +384,7 @@
int i;
 
*forms = TALLOC_ARRAY(mem_ctx, FORM_1, num_forms);
-   if (!forms) {
+   if (*forms == NULL) {
return False;
}
prs_set_offset(&buffer->prs,0);

Modified: trunk/source/rpc_client/cli_spoolss.c
===
--- trunk/source/rpc_client/cli_spoolss.c   2006-03-07 16:29:25 UTC (rev 
13957)
+++ trunk/source/rpc_client/cli_spoolss.c   2006-03-07 16:33:36 UTC (rev 
13958)
@@ -384,7 +384,7 @@
int i;
 
*forms = TALLOC_ARRAY(mem_ctx, FORM_1, num_forms);
-   if (!forms) {
+   if (*forms == NULL) {
return False;
}
prs_set_offset(&buffer->prs,0);



svn commit: samba r13957 - branches/SAMBA_3_0/source/utils trunk/source/utils

2006-03-07 Thread jmcd
Author: jmcd
Date: 2006-03-07 16:29:25 + (Tue, 07 Mar 2006)
New Revision: 13957

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

Log:
Based on patch from Richard Renard <[EMAIL PROTECTED]>:
Fix machine accounts (should not have valid shells) and users with no 
home directory (were getting previous user's directory).

Modified:
   branches/SAMBA_3_0/source/utils/net_rpc_samsync.c
   trunk/source/utils/net_rpc_samsync.c


Changeset:
Modified: branches/SAMBA_3_0/source/utils/net_rpc_samsync.c
===
--- branches/SAMBA_3_0/source/utils/net_rpc_samsync.c   2006-03-07 16:28:39 UTC 
(rev 13956)
+++ branches/SAMBA_3_0/source/utils/net_rpc_samsync.c   2006-03-07 16:29:25 UTC 
(rev 13957)
@@ -494,7 +494,7 @@
 
 static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
 {
-   NTSTATUS nt_ret;
+   NTSTATUS nt_ret = NT_STATUS_UNSUCCESSFUL;
fstring account;
pstring add_script;
struct samu *sam_account=NULL;
@@ -1434,12 +1434,11 @@
   ACCOUNTMAP *accountmap, FILE *add_fd,
   fstring sid, char *suffix, int alloced)
 {
-   fstring username, homedir, logonscript, homedrive, homepath;
+   fstring username, logonscript, homedrive, homepath = "", homedir = "";
fstring hex_nt_passwd, hex_lm_passwd;
fstring description, fullname, sambaSID;
uchar lm_passwd[16], nt_passwd[16];
char *flags;
-   const char *blank = "", *shell = "/bin/bash";
const char* nopasswd = "";
static uchar zero_buf[16];
uint32 rid = 0, group_rid = 0, gidNumber = 0;
@@ -1459,12 +1458,14 @@
pstr_sprintf(accountmap->cn, "%s", username);
 
/* Get the home directory */
-   unistr2_to_ascii(homedir, &(delta->account_info.uni_home_dir),
-sizeof(homedir)-1);
-   if (strcmp(homedir, blank) == 0) {
-   pstr_sprintf(homedir, "/home/%s", username);
-   } else {
-   strncpy(homepath, homedir, sizeof(homepath));
+   if (delta->account_info.acb_info & ACB_NORMAL) {
+   unistr2_to_ascii(homedir, &(delta->account_info.uni_home_dir),
+sizeof(homedir)-1);
+   if (!*homedir) {
+   pstr_sprintf(homedir, "/home/%s", username);
+   } else {
+   pstr_sprintf(homedir, "dev/null");
+   }
}   
 
 /* Get the logon script */
@@ -1478,7 +1479,7 @@
/* Get the description */
unistr2_to_ascii(description, &(delta->account_info.uni_acct_desc),
 sizeof(description)-1);
-   if (strcmp(description, blank) == 0) {
+   if (!*description) {
pstr_sprintf(description, "System User");
}
 
@@ -1548,18 +1549,20 @@
fprintf(add_fd, "uidNumber: %d\n", ldif_uid);
fprintf(add_fd, "gidNumber: %d\n", gidNumber);
fprintf(add_fd, "homeDirectory: %s\n", homedir);
-   if (strcmp(homepath, blank) != 0)
+   if (*homepath)
fprintf(add_fd, "SambaHomePath: %s\n", homepath);
-if (strcmp(homedrive, blank) != 0)
+if (*homedrive)
 fprintf(add_fd, "SambaHomeDrive: %s\n", homedrive);
-if (strcmp(logonscript, blank) != 0)
+if (*logonscript)
 fprintf(add_fd, "SambaLogonScript: %s\n", logonscript);
-   fprintf(add_fd, "loginShell: %s\n", shell);
+   fprintf(add_fd, "loginShell: %s\n", 
+   ((delta->account_info.acb_info & ACB_NORMAL) ?
+"/bin/bash" : "/bin/false"));
fprintf(add_fd, "gecos: System User\n");
fprintf(add_fd, "description: %s\n", description);
fprintf(add_fd, "sambaSID: %s-%d\n", sid, rid);
fprintf(add_fd, "sambaPrimaryGroupSID: %s\n", sambaSID);
-   if(strcmp(fullname, blank) != 0)
+   if(*fullname)
fprintf(add_fd, "displayName: %s\n", fullname);
if (strcmp(nopasswd, hex_lm_passwd) != 0)
fprintf(add_fd, "sambaLMPassword: %s\n", hex_lm_passwd);

Modified: trunk/source/utils/net_rpc_samsync.c
===
--- trunk/source/utils/net_rpc_samsync.c2006-03-07 16:28:39 UTC (rev 
13956)
+++ trunk/source/utils/net_rpc_samsync.c2006-03-07 16:29:25 UTC (rev 
13957)
@@ -494,7 +494,7 @@
 
 static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
 {
-   NTSTATUS nt_ret;
+   NTSTATUS nt_ret = NT_STATUS_UNSUCCESSFUL;
fstring account;
pstring add_script;
struct samu *sam_account=NULL;
@@ -1434,12 +1434,11 @@
   ACCOUNTMAP *accountmap, FILE *add_fd,
   fstring sid, char *suffix, int alloced)
 {
-   fstring username, homedir, logonscript, homedrive, homepath;
+  

svn commit: samba r13956 - in branches/SAMBA_4_0/source/lib/socket: .

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 16:28:39 + (Tue, 07 Mar 2006)
New Revision: 13956

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

Log:
make more functions public

metze
Modified:
   branches/SAMBA_4_0/source/lib/socket/socket.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/socket/socket.c
===
--- branches/SAMBA_4_0/source/lib/socket/socket.c   2006-03-07 16:28:05 UTC 
(rev 13955)
+++ branches/SAMBA_4_0/source/lib/socket/socket.c   2006-03-07 16:28:39 UTC 
(rev 13956)
@@ -81,8 +81,8 @@
return NT_STATUS_OK;
 }
 
-NTSTATUS socket_create(const char *name, enum socket_type type, 
-  struct socket_context **new_sock, uint32_t flags)
+_PUBLIC_ NTSTATUS socket_create(const char *name, enum socket_type type, 
+   struct socket_context **new_sock, uint32_t 
flags)
 {
const struct socket_ops *ops;
 
@@ -94,10 +94,10 @@
return socket_create_with_ops(NULL, ops, new_sock, type, flags);
 }
 
-NTSTATUS socket_connect(struct socket_context *sock,
-   const struct socket_address *my_address, 
-   const struct socket_address *server_address,
-   uint32_t flags)
+_PUBLIC_ NTSTATUS socket_connect(struct socket_context *sock,
+const struct socket_address *my_address, 
+const struct socket_address *server_address,
+uint32_t flags)
 {
if (sock == NULL) {
return NT_STATUS_CONNECTION_DISCONNECTED;
@@ -113,7 +113,7 @@
return sock->ops->fn_connect(sock, my_address, server_address, flags);
 }
 
-NTSTATUS socket_connect_complete(struct socket_context *sock, uint32_t flags)
+_PUBLIC_ NTSTATUS socket_connect_complete(struct socket_context *sock, 
uint32_t flags)
 {
if (!sock->ops->fn_connect_complete) {
return NT_STATUS_NOT_IMPLEMENTED;
@@ -121,9 +121,9 @@
return sock->ops->fn_connect_complete(sock, flags);
 }
 
-NTSTATUS socket_listen(struct socket_context *sock, 
-  const struct socket_address *my_address, 
-  int queue_size, uint32_t flags)
+_PUBLIC_ NTSTATUS socket_listen(struct socket_context *sock, 
+   const struct socket_address *my_address, 
+   int queue_size, uint32_t flags)
 {
if (sock == NULL) {
return NT_STATUS_CONNECTION_DISCONNECTED;
@@ -139,7 +139,7 @@
return sock->ops->fn_listen(sock, my_address, queue_size, flags);
 }
 
-NTSTATUS socket_accept(struct socket_context *sock, struct socket_context 
**new_sock)
+_PUBLIC_ NTSTATUS socket_accept(struct socket_context *sock, struct 
socket_context **new_sock)
 {
NTSTATUS status;
 
@@ -167,8 +167,8 @@
return status;
 }
 
-NTSTATUS socket_recv(struct socket_context *sock, void *buf, 
-size_t wantlen, size_t *nread, uint32_t flags)
+_PUBLIC_ NTSTATUS socket_recv(struct socket_context *sock, void *buf, 
+ size_t wantlen, size_t *nread, uint32_t flags)
 {
if (sock == NULL) {
return NT_STATUS_CONNECTION_DISCONNECTED;
@@ -194,9 +194,9 @@
return sock->ops->fn_recv(sock, buf, wantlen, nread, flags);
 }
 
-NTSTATUS socket_recvfrom(struct socket_context *sock, void *buf, 
-size_t wantlen, size_t *nread, uint32_t flags,
-TALLOC_CTX *mem_ctx, struct socket_address **src_addr)
+_PUBLIC_ NTSTATUS socket_recvfrom(struct socket_context *sock, void *buf, 
+ size_t wantlen, size_t *nread, uint32_t flags,
+ TALLOC_CTX *mem_ctx, struct socket_address 
**src_addr)
 {
if (sock == NULL) {
return NT_STATUS_CONNECTION_DISCONNECTED;
@@ -213,8 +213,8 @@
  mem_ctx, src_addr);
 }
 
-NTSTATUS socket_send(struct socket_context *sock, 
-const DATA_BLOB *blob, size_t *sendlen, uint32_t flags)
+_PUBLIC_ NTSTATUS socket_send(struct socket_context *sock, 
+ const DATA_BLOB *blob, size_t *sendlen, uint32_t 
flags)
 {
if (sock == NULL) {
return NT_STATUS_CONNECTION_DISCONNECTED;
@@ -242,9 +242,9 @@
 }
 
 
-NTSTATUS socket_sendto(struct socket_context *sock, 
-  const DATA_BLOB *blob, size_t *sendlen, uint32_t flags,
-  const struct socket_address *dest_addr)
+_PUBLIC_ NTSTATUS socket_sendto(struct socket_context *sock, 
+   const DATA_BLOB *blob, size_t *sendlen, 
uint32_t flags,
+   const struct socket_address *dest_addr)
 {
if (sock == NULL) {
return NT_STATUS_CONNECTION_DISCONNECTED;
@@ -269,7 +269,7 @@
 /*
   ask for the number of 

svn commit: samba r13955 - branches/SAMBA_3_0/source/groupdb trunk/source/groupdb

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-07 16:28:05 + (Tue, 07 Mar 2006)
New Revision: 13955

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

Log:
Fix Coverity ID 139.

Not a bug in the strictest sense, more a clarification. This whole routine
assumes new_gid != NULL anyway, so there's no point in checking.

Volker


Modified:
   branches/SAMBA_3_0/source/groupdb/mapping.c
   trunk/source/groupdb/mapping.c


Changeset:
Modified: branches/SAMBA_3_0/source/groupdb/mapping.c
===
--- branches/SAMBA_3_0/source/groupdb/mapping.c 2006-03-07 16:27:01 UTC (rev 
13954)
+++ branches/SAMBA_3_0/source/groupdb/mapping.c 2006-03-07 16:28:05 UTC (rev 
13955)
@@ -868,7 +868,7 @@
if ( *lp_addgroup_script() ) {
pstrcpy(add_script, lp_addgroup_script());
pstring_sub(add_script, "%g", unix_group);
-   ret = smbrun(add_script, (new_gid!=NULL) ? &fd : NULL);
+   ret = smbrun(add_script, &fd);
DEBUG(ret ? 0 : 3,("smb_create_group: Running the command `%s' 
gave %d\n",add_script,ret));
if (ret != 0)
return ret;

Modified: trunk/source/groupdb/mapping.c
===
--- trunk/source/groupdb/mapping.c  2006-03-07 16:27:01 UTC (rev 13954)
+++ trunk/source/groupdb/mapping.c  2006-03-07 16:28:05 UTC (rev 13955)
@@ -868,7 +868,7 @@
if ( *lp_addgroup_script() ) {
pstrcpy(add_script, lp_addgroup_script());
pstring_sub(add_script, "%g", unix_group);
-   ret = smbrun(add_script, (new_gid!=NULL) ? &fd : NULL);
+   ret = smbrun(add_script, &fd);
DEBUG(ret ? 0 : 3,("smb_create_group: Running the command `%s' 
gave %d\n",add_script,ret));
if (ret != 0)
return ret;



svn commit: samba r13954 - in branches/SAMBA_4_0/source: . build/smb_build

2006-03-07 Thread jelmer
Author: jelmer
Date: 2006-03-07 16:27:01 + (Tue, 07 Mar 2006)
New Revision: 13954

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

Log:
Add --enable-dso flag to ./configure that simplifies the ability to 
do shared library-enabled builds.

Modified:
   branches/SAMBA_4_0/source/build/smb_build/main.pl
   branches/SAMBA_4_0/source/configure.in


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/main.pl
===
--- branches/SAMBA_4_0/source/build/smb_build/main.pl   2006-03-07 16:25:28 UTC 
(rev 13953)
+++ branches/SAMBA_4_0/source/build/smb_build/main.pl   2006-03-07 16:27:01 UTC 
(rev 13954)
@@ -33,9 +33,7 @@
 if (defined($ENV{"LIBRARY_OUTPUT_TYPE"})) {
$library_output_type = $ENV{LIBRARY_OUTPUT_TYPE};
 } elsif ($config::config{BLDSHARED} eq "true") {
-   #FIXME: This should eventually become SHARED_LIBRARY 
-   # rather then MERGEDOBJ once I'm certain it works ok -- jelmer
-   $library_output_type = "MERGEDOBJ";
+   $library_output_type = "SHARED_LIBRARY";
 } elsif ($config::config{BLDMERGED} eq "true") {
$library_output_type = "MERGEDOBJ";
 } else {
@@ -46,9 +44,7 @@
 if (defined($ENV{"MODULE_OUTPUT_TYPE"})) {
$module_output_type = $ENV{MODULE_OUTPUT_TYPE};
 } elsif ($config::config{BLDSHARED} eq "true") {
-   #FIXME: This should eventually become SHARED_LIBRARY 
-   # rather then MERGEDOBJ once I'm certain it works ok -- jelmer
-   $module_output_type = "MERGEDOBJ";
+   $module_output_type = "SHARED_LIBRARY";
 } elsif ($config::config{BLDMERGED} eq "true") {
$module_output_type = "MERGEDOBJ";
 } else {

Modified: branches/SAMBA_4_0/source/configure.in
===
--- branches/SAMBA_4_0/source/configure.in  2006-03-07 16:25:28 UTC (rev 
13953)
+++ branches/SAMBA_4_0/source/configure.in  2006-03-07 16:27:01 UTC (rev 
13954)
@@ -43,16 +43,14 @@
 sinclude(auth/config.m4)
 sinclude(kdc/config.m4)
 
-AC_DEFINE_UNQUOTED(STRING_STATIC_MODULES, "$string_static_modules", [String 
list of builtin modules])
+AC_ARG_ENABLE(dso,
+[  --enable-dsoEnable building internal libraries as DSO's 
(experimental)],
+[ if test x$enable_dso != xyes; then
+   BLDSHARED=false
+  fi], 
+[BLDSHARED=false])
 
 #
-# do extra things if we are running insure
-
-if test "${ac_cv_prog_CC}" = "insure"; then
-   CPPFLAGS="$CPPFLAGS -D__INSURE__"
-fi
-
-#
 # add *_CFLAGS only for the real build
 CFLAGS="${CFLAGS} ${VISIBILITY_CFLAGS} ${DEVELOPER_CFLAGS}"
 



svn commit: samba r13953 - in branches/SAMBA_4_0/source/lib/crypto: .

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 16:25:28 + (Tue, 07 Mar 2006)
New Revision: 13953

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

Log:
make more functions public

metze
Modified:
   branches/SAMBA_4_0/source/lib/crypto/arcfour.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/crypto/arcfour.c
===
--- branches/SAMBA_4_0/source/lib/crypto/arcfour.c  2006-03-07 16:18:09 UTC 
(rev 13952)
+++ branches/SAMBA_4_0/source/lib/crypto/arcfour.c  2006-03-07 16:25:28 UTC 
(rev 13953)
@@ -24,7 +24,7 @@
 #include "lib/crypto/crypto.h"
 
 /* initialise the arcfour sbox with key */
-void arcfour_init(struct arcfour_state *state, const DATA_BLOB *key) 
+_PUBLIC_ void arcfour_init(struct arcfour_state *state, const DATA_BLOB *key) 
 {
int ind;
uint8_t j = 0;
@@ -46,7 +46,7 @@
 }
 
 /* crypt the data with arcfour */
-void arcfour_crypt_sbox(struct arcfour_state *state, uint8_t *data, int len) 
+_PUBLIC_ void arcfour_crypt_sbox(struct arcfour_state *state, uint8_t *data, 
int len) 
 {
int ind;

@@ -69,7 +69,7 @@
 /*
   arcfour encryption with a blob key
 */
-void arcfour_crypt_blob(uint8_t *data, int len, const DATA_BLOB *key) 
+_PUBLIC_ void arcfour_crypt_blob(uint8_t *data, int len, const DATA_BLOB *key) 
 {
struct arcfour_state state;
arcfour_init(&state, key);
@@ -80,7 +80,7 @@
   a variant that assumes a 16 byte key. This should be removed
   when the last user is gone
 */
-void arcfour_crypt(uint8_t *data, const uint8_t keystr[16], int len)
+_PUBLIC_ void arcfour_crypt(uint8_t *data, const uint8_t keystr[16], int len)
 {
DATA_BLOB key = data_blob(keystr, 16);




svn commit: samba r13952 - in trunk/source/locking: .

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-07 16:18:09 + (Tue, 07 Mar 2006)
New Revision: 13952

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

Log:
Fix Coverity Bug #201.

Jeremy, I hope you don't mind me taking this one :-)

Volker


Modified:
   trunk/source/locking/locking.c


Changeset:
Modified: trunk/source/locking/locking.c
===
--- trunk/source/locking/locking.c  2006-03-07 16:06:26 UTC (rev 13951)
+++ trunk/source/locking/locking.c  2006-03-07 16:18:09 UTC (rev 13952)
@@ -101,7 +101,7 @@
ret = False;
} else {
struct byte_range_lock *br_lck = brl_get_locks(NULL, 
fsp);
-   if (!brl_lock) {
+   if (!br_lck) {
return False;
}
ret = !brl_locktest(br_lck,
@@ -115,7 +115,7 @@
}
} else {
struct byte_range_lock *br_lck = brl_get_locks(NULL, fsp);
-   if (!brl_lock) {
+   if (!br_lck) {
return False;
}
ret = !brl_locktest(br_lck,



svn commit: samba r13951 - branches/SAMBA_3_0/source/libads trunk/source/libads

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-07 16:06:26 + (Tue, 07 Mar 2006)
New Revision: 13951

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

Log:
Fix Coverity Bug #163.

This code was not used anyway :-)

Volker


Modified:
   branches/SAMBA_3_0/source/libads/ldap.c
   trunk/source/libads/ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ldap.c
===
--- branches/SAMBA_3_0/source/libads/ldap.c 2006-03-07 16:01:57 UTC (rev 
13950)
+++ branches/SAMBA_3_0/source/libads/ldap.c 2006-03-07 16:06:26 UTC (rev 
13951)
@@ -823,35 +823,7 @@
 #endif
 }
 
-
 /**
- * Get the parent dn from a search result
- * @param ads connection to ads server
- * @param msg Search result
- * @return parent dn string
- **/
-char *ads_get_parent_dn(ADS_STRUCT *ads, void *msg)
-{
-   char *mydn, *p, *dn;
-
-   dn = ads_get_dn(ads, msg);
-   if (dn == NULL) {
-   return NULL;
-   }
-
-   mydn = dn;
-   ads_memfree(ads, dn);
-   
-   p = strchr(mydn, ',');
-
-   if (p == NULL) {
-   return NULL;
-   }
-
-   return p+1;
-}
-
-/**
  * Get the parent from a dn
  * @param dn the dn to return the parent from
  * @return parent dn string

Modified: trunk/source/libads/ldap.c
===
--- trunk/source/libads/ldap.c  2006-03-07 16:01:57 UTC (rev 13950)
+++ trunk/source/libads/ldap.c  2006-03-07 16:06:26 UTC (rev 13951)
@@ -823,35 +823,7 @@
 #endif
 }
 
-
 /**
- * Get the parent dn from a search result
- * @param ads connection to ads server
- * @param msg Search result
- * @return parent dn string
- **/
-char *ads_get_parent_dn(ADS_STRUCT *ads, void *msg)
-{
-   char *mydn, *p, *dn;
-
-   dn = ads_get_dn(ads, msg);
-   if (dn == NULL) {
-   return NULL;
-   }
-
-   mydn = dn;
-   ads_memfree(ads, dn);
-   
-   p = strchr(mydn, ',');
-
-   if (p == NULL) {
-   return NULL;
-   }
-
-   return p+1;
-}
-
-/**
  * Get the parent from a dn
  * @param dn the dn to return the parent from
  * @return parent dn string



svn commit: samba r13950 - branches/SAMBA_3_0/source/libads trunk/source/libads

2006-03-07 Thread vlendec
Author: vlendec
Date: 2006-03-07 16:01:57 + (Tue, 07 Mar 2006)
New Revision: 13950

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

Log:
Fix Coverity bug #168
Modified:
   branches/SAMBA_3_0/source/libads/ads_ldap.c
   trunk/source/libads/ads_ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ads_ldap.c
===
--- branches/SAMBA_3_0/source/libads/ads_ldap.c 2006-03-07 15:35:52 UTC (rev 
13949)
+++ branches/SAMBA_3_0/source/libads/ads_ldap.c 2006-03-07 16:01:57 UTC (rev 
13950)
@@ -84,6 +84,7 @@
 
if (!*dn) {
ads_memfree(ads, dn2);
+   dn2 = NULL;
rc = ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
goto done;
}

Modified: trunk/source/libads/ads_ldap.c
===
--- trunk/source/libads/ads_ldap.c  2006-03-07 15:35:52 UTC (rev 13949)
+++ trunk/source/libads/ads_ldap.c  2006-03-07 16:01:57 UTC (rev 13950)
@@ -84,6 +84,7 @@
 
if (!*dn) {
ads_memfree(ads, dn2);
+   dn2 = NULL;
rc = ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
goto done;
}



svn commit: samba r13949 - in trunk/source/lib: .

2006-03-07 Thread jmcd
Author: jmcd
Date: 2006-03-07 15:35:52 + (Tue, 07 Mar 2006)
New Revision: 13949

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

Log:
Fix build.  Remove rpcclient include.

Modified:
   trunk/source/lib/display_sec.c


Changeset:
Modified: trunk/source/lib/display_sec.c
===
--- trunk/source/lib/display_sec.c  2006-03-07 15:32:18 UTC (rev 13948)
+++ trunk/source/lib/display_sec.c  2006-03-07 15:35:52 UTC (rev 13949)
@@ -20,7 +20,6 @@
 */
 
 #include "includes.h"
-#include "rpcclient.h"
 
 /
 convert a security permissions into a string



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

2006-03-07 Thread jmcd
Author: jmcd
Date: 2006-03-07 15:32:18 + (Tue, 07 Mar 2006)
New Revision: 13948

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

Log:
Fix the build.  Remove rpcclient.h include.

Modified:
   branches/SAMBA_3_0/source/lib/display_sec.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/display_sec.c
===
--- branches/SAMBA_3_0/source/lib/display_sec.c 2006-03-07 15:27:35 UTC (rev 
13947)
+++ branches/SAMBA_3_0/source/lib/display_sec.c 2006-03-07 15:32:18 UTC (rev 
13948)
@@ -20,7 +20,6 @@
 */
 
 #include "includes.h"
-#include "rpcclient.h"
 
 /
 convert a security permissions into a string



svn commit: samba r13947 - branches/SAMBA_3_0/source trunk/source

2006-03-07 Thread lmuelle
Author: lmuelle
Date: 2006-03-07 15:27:35 + (Tue, 07 Mar 2006)
New Revision: 13947

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

Log:
Use tabs instead of spaces for indention.

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


Changeset:
Modified: branches/SAMBA_3_0/source/Makefile.in
===
--- branches/SAMBA_3_0/source/Makefile.in   2006-03-07 15:25:10 UTC (rev 
13946)
+++ branches/SAMBA_3_0/source/Makefile.in   2006-03-07 15:27:35 UTC (rev 
13947)
@@ -685,9 +685,9 @@
 
 
 PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \
-   pam_smbpass/pam_smb_acct.o pam_smbpass/support.o \
-   $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
-   $(SECRETS_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ) \
+   pam_smbpass/pam_smb_acct.o pam_smbpass/support.o \
+   $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
+   $(SECRETS_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ) \
$(RPC_PARSE_OBJ1) $(DOSERR_OBJ)
 
 PAM_SMBPASS_PICOOBJ = $(PAM_SMBPASS_OBJ_0:[EMAIL PROTECTED]@)

Modified: trunk/source/Makefile.in
===
--- trunk/source/Makefile.in2006-03-07 15:25:10 UTC (rev 13946)
+++ trunk/source/Makefile.in2006-03-07 15:27:35 UTC (rev 13947)
@@ -699,9 +699,9 @@
 
 
 PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \
-   pam_smbpass/pam_smb_acct.o pam_smbpass/support.o \
-   $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
-   $(SECRETS_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ) \
+   pam_smbpass/pam_smb_acct.o pam_smbpass/support.o \
+   $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
+   $(SECRETS_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ) \
$(RPC_PARSE_OBJ1) $(DOSERR_OBJ)
 
 PAM_SMBPASS_PICOOBJ = $(PAM_SMBPASS_OBJ_0:[EMAIL PROTECTED]@)



svn commit: samba r13946 - branches/SAMBA_3_0/source trunk/source

2006-03-07 Thread lmuelle
Author: lmuelle
Date: 2006-03-07 15:25:10 + (Tue, 07 Mar 2006)
New Revision: 13946

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

Log:
Link pam_smbpass with the required object files.  Fix bug #3565.

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


Changeset:
Modified: branches/SAMBA_3_0/source/Makefile.in
===
--- branches/SAMBA_3_0/source/Makefile.in   2006-03-07 15:17:01 UTC (rev 
13945)
+++ branches/SAMBA_3_0/source/Makefile.in   2006-03-07 15:25:10 UTC (rev 
13946)
@@ -687,7 +687,8 @@
 PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \
pam_smbpass/pam_smb_acct.o pam_smbpass/support.o \
$(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
-   $(SECRETS_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ)
+   $(SECRETS_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ) \
+   $(RPC_PARSE_OBJ1) $(DOSERR_OBJ)
 
 PAM_SMBPASS_PICOOBJ = $(PAM_SMBPASS_OBJ_0:[EMAIL PROTECTED]@)
 

Modified: trunk/source/Makefile.in
===
--- trunk/source/Makefile.in2006-03-07 15:17:01 UTC (rev 13945)
+++ trunk/source/Makefile.in2006-03-07 15:25:10 UTC (rev 13946)
@@ -701,7 +701,8 @@
 PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \
pam_smbpass/pam_smb_acct.o pam_smbpass/support.o \
$(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
-   $(SECRETS_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ)
+   $(SECRETS_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ) \
+   $(RPC_PARSE_OBJ1) $(DOSERR_OBJ)
 
 PAM_SMBPASS_PICOOBJ = $(PAM_SMBPASS_OBJ_0:[EMAIL PROTECTED]@)
 



svn commit: samba r13945 - branches/SAMBA_3_0/source branches/SAMBA_3_0/source/lib branches/SAMBA_3_0/source/rpcclient trunk/source trunk/source/lib trunk/source/rpcclient

2006-03-07 Thread gd
Author: gd
Date: 2006-03-07 15:17:01 + (Tue, 07 Mar 2006)
New Revision: 13945

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

Log:
Move display_sec.c to lib/ (as suggested by Volker).

Guenther

Added:
   branches/SAMBA_3_0/source/lib/display_sec.c
   trunk/source/lib/display_sec.c
Removed:
   branches/SAMBA_3_0/source/rpcclient/display_sec.c
   trunk/source/rpcclient/display_sec.c
Modified:
   branches/SAMBA_3_0/source/Makefile.in
   trunk/source/Makefile.in


Changeset:
Modified: branches/SAMBA_3_0/source/Makefile.in
===
--- branches/SAMBA_3_0/source/Makefile.in   2006-03-07 14:34:32 UTC (rev 
13944)
+++ branches/SAMBA_3_0/source/Makefile.in   2006-03-07 15:17:01 UTC (rev 
13945)
@@ -492,9 +492,9 @@
 rpcclient/cmd_samr.o rpcclient/cmd_spoolss.o \
 rpcclient/cmd_netlogon.o rpcclient/cmd_srvsvc.o \
 rpcclient/cmd_dfs.o rpcclient/cmd_reg.o \
-rpcclient/display_sec.o rpcclient/cmd_ds.o \
-rpcclient/cmd_echo.o rpcclient/cmd_shutdown.o \
-rpcclient/cmd_test.o 
+rpcclient/cmd_ds.o rpcclient/cmd_echo.o \
+rpcclient/cmd_shutdown.o rpcclient/cmd_test.o \
+lib/display_sec.o
 
 RPCCLIENT_OBJ = $(RPCCLIENT_OBJ1) \
  $(PARAM_OBJ) $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) \
@@ -574,7 +574,7 @@
  $(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) $(POPT_LIB_OBJ) \
  $(SMBLDAP_OBJ) $(DCUTIL_OBJ) $(SERVER_MUTEX_OBJ) \
  $(AFS_OBJ) $(AFS_SETTOKEN_OBJ) $(REGFIO_OBJ) $(READLINE_OBJ) \
- rpcclient/display_sec.o
+ lib/display_sec.o
 
 CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
  $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) $(SECRETS_OBJ)

Copied: branches/SAMBA_3_0/source/lib/display_sec.c (from rev 13944, 
branches/SAMBA_3_0/source/rpcclient/display_sec.c)

Deleted: branches/SAMBA_3_0/source/rpcclient/display_sec.c
===
--- branches/SAMBA_3_0/source/rpcclient/display_sec.c   2006-03-07 14:34:32 UTC 
(rev 13944)
+++ branches/SAMBA_3_0/source/rpcclient/display_sec.c   2006-03-07 15:17:01 UTC 
(rev 13945)
@@ -1,187 +0,0 @@
-/* 
-   Unix SMB/CIFS implementation.
-   Samba utility functions
-   Copyright (C) Andrew Tridgell 1992-1999
-   Copyright (C) Luke Kenneth Casson Leighton 1996 - 1999
-   
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful, 
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#include "includes.h"
-#include "rpcclient.h"
-
-/
-convert a security permissions into a string
-/
-char *get_sec_mask_str(uint32 type)
-{
-   static fstring typestr="";
-
-   typestr[0] = 0;
-
-   if (type & GENERIC_ALL_ACCESS)
-   fstrcat(typestr, "Generic all access ");
-   if (type & GENERIC_EXECUTE_ACCESS)
-   fstrcat(typestr, "Generic execute access ");
-   if (type & GENERIC_WRITE_ACCESS)
-   fstrcat(typestr, "Generic write access ");
-   if (type & GENERIC_READ_ACCESS)
-   fstrcat(typestr, "Generic read access ");
-   if (type & MAXIMUM_ALLOWED_ACCESS)
-   fstrcat(typestr, "MAXIMUM_ALLOWED_ACCESS ");
-   if (type & SYSTEM_SECURITY_ACCESS)
-   fstrcat(typestr, "SYSTEM_SECURITY_ACCESS ");
-   if (type & SYNCHRONIZE_ACCESS)
-   fstrcat(typestr, "SYNCHRONIZE_ACCESS ");
-   if (type & WRITE_OWNER_ACCESS)
-   fstrcat(typestr, "WRITE_OWNER_ACCESS ");
-   if (type & WRITE_DAC_ACCESS)
-   fstrcat(typestr, "WRITE_DAC_ACCESS ");
-   if (type & READ_CONTROL_ACCESS)
-   fstrcat(typestr, "READ_CONTROL_ACCESS ");
-   if (type & DELETE_ACCESS)
-   fstrcat(typestr, "DELETE_ACCESS ");
-
-   printf("\t\tSpecific bits: 0x%lx\n", (unsigned 
long)type&SPECIFIC_RIGHTS_MASK);
-
-   return typestr;
-}
-
-/
- display sec_access structure
- /
-void display_sec_access(SEC_ACCESS *info)
-{
-   printf("\t\tPe

svn commit: samba r13944 - in branches/SAMBA_4_0/source: cldap_server client gtk/tools lib lib/appweb/mpr lib/cmdline lib/messaging lib/registry lib/registry/tools lib/util libcli libcli/util ntvfs/po

2006-03-07 Thread jelmer
Author: jelmer
Date: 2006-03-07 14:34:32 + (Tue, 07 Mar 2006)
New Revision: 13944

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

Log:
Yet another round of splitups.

Modified:
   branches/SAMBA_4_0/source/cldap_server/
   branches/SAMBA_4_0/source/cldap_server/cldap_server.h
   branches/SAMBA_4_0/source/cldap_server/config.mk
   branches/SAMBA_4_0/source/client/client.c
   branches/SAMBA_4_0/source/gtk/tools/gregedit.c
   branches/SAMBA_4_0/source/lib/appweb/mpr/miniMpr.h
   branches/SAMBA_4_0/source/lib/basic.mk
   branches/SAMBA_4_0/source/lib/cmdline/
   branches/SAMBA_4_0/source/lib/cmdline/config.mk
   branches/SAMBA_4_0/source/lib/messaging/messaging.c
   branches/SAMBA_4_0/source/lib/registry/
   branches/SAMBA_4_0/source/lib/registry/config.mk
   branches/SAMBA_4_0/source/lib/registry/tools/regdiff.c
   branches/SAMBA_4_0/source/lib/registry/tools/regpatch.c
   branches/SAMBA_4_0/source/lib/registry/tools/regshell.c
   branches/SAMBA_4_0/source/lib/registry/tools/regtree.c
   branches/SAMBA_4_0/source/lib/util/
   branches/SAMBA_4_0/source/lib/util/config.mk
   branches/SAMBA_4_0/source/libcli/config.mk
   branches/SAMBA_4_0/source/libcli/util/
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_xattr.c
   branches/SAMBA_4_0/source/scripting/ejs/config.mk
   branches/SAMBA_4_0/source/smbd/server.c
   branches/SAMBA_4_0/source/torture/raw/acls.c


Changeset:

Property changes on: branches/SAMBA_4_0/source/cldap_server
___
Name: svn:ignore
   - .sconsign
*.d

   + proto.h
*.d


Modified: branches/SAMBA_4_0/source/cldap_server/cldap_server.h
===
--- branches/SAMBA_4_0/source/cldap_server/cldap_server.h   2006-03-07 
14:22:13 UTC (rev 13943)
+++ branches/SAMBA_4_0/source/cldap_server/cldap_server.h   2006-03-07 
14:34:32 UTC (rev 13944)
@@ -29,3 +29,5 @@
struct task_server *task;
struct ldb_context *samctx;
 };
+
+#include "cldap_server/proto.h"

Modified: branches/SAMBA_4_0/source/cldap_server/config.mk
===
--- branches/SAMBA_4_0/source/cldap_server/config.mk2006-03-07 14:22:13 UTC 
(rev 13943)
+++ branches/SAMBA_4_0/source/cldap_server/config.mk2006-03-07 14:34:32 UTC 
(rev 13944)
@@ -3,6 +3,7 @@
 ###
 # Start SUBSYSTEM CLDAPD
 [SUBSYSTEM::CLDAPD]
+PRIVATE_PROTO_HEADER = proto.h
 OBJ_FILES = \
cldap_server.o \
netlogon.o

Modified: branches/SAMBA_4_0/source/client/client.c
===
--- branches/SAMBA_4_0/source/client/client.c   2006-03-07 14:22:13 UTC (rev 
13943)
+++ branches/SAMBA_4_0/source/client/client.c   2006-03-07 14:34:32 UTC (rev 
13944)
@@ -28,6 +28,7 @@
 #include "librpc/gen_ndr/ndr_srvsvc.h"
 #include "librpc/gen_ndr/ndr_lsa.h"
 #include "libcli/raw/libcliraw.h"
+#include "libcli/util/clilsa.h"
 #include "system/dir.h"
 #include "system/filesys.h"
 #include "dlinklist.h"

Modified: branches/SAMBA_4_0/source/gtk/tools/gregedit.c
===
--- branches/SAMBA_4_0/source/gtk/tools/gregedit.c  2006-03-07 14:22:13 UTC 
(rev 13943)
+++ branches/SAMBA_4_0/source/gtk/tools/gregedit.c  2006-03-07 14:34:32 UTC 
(rev 13944)
@@ -21,6 +21,7 @@
 
 #include "includes.h"
 #include "lib/registry/registry.h"
+#include "lib/registry/reg_backend_rpc.h"
 #include "gtk/common/gtk-smb.h"
 
 static GtkTreeStore *store_keys;

Modified: branches/SAMBA_4_0/source/lib/appweb/mpr/miniMpr.h
===
--- branches/SAMBA_4_0/source/lib/appweb/mpr/miniMpr.h  2006-03-07 14:22:13 UTC 
(rev 13943)
+++ branches/SAMBA_4_0/source/lib/appweb/mpr/miniMpr.h  2006-03-07 14:34:32 UTC 
(rev 13944)
@@ -274,6 +274,9 @@
 extern void mprSetCtx(void *ctx);
 extern void *mprMemCtx(void);
 
+/* This function needs to be provided by anyone using ejs */
+void ejs_exception(const char *reason);
+
 #define mprStrCmpAnyCase(s1, s2) strcasecmp_m(s1, s2)
 
 #ifdef __cplusplus

Modified: branches/SAMBA_4_0/source/lib/basic.mk
===
--- branches/SAMBA_4_0/source/lib/basic.mk  2006-03-07 14:22:13 UTC (rev 
13943)
+++ branches/SAMBA_4_0/source/lib/basic.mk  2006-03-07 14:34:32 UTC (rev 
13944)
@@ -45,6 +45,7 @@
 
 # Start SUBSYSTEM LIBCOMPRESSION
 [SUBSYSTEM::LIBCOMPRESSION]
+NOPROTO = YES
 OBJ_FILES = \
compression/mszip.o
 # End SUBSYSTEM LIBCOMPRESION


Property changes on: branches/SAMBA_4_0/source/lib/cmdline
___
Name: svn:ignore
   - credentials.h
*.d

   + popt_credentials.h
credentials.h
*.d


Modified: branches/SAMBA_4_0/source/lib/cmdline/config.mk
===

svn commit: samba r13943 - in branches/SAMBA_4_0/source/build/smb_build: .

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 14:22:13 + (Tue, 07 Mar 2006)
New Revision: 13943

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

Log:
the -rpath-link should be only used for binaries,
otherwise application linking to the installed lib would look
at the builddir for searching other libs

metze
Modified:
   branches/SAMBA_4_0/source/build/smb_build/makefile.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2006-03-07 
14:14:24 UTC (rev 13942)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2006-03-07 
14:22:13 UTC (rev 13943)
@@ -312,7 +312,7 @@
 
 $installdir/$ctx->{LIBRARY_REALNAME}: 
\$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)
[EMAIL PROTECTED] Linking \$\@
-   [EMAIL PROTECTED](SHLD) \$(SHLD_FLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
+   [EMAIL PROTECTED](SHLD) \$(SHLD_FLAGS) -o \$\@ \\
\$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) \\
\$($ctx->{TYPE}_$ctx->{NAME}_LINK_LIST)
 



svn commit: samba r13942 - in branches/SAMBA_4_0/source/scripting/ejs: .

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 14:14:24 + (Tue, 07 Mar 2006)
New Revision: 13942

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

Log:
fix dependencies

metze
Modified:
   branches/SAMBA_4_0/source/scripting/ejs/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/ejs/config.mk
===
--- branches/SAMBA_4_0/source/scripting/ejs/config.mk   2006-03-07 14:13:38 UTC 
(rev 13941)
+++ branches/SAMBA_4_0/source/scripting/ejs/config.mk   2006-03-07 14:14:24 UTC 
(rev 13942)
@@ -30,9 +30,28 @@
smbcalls_param.o \
ejsnet.o \
mprutil.o
-REQUIRED_SUBSYSTEMS = AUTH EJS LIBBASIC EJSRPC MESSAGING LIBSAMBA3 LIBNET \
- NDR_ALL LIBSMB LIBPOPT 
POPT_CREDENTIALS \
- POPT_SAMBA
+REQUIRED_SUBSYSTEMS = \
+   AUTH EJS LIBBASIC \
+   EJSRPC MESSAGING LIBSAMBA3 \
+   LIBNET LIBSMB LIBPOPT \
+   POPT_CREDENTIALS POPT_SAMBA \
+   LIBDCERPC \
+   NDR_ALL \
+   RPC_EJS_SECURITY \
+   RPC_EJS_LSA \
+   RPC_EJS_ECHO \
+   RPC_EJS_WINREG \
+   RPC_EJS_DFS \
+   RPC_EJS_MISC \
+   RPC_EJS_EVENTLOG \
+   RPC_EJS_SAMR \
+   RPC_EJS_WKSSVC \
+   RPC_EJS_SRVSVC \
+   RPC_EJS_SVCCTL \
+   RPC_EJS_INITSHUTDOWN \
+   RPC_EJS_NETLOGON \
+   RPC_EJS_DRSUAPI \
+   RPC_EJS_IRPC
 # End SUBSYSTEM SMBCALLS
 ###
 



svn commit: samba r13941 - in branches/SAMBA_4_0/source: ldap_server nbt_server web_server

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 14:13:38 + (Tue, 07 Mar 2006)
New Revision: 13941

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

Log:
fix the build

metze
Modified:
   branches/SAMBA_4_0/source/ldap_server/ldap_server.c
   branches/SAMBA_4_0/source/nbt_server/irpc.c
   branches/SAMBA_4_0/source/nbt_server/nbt_server.c
   branches/SAMBA_4_0/source/web_server/http.c
   branches/SAMBA_4_0/source/web_server/web_server.c


Changeset:
Modified: branches/SAMBA_4_0/source/ldap_server/ldap_server.c
===
--- branches/SAMBA_4_0/source/ldap_server/ldap_server.c 2006-03-07 14:00:57 UTC 
(rev 13940)
+++ branches/SAMBA_4_0/source/ldap_server/ldap_server.c 2006-03-07 14:13:38 UTC 
(rev 13941)
@@ -30,7 +30,7 @@
 #include "ldap_server/ldap_server.h"
 #include "smbd/service_task.h"
 #include "smbd/service_stream.h"
-#include "smbd/proto.h"
+#include "smbd/service.h"
 #include "lib/socket/socket.h"
 #include "lib/tls/tls.h"
 #include "lib/messaging/irpc.h"

Modified: branches/SAMBA_4_0/source/nbt_server/irpc.c
===
--- branches/SAMBA_4_0/source/nbt_server/irpc.c 2006-03-07 14:00:57 UTC (rev 
13940)
+++ branches/SAMBA_4_0/source/nbt_server/irpc.c 2006-03-07 14:13:38 UTC (rev 
13941)
@@ -23,7 +23,7 @@
 
 #include "includes.h"
 #include "smbd/service_task.h"
-#include "smbd/proto.h"
+#include "smbd/service.h"
 #include "nbt_server/nbt_server.h"
 #include "nbt_server/wins/winsserver.h"
 #include "lib/socket/socket.h"

Modified: branches/SAMBA_4_0/source/nbt_server/nbt_server.c
===
--- branches/SAMBA_4_0/source/nbt_server/nbt_server.c   2006-03-07 14:00:57 UTC 
(rev 13940)
+++ branches/SAMBA_4_0/source/nbt_server/nbt_server.c   2006-03-07 14:13:38 UTC 
(rev 13941)
@@ -22,7 +22,7 @@
 
 #include "includes.h"
 #include "smbd/service_task.h"
-#include "smbd/proto.h"
+#include "smbd/service.h"
 #include "nbt_server/nbt_server.h"
 #include "nbt_server/wins/winsserver.h"
 #include "system/network.h"

Modified: branches/SAMBA_4_0/source/web_server/http.c
===
--- branches/SAMBA_4_0/source/web_server/http.c 2006-03-07 14:00:57 UTC (rev 
13940)
+++ branches/SAMBA_4_0/source/web_server/http.c 2006-03-07 14:13:38 UTC (rev 
13941)
@@ -24,7 +24,7 @@
 #include "smbd/service_task.h"
 #include "web_server/web_server.h"
 #include "smbd/service_stream.h"
-#include "smbd/proto.h"
+#include "smbd/service.h"
 #include "lib/events/events.h"
 #include "system/time.h"
 #include "lib/appweb/esp/esp.h"

Modified: branches/SAMBA_4_0/source/web_server/web_server.c
===
--- branches/SAMBA_4_0/source/web_server/web_server.c   2006-03-07 14:00:57 UTC 
(rev 13940)
+++ branches/SAMBA_4_0/source/web_server/web_server.c   2006-03-07 14:13:38 UTC 
(rev 13941)
@@ -23,7 +23,7 @@
 #include "includes.h"
 #include "smbd/service_task.h"
 #include "smbd/service_stream.h"
-#include "smbd/proto.h"
+#include "smbd/service.h"
 #include "web_server/web_server.h"
 #include "lib/events/events.h"
 #include "system/filesys.h"



svn commit: samba r13940 - in branches/SAMBA_4_0/source/build/smb_build: .

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 14:00:57 + (Tue, 07 Mar 2006)
New Revision: 13940

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

Log:
use the local vs. install linkerflag trick for shared libs too

metze
Modified:
   branches/SAMBA_4_0/source/build/smb_build/makefile.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2006-03-07 
13:47:34 UTC (rev 13939)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2006-03-07 
14:00:57 UTC (rev 13940)
@@ -119,11 +119,12 @@
 PICFLAG=$self->{config}->{PICFLAG}
 HOSTCC=$self->{config}->{HOSTCC}
 
-LD=$self->{config}->{LD} 
-LDFLAGS=$self->{config}->{LDFLAGS} -L\$(builddir)/bin
 LOCAL_LINK_FLAGS=$devld_local
 INSTALL_LINK_FLAGS=$devld_install
 
+LD=$self->{config}->{LD} 
+LDFLAGS=$self->{config}->{LDFLAGS} -L\$(builddir)/bin
+
 STLD=$self->{config}->{AR}
 STLD_FLAGS=-rc -L\$(builddir)/bin
 
@@ -255,6 +256,14 @@
 {
my ($self,$ctx) = @_;
 
+   my $installdir;
+   
+   if ($self->{duplicate_build}) {
+   $installdir = "bin/install";
+   } else {
+   $installdir = "bin";
+   }
+
push (@{$self->{shared_libs}}, "bin/$ctx->{LIBRARY_REALNAME}");
push (@{$self->{shared_modules}}, "bin/$ctx->{LIBRARY_REALNAME}");
 
@@ -270,19 +279,20 @@
push(@{$self->{proto_objs}}, 
"\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST\)");
}
 
-   $self->output(<< "__EOD__"
+   if ($self->{duplicate_build}) {
+   $self->output(<< "__EOD__"
 #
 
 bin/$ctx->{LIBRARY_REALNAME}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) 
\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST) 
[EMAIL PROTECTED] Linking \$\@
-   [EMAIL PROTECTED](SHLD) \$(SHLD_FLAGS) -o \$\@ \\
+   [EMAIL PROTECTED](SHLD) \$(SHLD_FLAGS) -o \$\@ \$(LOCAL_LINK_FLAGS) \\
\$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) \\
\$($ctx->{TYPE}_$ctx->{NAME}_LINK_LIST)
 
 __EOD__
 );
-   if (defined($ctx->{LIBRARY_SONAME})) {
-   $self->output(<< "__EOD__"
+   if (defined($ctx->{LIBRARY_SONAME})) {
+   $self->output(<< "__EOD__"
 # Symlink $ctx->{LIBRARY_SONAME}
 bin/$ctx->{LIBRARY_SONAME}: bin/$ctx->{LIBRARY_REALNAME} 
[EMAIL PROTECTED] Symlink \$\@
@@ -294,7 +304,34 @@
 
 __EOD__
 );
+   }
}
+
+   $self->output(<< "__EOD__"
+#
+
+$installdir/$ctx->{LIBRARY_REALNAME}: 
\$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)
+   [EMAIL PROTECTED] Linking \$\@
+   [EMAIL PROTECTED](SHLD) \$(SHLD_FLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
+   \$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) \\
+   \$($ctx->{TYPE}_$ctx->{NAME}_LINK_LIST)
+
+__EOD__
+);
+   if (defined($ctx->{LIBRARY_SONAME})) {
+   $self->output(<< "__EOD__"
+# Symlink $ctx->{LIBRARY_SONAME}
+$installdir/$ctx->{LIBRARY_SONAME}: $installdir/$ctx->{LIBRARY_REALNAME}
+   [EMAIL PROTECTED] Symlink \$\@
+   [EMAIL PROTECTED] -sf $ctx->{LIBRARY_REALNAME} \$\@
+# Symlink $ctx->{LIBRARY_NAME}
+$installdir/$ctx->{LIBRARY_NAME}: $installdir/$ctx->{LIBRARY_SONAME}
+   [EMAIL PROTECTED] Symlink \$\@
+   [EMAIL PROTECTED] -sf $ctx->{LIBRARY_SONAME} \$\@
+
+__EOD__
+);
+   }
 }
 
 sub MergedObj($$)



svn commit: samba r13939 - in branches/SAMBA_4_0/source: auth auth/gensec auth/kerberos build/smb_build ldap_server lib lib/cmdline lib/netif libcli libcli/auth libcli/composite libcli/security libcli

2006-03-07 Thread jelmer
Author: jelmer
Date: 2006-03-07 13:47:34 + (Tue, 07 Mar 2006)
New Revision: 13939

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

Log:
Fix bin/.dummy issues, add more ignores

Modified:
   branches/SAMBA_4_0/source/auth/
   branches/SAMBA_4_0/source/auth/gensec/
   branches/SAMBA_4_0/source/auth/kerberos/
   branches/SAMBA_4_0/source/build/smb_build/makefile.pm
   branches/SAMBA_4_0/source/ldap_server/
   branches/SAMBA_4_0/source/lib/
   branches/SAMBA_4_0/source/lib/cmdline/
   branches/SAMBA_4_0/source/lib/netif/
   branches/SAMBA_4_0/source/libcli/
   branches/SAMBA_4_0/source/libcli/auth/
   branches/SAMBA_4_0/source/libcli/composite/
   branches/SAMBA_4_0/source/libcli/security/
   branches/SAMBA_4_0/source/libcli/util/
   branches/SAMBA_4_0/source/passdb/
   branches/SAMBA_4_0/source/rpc_server/common/
   branches/SAMBA_4_0/source/scripting/ejs/
   branches/SAMBA_4_0/source/smbd/
   branches/SAMBA_4_0/source/winbind/


Changeset:

Property changes on: branches/SAMBA_4_0/source/auth
___
Name: svn:ignore
   - .sconsign
auth_proto.h
*.d

   + auth_sam.h
pam_errors.h
.sconsign
auth_proto.h
*.d



Property changes on: branches/SAMBA_4_0/source/auth/gensec
___
Name: svn:ignore
   - proto.h
schannel_proto.h
spnego_proto.h
gensec_proto.h
*.d

   + schannel_state.h
proto.h
schannel_proto.h
spnego_proto.h
gensec_proto.h
*.d



Property changes on: branches/SAMBA_4_0/source/auth/kerberos
___
Name: svn:ignore
   - .sconsign
*.d

   + proto.h
*.d


Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2006-03-07 
13:36:26 UTC (rev 13938)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2006-03-07 
13:47:34 UTC (rev 13939)
@@ -273,7 +273,7 @@
$self->output(<< "__EOD__"
 #
 
-bin/$ctx->{LIBRARY_REALNAME}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) 
\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST) bin/.dummy
+bin/$ctx->{LIBRARY_REALNAME}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) 
\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST) 
[EMAIL PROTECTED] Linking \$\@
[EMAIL PROTECTED](SHLD) \$(SHLD_FLAGS) -o \$\@ \\
\$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) \\
@@ -284,11 +284,11 @@
if (defined($ctx->{LIBRARY_SONAME})) {
$self->output(<< "__EOD__"
 # Symlink $ctx->{LIBRARY_SONAME}
-bin/$ctx->{LIBRARY_SONAME}: bin/$ctx->{LIBRARY_REALNAME} bin/.dummy
+bin/$ctx->{LIBRARY_SONAME}: bin/$ctx->{LIBRARY_REALNAME} 
[EMAIL PROTECTED] Symlink \$\@
[EMAIL PROTECTED] -sf $ctx->{LIBRARY_REALNAME} \$\@
 # Symlink $ctx->{LIBRARY_NAME}
-bin/$ctx->{LIBRARY_NAME}: bin/$ctx->{LIBRARY_SONAME} bin/.dummy
+bin/$ctx->{LIBRARY_NAME}: bin/$ctx->{LIBRARY_SONAME} 
[EMAIL PROTECTED] Symlink \$\@
[EMAIL PROTECTED] -sf $ctx->{LIBRARY_SONAME} \$\@
 
@@ -361,7 +361,7 @@
 
$self->output(<< "__EOD__"
 #
-$ctx->{TARGET}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) 
\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST) bin/.dummy
+$ctx->{TARGET}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) 
\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST) 
[EMAIL PROTECTED] Linking \$@
[EMAIL PROTECTED](STLD) \$(STLD_FLAGS) \$@ \\
\$($ctx->{TYPE}_$ctx->{NAME}_LINK_LIST)
@@ -415,7 +415,7 @@
if ($self->{duplicate_build}) {
$self->output(<< "__EOD__"
 #
-bin/$ctx->{BINARY}: bin/.dummy \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) 
\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)
+bin/$ctx->{BINARY}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) 
\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)
[EMAIL PROTECTED] Linking \$\@
[EMAIL PROTECTED](CC) \$(LDFLAGS) -o \$\@ \$(LOCAL_LINK_FLAGS) \\
\$\($ctx->{TYPE}_$ctx->{NAME}_LINK_LIST) \\


Property changes on: branches/SAMBA_4_0/source/ldap_server
___
Name: svn:ignore
   - .sconsign
*.d

   + proto.h
*.d



Property changes on: branches/SAMBA_4_0/source/lib
___
Name: svn:ignore
   - *.d
*.po
*.po32


   + db_wrap_proto.h
*.d
*.po
*.po32




Property changes on: branches/SAMBA_4_0/source/lib/cmdline
___
Name: svn:ignore
   - .sconsign
*.d

   + credentials.h
*.d



Property changes on: branches/SAMBA_4_0/source/lib/netif
___
Name: svn:ignore
   - .sconsign
*.d

   + proto.h
*.d



Property changes on: branches/SAMBA_4_0/source/libcli
___
Name: svn:ignore
   - libcli_proto.h
*.d
*.po
*.po32


   + finddcs.h
libcli_proto.h
*.d
*.po
*.po32




svn commit: samba r13938 - in branches/SAMBA_4_0/source: . auth auth/gensec include lib/cmdline lib/ldb libcli libnet passdb rpc_server/lsa rpc_server/netlogon smbd winbind

2006-03-07 Thread jelmer
Author: jelmer
Date: 2006-03-07 13:36:26 + (Tue, 07 Mar 2006)
New Revision: 13938

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

Log:
Around round of splitups

Modified:
   branches/SAMBA_4_0/source/auth/auth_unix.c
   branches/SAMBA_4_0/source/auth/config.mk
   branches/SAMBA_4_0/source/auth/gensec/config.mk
   branches/SAMBA_4_0/source/auth/gensec/schannel.c
   branches/SAMBA_4_0/source/include/includes.h
   branches/SAMBA_4_0/source/lib/cmdline/config.mk
   branches/SAMBA_4_0/source/lib/cmdline/popt_credentials.c
   branches/SAMBA_4_0/source/lib/ldb/config.mk
   branches/SAMBA_4_0/source/libcli/config.mk
   branches/SAMBA_4_0/source/libnet/libnet_lookup.c
   branches/SAMBA_4_0/source/main.mk
   branches/SAMBA_4_0/source/passdb/config.mk
   branches/SAMBA_4_0/source/passdb/secrets.h
   branches/SAMBA_4_0/source/rpc_server/lsa/dcesrv_lsa.c
   branches/SAMBA_4_0/source/rpc_server/netlogon/dcerpc_netlogon.c
   branches/SAMBA_4_0/source/smbd/process_standard.c
   branches/SAMBA_4_0/source/smbd/server.c
   branches/SAMBA_4_0/source/winbind/wb_samba3_cmd.c
   branches/SAMBA_4_0/source/winbind/wb_server.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/auth_unix.c
===
--- branches/SAMBA_4_0/source/auth/auth_unix.c  2006-03-07 13:22:00 UTC (rev 
13937)
+++ branches/SAMBA_4_0/source/auth/auth_unix.c  2006-03-07 13:36:26 UTC (rev 
13938)
@@ -24,6 +24,7 @@
 #include "auth/auth.h"
 #include "system/passwd.h" /* needed by some systems for struct passwd */
 #include "lib/socket/socket.h" 
+#include "auth/pam_errors.h"
 
 /* TODO: look at how to best fill in parms retrieveing a struct passwd info
  * except in case USER_INFO_DONT_CHECK_UNIX_ACCOUNT is set

Modified: branches/SAMBA_4_0/source/auth/config.mk
===
--- branches/SAMBA_4_0/source/auth/config.mk2006-03-07 13:22:00 UTC (rev 
13937)
+++ branches/SAMBA_4_0/source/auth/config.mk2006-03-07 13:36:26 UTC (rev 
13938)
@@ -63,6 +63,7 @@
 ###
 
 [SUBSYSTEM::PAM_ERRORS]
+PRIVATE_PROTO_HEADER = pam_errors.h
 OBJ_FILES = pam_errors.o
 
 ###

Modified: branches/SAMBA_4_0/source/auth/gensec/config.mk
===
--- branches/SAMBA_4_0/source/auth/gensec/config.mk 2006-03-07 13:22:00 UTC 
(rev 13937)
+++ branches/SAMBA_4_0/source/auth/gensec/config.mk 2006-03-07 13:36:26 UTC 
(rev 13938)
@@ -59,6 +59,7 @@
 
 # Start SUBSYSTEM SCHANNELDB
 [SUBSYSTEM::SCHANNELDB]
+PRIVATE_PROTO_HEADER = schannel_state.h
 OBJ_FILES = \
schannel_state.o
 #

Modified: branches/SAMBA_4_0/source/auth/gensec/schannel.c
===
--- branches/SAMBA_4_0/source/auth/gensec/schannel.c2006-03-07 13:22:00 UTC 
(rev 13937)
+++ branches/SAMBA_4_0/source/auth/gensec/schannel.c2006-03-07 13:36:26 UTC 
(rev 13938)
@@ -25,6 +25,7 @@
 #include "librpc/gen_ndr/ndr_schannel.h"
 #include "auth/auth.h"
 #include "auth/gensec/schannel.h"
+#include "auth/gensec/schannel_state.h"
 #include "auth/gensec/schannel_proto.h"
 
 static size_t schannel_sig_size(struct gensec_security *gensec_security, 
size_t data_size)

Modified: branches/SAMBA_4_0/source/include/includes.h
===
--- branches/SAMBA_4_0/source/include/includes.h2006-03-07 13:22:00 UTC 
(rev 13937)
+++ branches/SAMBA_4_0/source/include/includes.h2006-03-07 13:36:26 UTC 
(rev 13938)
@@ -123,6 +123,7 @@
 #include "libcli/raw/interfaces.h"
 #include "auth/credentials/credentials.h"
 #include "libcli/nbt/libnbt.h"
+#include "libcli/util/proto.h"
 
 #undef _PRINTF_ATTRIBUTE
 #define _PRINTF_ATTRIBUTE(a1, a2)

Modified: branches/SAMBA_4_0/source/lib/cmdline/config.mk
===
--- branches/SAMBA_4_0/source/lib/cmdline/config.mk 2006-03-07 13:22:00 UTC 
(rev 13937)
+++ branches/SAMBA_4_0/source/lib/cmdline/config.mk 2006-03-07 13:36:26 UTC 
(rev 13938)
@@ -1,4 +1,5 @@
 [SUBSYSTEM::LIBCMDLINE_CREDENTIALS]
+PRIVATE_PROTO_HEADER = credentials.h
 OBJ_FILES = credentials.o
 REQUIRED_SUBSYSTEMS = CREDENTIALS
 

Modified: branches/SAMBA_4_0/source/lib/cmdline/popt_credentials.c
===
--- branches/SAMBA_4_0/source/lib/cmdline/popt_credentials.c2006-03-07 
13:22:00 UTC (rev 13937)
+++ branches/SAMBA_4_0/source/lib/cmdline/popt_credentials.c2006-03-07 
13:36:26 UTC (rev 13938)
@@ -21,6 +21,7 @@
 
 #include "includes.h"
 #include "lib/cmdline/popt_common.h"
+#include "lib/cmdline/credentials.h"
 #include "auth/gensec/gensec.h"
 
 /* Handle command line options:

Modified: branches/SAMBA_4_0/source/lib/ldb/config.mk

svn commit: samba r13937 - in branches/SAMBA_4_0/source: rpc_server smb_server smbd

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 13:22:00 + (Tue, 07 Mar 2006)
New Revision: 13937

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

Log:
fix the build

metze
Modified:
   branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c
   branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c
   branches/SAMBA_4_0/source/smb_server/smb_server.c
   branches/SAMBA_4_0/source/smbd/server.c


Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c
===
--- branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c2006-03-07 
13:14:30 UTC (rev 13936)
+++ branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c2006-03-07 
13:22:00 UTC (rev 13937)
@@ -28,7 +28,7 @@
 #include "rpc_server/dcerpc_server.h"
 #include "lib/events/events.h"
 #include "smbd/service_stream.h"
-#include "smbd/proto.h"
+#include "smbd/service.h"
 #include "system/filesys.h"
 #include "libcli/security/proto.h"
 #include "build.h"

Modified: branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c
===
--- branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c  2006-03-07 13:14:30 UTC 
(rev 13936)
+++ branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c  2006-03-07 13:22:00 UTC 
(rev 13937)
@@ -27,7 +27,7 @@
 #include "lib/events/events.h"
 #include "rpc_server/dcerpc_server.h"
 #include "smbd/service_stream.h"
-#include "smbd/proto.h"
+#include "smbd/service.h"
 #include "lib/messaging/irpc.h"
 #include "system/network.h"
 #include "netif/netif.h"

Modified: branches/SAMBA_4_0/source/smb_server/smb_server.c
===
--- branches/SAMBA_4_0/source/smb_server/smb_server.c   2006-03-07 13:14:30 UTC 
(rev 13936)
+++ branches/SAMBA_4_0/source/smb_server/smb_server.c   2006-03-07 13:22:00 UTC 
(rev 13937)
@@ -21,7 +21,7 @@
 
 #include "includes.h"
 #include "smbd/service_stream.h"
-#include "smbd/proto.h"
+#include "smbd/service.h"
 #include "smb_server/smb_server.h"
 #include "lib/messaging/irpc.h"
 #include "lib/stream/packet.h"

Modified: branches/SAMBA_4_0/source/smbd/server.c
===
--- branches/SAMBA_4_0/source/smbd/server.c 2006-03-07 13:14:30 UTC (rev 
13936)
+++ branches/SAMBA_4_0/source/smbd/server.c 2006-03-07 13:22:00 UTC (rev 
13937)
@@ -35,7 +35,7 @@
 #include "ntptr/ntptr.h"
 #include "auth/gensec/gensec.h"
 #include "smbd/process_model.h"
-#include "smbd/proto.h"
+#include "smbd/service.h"
 
 /*
   recursively delete a directory tree



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

2006-03-07 Thread metze
Author: metze
Date: 2006-03-07 13:14:30 + (Tue, 07 Mar 2006)
New Revision: 13936

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

Log:
fix dependecy

metze
Modified:
   branches/SAMBA_4_0/source/libcli/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/config.mk
===
--- branches/SAMBA_4_0/source/libcli/config.mk  2006-03-07 13:06:59 UTC (rev 
13935)
+++ branches/SAMBA_4_0/source/libcli/config.mk  2006-03-07 13:14:30 UTC (rev 
13936)
@@ -89,7 +89,7 @@
resolve/bcast.o \
resolve/wins.o \
resolve/host.o
-REQUIRED_SUBSYSTEMS = LIBCLI_NBT
+REQUIRED_SUBSYSTEMS = LIBCLI_NBT LIBNETIF
 
 [SUBSYSTEM::LIBCLI_FINDDCS]
 OBJ_FILES = \



  1   2   >