]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
sync tree from 3.0
authorGerald Carter <jerry@samba.org>
Fri, 14 Nov 2003 03:36:13 +0000 (03:36 +0000)
committerGerald Carter <jerry@samba.org>
Fri, 14 Nov 2003 03:36:13 +0000 (03:36 +0000)
37 files changed:
WHATSNEW.txt
examples/pdb/mysql/mysql.dump
source/Makefile.in
source/VERSION
source/auth/auth_server.c
source/auth/auth_util.c
source/configure.in
source/include/printing.h
source/intl/lang_tdb.c
source/lib/charcnv.c
source/lib/util_str.c
source/nsswitch/winbindd.c
source/nsswitch/winbindd.h
source/nsswitch/winbindd_acct.c
source/nsswitch/winbindd_ads.c
source/nsswitch/winbindd_cache.c
source/nsswitch/winbindd_cm.c
source/nsswitch/winbindd_dual.c
source/nsswitch/winbindd_group.c
source/nsswitch/winbindd_misc.c
source/nsswitch/winbindd_pam.c
source/nsswitch/winbindd_rpc.c
source/nsswitch/winbindd_sid.c
source/nsswitch/winbindd_user.c
source/nsswitch/winbindd_util.c
source/nsswitch/winbindd_wins.c
source/passdb/pdb_ldap.c
source/printing/notify.c
source/printing/print_cups.c
source/printing/print_generic.c
source/printing/printing.c
source/printing/printing_db.c
source/rpc_parse/parse_misc.c
source/rpc_parse/parse_spoolss.c
source/sam/idmap_ldap.c
source/script/installswat.sh
source/utils/status.c

index 2e99416cf92c58eef2f377e09d68866edc4e1e72..ab12ba25527e973b00a3fafd986e93eb7977c00c 100644 (file)
@@ -1,26 +1,47 @@
-                   WHATS NEW IN Samba 3.0.1pre2
-                         November 7, 2003
+                   WHATS NEW IN Samba 3.0.1pre3
+                        November 14, 2003
                   ==============================
 
-This is a preview release of the Samba 3.0.1 code base and is 
-provided for testing only.  This release is *not* intended for 
+This is a preview release of the Samba 3.0.1 code base and is
+provided for testing only.  This release is *not* intended for
 production servers.  Use at your own risk.
 
-There have been several bug fixes since the 3.0.0 releaser that 
-we feel are important to make available to the Samba community 
-for wider testings.  See the "Changes" section for details on 
+There have been several bug fixes since the 3.0.0 releaser that
+we feel are important to make available to the Samba community
+for wider testings.  See the "Changes" section for details on
 exact updates.
 
 
 ######################################################################
 Changes
 #######
-Changes since 3.0.1pre1
+Changes since 3.0.1pre2
 -----------------------
 
-Please refer to the CVS log for the SAMBA_3_0 branch for complete 
+Please refer to the CVS log for the SAMBA_3_0 branch for complete
 details:
 
+1)  Skip over the winbind separator when looking up a user.
+    This fixes the bug that prevented local users from
+    matching an AD user when not running winbindd (bug 698).
+2)  Fix a problem with configure on *BSD systems. Make sure
+    we add -liconv etc to LDFLAGS.
+3)  Fix core dump bug when security=server and the server goes
+    away.
+4)  Correct crash bug due to an empty munged dial string.
+5)  Show locked files for -u <user> (bug 590).
+6)  Fix bug preventing print jobs from display in the queue
+    monitor used by Windows NT and later clients (bug 660).
+7)  Fix several reported problems with point-n-print from
+    Windows 2000/XP clients due to a bug in the EnumPrinterDataEx()
+    reply (bug 338, 527 & 643).
+8)  Fix a handful of potential memory leaks in the LDAP code used
+    by ldapsam[_compat] and the LDAP idmap backend.
+
+
+Changes since 3.0.1pre1
+-----------------------
+
 1)  Match Samba 2.2 behavior; make ACB_NORMAL the default ACB value.
 2)  Updated Japanese welcome file in SWAT.
 3)  Fix to  nt-time <-> unix-time functions reversible.
@@ -62,7 +83,7 @@ details:
 24) Change the \n after the password prompt to go to tty instead 
     of stdout (bug 668).
 25) Stop net -P from prompting for machine account password (bug 451).
-26) Change in behavior to Not only change the effective uid but also 
+26) Change in behavior to Not only change the effective uid but also
     the real uid when becoming unprivileged.
 27) Cope with Exchange 5.5 cleartext pop password auth.
 28) New files for support of initshutdown pipe.  Win2k doesn't 
@@ -89,7 +110,7 @@ details:
     apache header files.
 42) COrrect winbindd build problems on HP-UX 11
 43) Lowercase netgroups lookups (bug 703).
-44) Use the actual size of the buffer in strftime instead of a made 
+44) Use the actual size of the buffer in strftime instead of a made
     up value which just happens to be less than sizeof(fstring).  
     (bug 713).
 45) Add ldaplibs to pdbedit link line (bug 651).
@@ -108,7 +129,7 @@ details:
     lookup fails (bug 698).
 56) Add const for lp_set_name_resolve_order() to avoid compiler 
     warnings (bug 471).
-57) Add support for the %i macro in smb.conf to stand in for the for 
+57) Add support for the %i macro in smb.conf to stand in for the for
     the local IP address to which a client connected.
 58) Allow winbindd to match local accounts to domain SID when 
     'winbind trusted domains only = yes' (bug 680).
@@ -116,7 +137,7 @@ details:
     suffix.  It's not needed and provides inconsistent functionality 
     from the tdb backend.
 60) Patch to handle munged dial string for Windows 200 TSE.
-61) Correct the "smbldap_open: cannot access when not root error" 
+61) Correct the "smbldap_open: cannot access when not root error"
     messages when looking up group information (bug 281).
 
 
index 3bd6d198007595b2b6c6666787c88fd364a219f4..5da75f5745c09386e052feb4b5b8c8a4c4d4e92f 100644 (file)
@@ -31,5 +31,7 @@ CREATE TABLE user (
        logon_divs int(9),
        hours_len int(9),
        unknown_5 int(9),
-       unknown_6 int(9)
+       unknown_6 int(9),
+       bad_password_count int(9),
+       logon_count(9)
 );
index 83f266955b72b2ad046b83b42b36bfce0c2fc709..4aa34020d6cd4c603112c51a4931d76c7c4cc92a 100644 (file)
@@ -714,6 +714,12 @@ MAKEDIR = || exec false; \
          -o $@ 
 @BROKEN_CC@    -mv `echo $@ | sed 's%^.*/%%g'` $@
 
+# this adds support for precompiled headers. To use it, install a snapshot
+# of gcc-3.4 and run 'make pch' before you do the main build. 
+pch:
+       rm -f $(srcdir)/include/includes.h.gch
+       $(CC) -I. -I$(srcdir) $(FLAGS) -c $(srcdir)/include/includes.h -o $(srcdir)/include/includes.h.gch
+
 # These dependencies are only approximately correct: we want to make
 # sure Samba's paths are updated if ./configure is re-run.  Really it
 # would be nice if "make prefix=/opt/samba all" also rebuilt things,
index ea654aa76d64e760901c13dfc8347c4a9b20e223..3ee23fd66a3f97362aff23b86313a8ea75d57b1b 100644 (file)
@@ -41,7 +41,7 @@ SAMBA_VERSION_REVISION=
 # e.g. SAMBA_VERSION_PRE_RELEASE=1                     #
 #  ->  "2.2.9pre1"                                     #
 ########################################################
-SAMBA_VERSION_PRE_RELEASE=2
+SAMBA_VERSION_PRE_RELEASE=3
 
 ########################################################
 # For 'rc' releases the version will be                #
index 30e0e13a56e9f5999340d0e5a5c755219d71f395..b57293943c039346b24053419d1d9e41b3fbeaaa 100644 (file)
@@ -153,14 +153,16 @@ static void free_server_private_data(void **private_data_pointer)
 
 static void send_server_keepalive(void **private_data_pointer) 
 {
-       struct cli_state **cli = (struct cli_state **)private_data_pointer;
-       
        /* also send a keepalive to the password server if its still
           connected */
-       if (cli && *cli && (*cli)->initialised) {
-               if (!send_keepalive((*cli)->fd)) {
-                       DEBUG( 2, ( "password server keepalive failed.\n"));
-                       cli_shutdown(*cli);
+       if (private_data_pointer) {
+               struct cli_state *cli = (struct cli_state *)(*private_data_pointer);
+               if (cli && cli->initialised) {
+                       if (!send_keepalive(cli->fd)) {
+                               DEBUG( 2, ( "send_server_keepalive: password server keepalive failed.\n"));
+                               cli_shutdown(cli);
+                               *private_data_pointer = NULL;
+                       }
                }
        }
 }
index dd0c0b02dde0e53a3a7eecee9916fa2a35646c4d..d7d7f53e2d4898c7133d04c16591585c5695c877 100644 (file)
@@ -972,6 +972,7 @@ struct passwd *smb_getpwnam( char *domuser )
        p = strchr( domuser, *lp_winbind_separator() );
 
        if ( p ) {
+               p += 1;
                fstrcpy( mapped_username, p );
                map_username( mapped_username );        
                return Get_Pwnam(mapped_username);
index db9f3d45987d1825e38b41cd1e2b2433447f0f12..6a9a8f0f15ec9a23ba7342791e8f331a5a0ad621 100644 (file)
@@ -166,7 +166,6 @@ AC_SUBST(EXTRA_ALL_TARGETS)
 AC_ARG_ENABLE(debug, 
 [  --enable-debug          Turn on compiler debugging information (default=no)],
     [if eval "test x$enable_debug = xyes"; then
-        echo "DEBUGGING TURNED ON!!!!"
        CFLAGS="${CFLAGS} -g"
     fi])
 
@@ -1635,7 +1634,6 @@ dnl        AC_CACHE_CHECK([for working iconv],samba_cv_HAVE_NATIVE_ICONV,[
        default_dos_charset=no
        default_display_charset=no
        default_unix_charset=no
-       echo
 
        # check for default dos charset name
        for j in CP850 IBM850 ; do
@@ -1689,7 +1687,9 @@ dnl ])
            if test x"$jm_cv_lib_iconv" != x; then
               LIBS="$LIBS -l$jm_cv_lib_iconv"
            fi
+          dnl Add the flags we need to CPPFLAGS and LDFLAGS
           CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
+          LIB_ADD_DIR(LDFLAGS, "$i/lib")
           export CPPFLAGS
            AC_DEFINE(HAVE_NATIVE_ICONV,1,[Whether to use native iconv])
           AC_DEFINE_UNQUOTED(DEFAULT_DOS_CHARSET,$default_dos_charset,[Default dos charset name])
index 1d658a07681e2330d70d1faf0d45ca72aaa8cf3b..bf7c61b251ee4b47b4510860d1e605b8690aff86 100644 (file)
@@ -21,8 +21,6 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include "includes.h"
-
 /*
    This file defines the low-level printing system interfaces used by the
    SAMBA printing subsystem.
index b98e5734cbf82ac6ad0873aed84aaebad50b0831..fe2ad5b2fce48ab811600c2f282f6efd7f127607 100644 (file)
@@ -176,7 +176,8 @@ BOOL lang_tdb_init(const char *lang)
 const char *lang_msg(const char *msgid)
 {
        TDB_DATA key, data;
-       char *p, *q, *msgid_quoted;
+       const char *p;
+       char *q, *msgid_quoted;
        int count;
 
        lang_tdb_init(NULL);
index 9d15c6daa028b16fcd2c46488de83bd0d986b0d5..0a6a1fc75d6b42cf28508c1f3cdce2a83fe8ac29 100644 (file)
@@ -192,7 +192,7 @@ static size_t convert_string_internal(charset_t from, charset_t to,
 
        i_len=srclen;
        o_len=destlen;
-       retval = smb_iconv(descriptor,  &inbuf, &i_len, &outbuf, &o_len);
+       retval = smb_iconv(descriptor, (char **)&inbuf, &i_len, &outbuf, &o_len);
        if(retval==(size_t)-1) {
                const char *reason="unknown error";
                switch(errno) {
@@ -426,7 +426,7 @@ convert:
        i_len = srclen;
        o_len = destlen;
        retval = smb_iconv(descriptor,
-                          &inbuf, &i_len,
+                          (char **)&inbuf, &i_len,
                           &outbuf, &o_len);
        if(retval == (size_t)-1)                {
                const char *reason="unknown error";
index b6025a362d3443fc128812fcd5d0830a9295abda..c244a6b34bf33bd8d94a270d75c25e7c1428fdfa 100644 (file)
@@ -1194,7 +1194,7 @@ char *strchr_m(const char *src, char c)
 
        for (s = src; *s && !(((unsigned char)s[0]) & 0x80); s++) {
                if (*s == c)
-                       return s;
+                       return (char *)s;
        }
 
        if (!*s)
@@ -1242,7 +1242,7 @@ char *strrchr_m(const char *s, char c)
                                        break;
                                }
                                /* No - we have a match ! */
-                               return cp;
+                               return (char *)cp;
                        }
                } while (cp-- != s);
                if (!got_mb)
index 4b47ac13a2f3cbe3d149999ec636ba680078f57f..d8e233a3a8c218ee57ddebdbb830d795c09203b3 100644 (file)
@@ -22,6 +22,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "winbindd.h"
 
 BOOL opt_nocache = False;
index 677afa1849f2f571627fec91a6c37f9de98dd2a1..ea6d93116fe6c75bb1b6f15551975681f8b4fda0 100644 (file)
@@ -25,7 +25,6 @@
 #ifndef _WINBINDD_H
 #define _WINBINDD_H
 
-#include "includes.h"
 #include "nterr.h"
 
 #include "winbindd_nss.h"
index 0c06df7fdd4670a434ec835c939a2bbdea08554f..08b9e2172c7fdda541c47d95dc66b846d530c870 100644 (file)
@@ -20,6 +20,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "winbindd.h"
 
 #undef DBGC_CLASS
index 5d0f924d8f810bb92793a993219976ee361344a8..2fcf02a3164ddc8edbe35e05461b4eef7ce9aa01 100644 (file)
@@ -21,6 +21,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "winbindd.h"
 
 #ifdef HAVE_ADS
index bc6967dee1cd13d720ac6b0d34f19105daaece7c..cc80a584e01754c3bcc72d8da3760902b92b91a7 100644 (file)
@@ -22,6 +22,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "winbindd.h"
 
 #undef DBGC_CLASS
index 8513a46f8f2ebb2514a43f7181c98440c2e55193..4bf5a304590dd25640706536e02af39fbdfe8ae4 100644 (file)
@@ -56,6 +56,7 @@
 
  */
 
+#include "includes.h"
 #include "winbindd.h"
 
 #undef DBGC_CLASS
index 167630b0e1ff09ac0e8ed8126027a0093412017c..a9796afa3679712e0e6c18617e5b0bac81e0618d 100644 (file)
@@ -29,6 +29,7 @@
 
  */
 
+#include "includes.h"
 #include "winbindd.h"
 
 #undef DBGC_CLASS
index fba427536c8dd833c24fb156fb4e1cbbb1e60967..d951b3433e5d696746f5c168a5e5b3e260344e51 100644 (file)
@@ -22,6 +22,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "winbindd.h"
 
 #undef DBGC_CLASS
index 88fbb5ee0065d088e4216944d9345ae4390ddc6f..3352ed447c2bf6e55caf7c00de0731e3a67466af 100644 (file)
@@ -21,6 +21,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "winbindd.h"
 
 #undef DBGC_CLASS
index d696428de4c2d8a8f9ff3c3f641b92d4726cefbe..d43dca29c5410d922fae2fc21026f38e519df1c3 100644 (file)
@@ -22,6 +22,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "winbindd.h"
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
index ba14a51d240fd261ea667919f662e35fe1fd1ada..c6711a9ccfab05185ccceccf873bba4c7fcf5b1a 100644 (file)
@@ -21,6 +21,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "winbindd.h"
 
 #undef DBGC_CLASS
index 0faeec56369bd025e1ba8e980623c06d900335ee..6400a23b7bf5f9eacb6d9030d50f743fa6aec696 100644 (file)
@@ -20,6 +20,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "winbindd.h"
 
 #undef DBGC_CLASS
index eab88c842eac75aa3a436c956a91ff12303b7b54..903a2a8bfaf269ed995e21b9c15b5c2fdc174fef 100644 (file)
@@ -22,6 +22,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "winbindd.h"
 
 #undef DBGC_CLASS
index 6d1675752f420f41f049d692e1d3aaea1c27d821..1de2bd758f4a5b99fec21be3fd97fad5867f7969 100644 (file)
@@ -21,6 +21,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "winbindd.h"
 
 #undef DBGC_CLASS
index 49bee2dc9f741e69a5677df14ba90e99de1edada..bc982d00443fb749f5061f595118a235b119da44 100644 (file)
@@ -21,6 +21,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "winbindd.h"
 
 #undef DBGC_CLASS
index 9299ca2e50e25025d1ad35110f92c58b500c21b3..023e9f3fe0b62eb70879f109a3973a99a7a1a250 100644 (file)
@@ -5,7 +5,7 @@
    Copyright (C) Gerald Carter                 2001-2003
    Copyright (C) Shahms King                   2001
    Copyright (C) Andrew Bartlett               2002-2003
-   Copyright (C) Stefan (metze) Metzmacher     2002
+   Copyright (C) Stefan (metze) Metzmacher     2002-2003
     
    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
@@ -258,7 +258,7 @@ static NTSTATUS ldapsam_delete_entry(struct ldapsam_privates *ldap_state,
                                     char **attrs)
 {
        int rc;
-       LDAPMessage *entry;
+       LDAPMessage *entry = NULL;
        LDAPMod **mods = NULL;
        char *name, *dn;
        BerElement *ptr = NULL;
@@ -1017,8 +1017,8 @@ static NTSTATUS ldapsam_getsampwnam(struct pdb_methods *my_methods, SAM_ACCOUNT
 {
        NTSTATUS ret = NT_STATUS_UNSUCCESSFUL;
        struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
-       LDAPMessage *result;
-       LDAPMessage *entry;
+       LDAPMessage *result = NULL;
+       LDAPMessage *entry = NULL;
        int count;
        char ** attr_list;
        int rc;
@@ -1099,8 +1099,8 @@ static int ldapsam_get_ldap_user_by_sid(struct ldapsam_privates *ldap_state,
 static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, SAM_ACCOUNT * user, const DOM_SID *sid)
 {
        struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
-       LDAPMessage *result;
-       LDAPMessage *entry;
+       LDAPMessage *result = NULL;
+       LDAPMessage *entry = NULL;
        int count;
        int rc;
        fstring sid_string;
@@ -1264,7 +1264,7 @@ static NTSTATUS ldapsam_delete_sam_account(struct pdb_methods *my_methods, SAM_A
        struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
        const char *sname;
        int rc;
-       LDAPMessage *result;
+       LDAPMessage *result = NULL;
        NTSTATUS ret;
        char **attr_list;
        fstring objclass;
@@ -1328,9 +1328,9 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, SAM_A
        struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
        int rc = 0;
        char *dn;
-       LDAPMessage *result;
-       LDAPMessage *entry;
-       LDAPMod **mods;
+       LDAPMessage *result = NULL;
+       LDAPMessage *entry = NULL;
+       LDAPMod **mods = NULL;
        char **attr_list;
 
        result = pdb_get_backend_private_data(newpwd, my_methods);
@@ -1361,13 +1361,14 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, SAM_A
                                element_is_changed)) {
                DEBUG(0, ("ldapsam_update_sam_account: init_ldap_from_sam failed!\n"));
                SAFE_FREE(dn);
+               if (mods != NULL)
+                       ldap_mods_free(mods,True);
                return NT_STATUS_UNSUCCESSFUL;
        }
        
        if (mods == NULL) {
                DEBUG(4,("ldapsam_update_sam_account: mods is empty: nothing to update for user: %s\n",
                         pdb_get_username(newpwd)));
-               ldap_mods_free(mods, True);
                SAFE_FREE(dn);
                return NT_STATUS_OK;
        }
@@ -1458,6 +1459,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
                                DEBUG(0,("ldapsam_add_sam_account: SID '%s' already in the base, with samba attributes\n", 
                                         sid_to_string(sid_string, sid)));
                                free_attr_list( attr_list );
+                               ldap_msgfree(result);
                                return NT_STATUS_UNSUCCESSFUL;
                        }
                        ldap_msgfree(result);
@@ -1514,6 +1516,11 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
                         LDAP_OBJ_IDMAP_ENTRY,
                         LDAP_OBJ_SID_ENTRY);
                
+               /* free old result before doing a new search */
+               if (result != NULL) {
+                       ldap_msgfree(result);
+                       result = NULL;
+               }
                rc = smbldap_search_suffix(ldap_state->smbldap_state, 
                                           filter, attr_list, &result);
                        
@@ -1566,6 +1573,8 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
                                element_is_set_or_changed)) {
                DEBUG(0, ("ldapsam_add_sam_account: init_ldap_from_sam failed!\n"));
                ldap_msgfree(result);
+               if (mods != NULL)
+                       ldap_mods_free(mods,True);
                return NT_STATUS_UNSUCCESSFUL;          
        }
        
@@ -1626,9 +1635,9 @@ static int ldapsam_search_one_group (struct ldapsam_privates *ldap_state,
                ldap_get_option(ldap_state->smbldap_state->ldap_struct, LDAP_OPT_ERROR_STRING,
                                &ld_error);
                DEBUG(0, ("ldapsam_search_one_group: "
-                         "Problem during the LDAP search: LDAP error: %s (%s)",
+                         "Problem during the LDAP search: LDAP error: %s (%s)\n",
                          ld_error?ld_error:"(unknown)", ldap_err2string(rc)));
-               DEBUG(3, ("ldapsam_search_one_group: Query was: %s, %s\n",
+               DEBUGADD(3, ("ldapsam_search_one_group: Query was: %s, %s\n",
                          lp_ldap_group_suffix(), filter));
                SAFE_FREE(ld_error);
        }
@@ -1745,8 +1754,8 @@ static NTSTATUS ldapsam_getgroup(struct pdb_methods *methods,
 {
        struct ldapsam_privates *ldap_state =
                (struct ldapsam_privates *)methods->private_data;
-       LDAPMessage *result;
-       LDAPMessage *entry;
+       LDAPMessage *result = NULL;
+       LDAPMessage *entry = NULL;
        int count;
 
        if (ldapsam_search_one_group(ldap_state, filter, &result)
@@ -1957,10 +1966,10 @@ static NTSTATUS ldapsam_update_group_mapping_entry(struct pdb_methods *methods,
        struct ldapsam_privates *ldap_state =
                (struct ldapsam_privates *)methods->private_data;
        int rc;
-       char *dn;
-       LDAPMessage *result;
-       LDAPMessage *entry;
-       LDAPMod **mods;
+       char *dn = NULL;
+       LDAPMessage *result = NULL;
+       LDAPMessage *entry = NULL;
+       LDAPMod **mods = NULL;
 
        rc = ldapsam_search_one_group_by_gid(ldap_state, map->gid, &result);
 
@@ -1980,6 +1989,8 @@ static NTSTATUS ldapsam_update_group_mapping_entry(struct pdb_methods *methods,
                                  result, &mods, map)) {
                DEBUG(0, ("ldapsam_update_group_mapping_entry: init_ldap_from_group failed\n"));
                ldap_msgfree(result);
+               if (mods != NULL)
+                       ldap_mods_free(mods,True);
                return NT_STATUS_UNSUCCESSFUL;
        }
 
@@ -2022,7 +2033,7 @@ static NTSTATUS ldapsam_delete_group_mapping_entry(struct pdb_methods *methods,
 {
        struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)methods->private_data;
        pstring sidstring, filter;
-       LDAPMessage *result;
+       LDAPMessage *result = NULL;
        int rc;
        NTSTATUS ret;
        char **attr_list;
@@ -2176,6 +2187,11 @@ static void free_private_data(void **vp)
 
        smbldap_free_struct(&(*ldap_state)->smbldap_state);
 
+       if ((*ldap_state)->result != NULL) {
+               ldap_msgfree((*ldap_state)->result);
+               (*ldap_state)->result = NULL;
+       }
+
        *ldap_state = NULL;
 
        /* No need to free any further, as it is talloc()ed */
@@ -2342,8 +2358,8 @@ and will risk BDCs having inconsistant SIDs\n"));
                                 alg_rid_base_string)) {
                alg_rid_base = (uint32)atol(alg_rid_base_string);
                if (alg_rid_base != algorithmic_rid_base()) {
-                       DEBUG(0, ("pdb_init_ldapsam: The value of 'algorithmic RID base' has changed since the LDAP\n\
-database was initialised.  Aborting. \n"));
+                       DEBUG(0, ("The value of 'algorithmic RID base' has changed since the LDAP\n"
+                                 "database was initialised.  Aborting. \n"));
                        ldap_msgfree(result);
                        return NT_STATUS_UNSUCCESSFUL;
                }
index f2dd7d4f221b99bfe84439dc1ba3878313fb9dde..7750239630cabfa04878a2410a90279ca36dc76b 100644 (file)
@@ -20,6 +20,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "printing.h"
 
 static TALLOC_CTX *send_ctx;
index 7cf21c966e48bdd62f4ce92b49a7939036d52caa..34eee7d97f7c569056012627a3dbae32fe58cbc1 100644 (file)
@@ -18,6 +18,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include "includes.h"
 #include "printing.h"
 
 #ifdef HAVE_CUPS
index 1c847448da2e95b8fc01c6a65df41c5097cc6e27..9e0ea85bb9adcb6b0ad46e1ccd844649a9943fe0 100644 (file)
@@ -18,6 +18,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "printing.h"
 
 
index 1a878afb925537b46905233ee80c4ac183afb56d..ad17213c2d65f0d0efeb83cb0d3cad1f446b03fd 100644 (file)
@@ -20,6 +20,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "printing.h"
 
 /* Current printer interface */
@@ -849,7 +850,7 @@ static void store_queue_struct(struct tdb_print_db *pdb, struct traverse_struct
        size_t i;
        uint qcount;
 
-       if (max_reported_jobs < pts->qcount)
+       if (max_reported_jobs && (max_reported_jobs < pts->qcount))
                pts->qcount = max_reported_jobs;
        qcount = pts->qcount;
 
@@ -2146,7 +2147,7 @@ static BOOL get_stored_queue_info(struct tdb_print_db *pdb, int snum, int *pcoun
        len = 0;
        for( i  = 0; i < qcount; i++) {
                uint32 qjob, qsize, qpage_count, qstatus, qpriority, qtime;
-               len += tdb_unpack(data.dptr + 4 + len, data.dsize - len, NULL, "ddddddff",
+               len += tdb_unpack(data.dptr + 4 + len, data.dsize - len, "ddddddff",
                                &qjob,
                                &qsize,
                                &qpage_count,
index 1c7ac713537c0a453e48e23de5ff41ddd2260996..0e0fb1b51d694689606c7b643af0f1a25cc1086f 100644 (file)
@@ -20,6 +20,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "includes.h"
 #include "printing.h"
 
 static struct tdb_print_db *print_db_head;
index 86ea83d7aa8819b67778662672671e95d8658f39..203122e73c0ebc150afddb841ac45e64a3cdde31 100644 (file)
@@ -1016,7 +1016,7 @@ void init_unistr2_from_datablob(UNISTR2 *str, DATA_BLOB *blob)
        str->uni_max_len = str->uni_str_len;
        str->offset = 0;
        str->buffer = (uint16 *) memdup(blob->data, blob->length);
-       if (!str->buffer) {
+       if ((str->buffer == NULL) && (blob->length > 0)) {
                smb_panic("init_unistr2_from_datablob: malloc fail\n");
        }
 }
index 65f16414a0a7904f6abae0d68f7a01a10f6b4db0..758131676763ec22a11cb76acfc15fafba05d80a 100644 (file)
@@ -7294,11 +7294,13 @@ static BOOL spoolss_io_printer_enum_values_ctr(const char *desc, prs_struct *ps,
                if (!prs_unistr("valuename", ps, depth, &ctr->values[i].valuename))
                        return False;
                
-               if (UNMARSHALLING(ps) && ctr->values[i].data_len) {
-                       ctr->values[i].data = (uint8 *)prs_alloc_mem(
-                               ps, ctr->values[i].data_len);
-                       if (!ctr->values[i].data)
-                               return False;
+               if ( ctr->values[i].data_len ) {
+                       if ( UNMARSHALLING(ps) ) {
+                               ctr->values[i].data = (uint8 *)prs_alloc_mem(
+                                       ps, ctr->values[i].data_len);
+                               if (!ctr->values[i].data)
+                                       return False;
+                       }
                        if (!prs_uint8s(False, "data", ps, depth, ctr->values[i].data, ctr->values[i].data_len))
                                return False;
                }
index 2a94de755ac1da1f9fb1ad740d290d9c12729a3d..db1bb74de53cc2e360b748783a7764e0ce31e296 100644 (file)
@@ -234,6 +234,7 @@ static NTSTATUS ldap_next_rid(struct ldap_idmap_state *state, uint32 *rid,
 
                        next_rid = *rid+1;
                        if (next_rid >= alg_rid_base) {
+                               ldap_msgfree(domain_result);
                                return NT_STATUS_UNSUCCESSFUL;
                        }
                        
@@ -382,7 +383,7 @@ static NTSTATUS ldap_allocate_id(unid_t *id, int id_type)
        pstring id_str, new_id_str;
        LDAPMod **mods = NULL;
        const char *type;
-       char *dn;
+       char *dn = NULL;
        char **attr_list;
        pstring filter;
        uid_t   luid, huid;
@@ -455,12 +456,15 @@ static NTSTATUS ldap_allocate_id(unid_t *id, int id_type)
                 
        smbldap_set_mod( &mods, LDAP_MOD_DELETE, type, id_str );                 
        smbldap_set_mod( &mods, LDAP_MOD_ADD, type, new_id_str );
-       
+
+       if (mods == NULL) {
+               DEBUG(0,("ldap_allocate_id: smbldap_set_mod() failed.\n"));
+               goto out;               
+       }
+
        rc = smbldap_modify(ldap_state.smbldap_state, dn, mods);
 
-       SAFE_FREE(dn);
        ldap_mods_free( mods, True );
-       
        if (rc != LDAP_SUCCESS) {
                DEBUG(0,("ldap_allocate_id: Failed to allocate new %s.  ldap_modify() failed.\n",
                        type));
@@ -469,6 +473,10 @@ static NTSTATUS ldap_allocate_id(unid_t *id, int id_type)
        
        ret = NT_STATUS_OK;
 out:
+       SAFE_FREE(dn);
+       if (result != NULL)
+               ldap_msgfree(result);
+
        return ret;
 }
 
@@ -683,6 +691,8 @@ static NTSTATUS verify_idpool( void )
 
        count = ldap_count_entries(ldap_state.smbldap_state->ldap_struct, result);
 
+       ldap_msgfree(result);
+
        if ( count > 1 ) {
                DEBUG(0,("ldap_idmap_init: multiple entries returned from %s (base == %s)\n",
                        filter, lp_ldap_idmap_suffix() ));
index be0cdf3eef801ba427cf686f4d82262962812218..7ac675de10376d26e12f5e72bd41774b7156918b 100755 (executable)
@@ -62,14 +62,17 @@ for ln in $LANGS; do
 
 done
 
-# Install html documentation
+# Install html documentation (if html documentation tree is here)
 
-for f in $SRCDIR../docs/htmldocs/*.html; do
-      FNAME=$SWATDIR/help/`basename $f`
-      echo $FNAME
-      cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
-      chmod 0644 $FNAME
-done
+if [ -d $SRCDIR../docs/htmldocs/ ]; then
+
+    for f in $SRCDIR../docs/htmldocs/*.html; do
+       FNAME=$SWATDIR/help/`basename $f`
+       echo $FNAME
+       cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
+       chmod 0644 $FNAME
+    done
+fi
 
 # Install Using Samba book (but only if it is there)
 
index c17e080b6bf384afc47174d12d062f97f0a4792b..54dce1ecf0f43f3bd8a00965e38919be9dda9e44 100644 (file)
 
 #include "includes.h"
 
-static pstring Ucrit_username = "";                   /* added by OH */
-static pid_t   Ucrit_pid[100];  /* Ugly !!! */        /* added by OH */
-static int            Ucrit_MaxPid=0;                        /* added by OH */
-static unsigned int   Ucrit_IsActive = 0;                    /* added by OH */
+#define SMB_MAXPIDS            2048
+static pstring                 Ucrit_username = "";               /* added by OH */
+static pid_t           Ucrit_pid[SMB_MAXPIDS];  /* Ugly !!! */   /* added by OH */
+static int             Ucrit_MaxPid=0;                    /* added by OH */
+static unsigned int    Ucrit_IsActive = 0;                /* added by OH */
+
 static int verbose, brief;
 static int            shares_only = 0;            /* Added by RJS */
 static int            locks_only  = 0;            /* Added by RJS */
@@ -49,26 +51,53 @@ static int show_brl;
 static void Ucrit_addUsername(const char *username)
 {
        pstrcpy(Ucrit_username, username);
-       if(strlen(Ucrit_username) > 0)
+       
+       if ( strlen(Ucrit_username) > 0 )
                Ucrit_IsActive = 1;
 }
 
 static unsigned int Ucrit_checkUsername(const char *username)
 {
-       if ( !Ucrit_IsActive) return 1;
-       if (strcmp(Ucrit_username,username) ==0) return 1;
+       if ( !Ucrit_IsActive ) 
+               return 1;
+       
+       if ( strcmp(Ucrit_username,username) == 0 ) 
+               return 1;
+       
        return 0;
 }
 
 static unsigned int Ucrit_checkPid(pid_t pid)
 {
        int i;
-       if ( !Ucrit_IsActive) return 1;
-       for (i=0;i<Ucrit_MaxPid;i++)
-               if( pid == Ucrit_pid[i] ) return 1;
+       
+       if ( !Ucrit_IsActive ) 
+               return 1;
+       
+       for (i=0;i<Ucrit_MaxPid;i++) {
+               if( pid == Ucrit_pid[i] ) 
+                       return 1;
+       }
+       
        return 0;
 }
 
+static BOOL Ucrit_addPid( pid_t pid )
+{
+       if ( !Ucrit_IsActive )
+               return True;
+
+       if ( Ucrit_MaxPid >= SMB_MAXPIDS ) {
+               d_printf("ERROR: More than %d pids for user %s!\n",
+                       SMB_MAXPIDS, Ucrit_username);
+
+               return False;
+       }
+
+       Ucrit_pid[Ucrit_MaxPid++] = pid;
+       
+       return True;
+}
 
 static void print_share_mode(share_mode_entry *e, char *fname)
 {
@@ -526,6 +555,8 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
                return 0;
        }
 
+       Ucrit_addPid( sessionid.pid );
+
        d_printf("%5d   %-12s  %-12s  %-12s (%s)\n",
               (int)sessionid.pid, uidtoname(sessionid.uid), gidtoname(sessionid.gid), 
               sessionid.remote_machine, sessionid.hostname);