[SCM] SAMBA-CTDB repository - branch v3-2-ctdb updated - build_3.2.7_ctdb.54-29-g0a648c5

Michael Adam obnox at samba.org
Mon Jan 19 22:18:37 GMT 2009


The branch, v3-2-ctdb has been updated
       via  0a648c520756fdd6f25b60c69b1e19a1a58dd03a (commit)
       via  5db09d4dd27e10c926c3413bcd3088e72a4af487 (commit)
       via  f89c3db4ae0bcf1680c2532833ee115005b8ed70 (commit)
       via  0900b10f64fbb9f2e55591d1b11be9bb29526744 (commit)
       via  652151fe7b0a48b5ae6272a088ce80ad428f1928 (commit)
       via  3c56cd9f701254dec33aa60b6f6b3fa90a28557a (commit)
       via  174b595bb171c32be9079f9f691b415ac0fdc635 (commit)
       via  ded86426c222b11b9c2e8d8e4cae5ed0eff19edd (commit)
       via  91d30b8a3406d01b5fca97a96ad5964703813f0e (commit)
       via  ac4baafeb8d74bf1db7f2ce84b2bc3abdef90337 (commit)
       via  d9f66f3e3d9af9c3323029207e62391f382632e9 (commit)
       via  3504910d91fa6d174861815255062efefb0c46aa (commit)
       via  2cca28b3e999a8886539b9a5dde267bb8a3a1db7 (commit)
       via  078c4fbab8a5be2e23acda1978fd6d6071898dd9 (commit)
       via  ac7c18d642bef231730927347e7b0296b1c9d82b (commit)
       via  b13f7e296a70e1280baae9f2f3156043c48bafa9 (commit)
       via  a2944e99825943f91d0260c218de06817acfcf51 (commit)
       via  76555085fd9bb40a4c0e2c18b5bf965dcf636cb1 (commit)
       via  7c0b99baafc4a0bc04251c9a456bf2cc104058c4 (commit)
       via  25e035815681136e69b9d49d548b7d7b908011c5 (commit)
       via  e443cfaa25c26a7761113bdde9b7453a97f8e5d5 (commit)
       via  3ac7289b4d7fef830b05a8cb351476480681b28a (commit)
       via  e1af2b4bc824450615454adec460e6698a83cefc (commit)
       via  61c5589d1fa4d6fe7ce7293a6f6ceab96d4ee193 (commit)
       via  b4dc70f3bd79505de0e66283bf6d312dd3b53b27 (commit)
       via  62d547e1b853b6c5c871f1f9cb265d3cdd40a21d (commit)
       via  e2b4e25b433a43960bb37258c0f24d9b77598056 (commit)
      from  23827a5f547a4bcfada8677648e8611170537a38 (commit)

http://gitweb.samba.org/?p=obnox/samba-ctdb.git;a=shortlog;h=v3-2-ctdb


- Log -----------------------------------------------------------------
commit 0a648c520756fdd6f25b60c69b1e19a1a58dd03a
Merge: 23827a5f547a4bcfada8677648e8611170537a38 5db09d4dd27e10c926c3413bcd3088e72a4af487
Author: Michael Adam <obnox at samba.org>
Date:   Mon Jan 19 23:10:24 2009 +0100

    Merge commit 'origin/v3-2-test' into v3-2-ctdb

commit 5db09d4dd27e10c926c3413bcd3088e72a4af487
Author: Andreas Schneider <anschneider at suse.de>
Date:   Mon Jan 19 16:26:07 2009 +0100

    Avoid flooding of syslog with failing pam_putenv messages.
    
    Signed-off-by: Andreas Schneider <anschneider at suse.de>
    Signed-off-by: Günther Deschner <gd at samba.org>

commit f89c3db4ae0bcf1680c2532833ee115005b8ed70
Author: Karolin Seeger <kseeger at samba.org>
Date:   Mon Jan 19 10:22:46 2009 +0100

    S3-ByExample: Use 'winbindd -D' instead of 'winbindd -B'.
    
    The option '-B' does not exist at all.
    
    Thanks to Jason Ellison for reporting!
    
    Karolin
    (cherry picked from commit 4b26c7bbf4fe93f5ffb92d3f04012be290be25be)
    (cherry picked from commit 05c7d97e6cf25c05ba6a661c0a31c88946ffd5cd)

commit 0900b10f64fbb9f2e55591d1b11be9bb29526744
Author: Karolin Seeger <kseeger at samba.org>
Date:   Mon Jan 19 08:55:30 2009 +0100

    S3-HowTo: Change 'winbindd -B' to 'winbindd -D'.
    
    There is no option '-B' at all.
    
    Thanks to Jason Ellison for reporting!
    
    Karolin
    (cherry picked from commit 7c1e08518bfbe054db270e72476c642d5db93c0a)
    (cherry picked from commit 3b5d2fd4cc5f7cbe22be1dfc593ca4ba29197b66)

commit 652151fe7b0a48b5ae6272a088ce80ad428f1928
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jan 14 11:52:01 2009 +0100

    s3:docs: vfs_fileid manpage
    
    metze
    (cherry picked from commit 6a94b7b9270f3d69595b93e2632051c9842645c9)
    (cherry picked from commit 8e13be1db5c51002ae72c42c505a79406b2f4f63)

commit 3c56cd9f701254dec33aa60b6f6b3fa90a28557a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jan 14 13:59:09 2009 +0100

    s3:vfs_fileid: readd "fileid:algorithm" as option.
    
    "fileid:mapping" is still supported as fallback.
    
    metze
    (cherry picked from commit 554a89df0cf6d9832778e2913f9fe50b78baeedc)
    (cherry picked from commit fe9ad21b8cb5286845350fe2280da2cbe2647bb7)

commit 174b595bb171c32be9079f9f691b415ac0fdc635
Author: Andrew Tridgell <tridge at samba.org>
Date:   Mon Apr 21 18:40:45 2008 +0200

    keep compatibility with v3-0-ctdb name for fileid:mapping option
    (cherry picked from commit 2856d2e4a43fbcc6c8f8ac7b1613828170362861)

commit ded86426c222b11b9c2e8d8e4cae5ed0eff19edd
Author: Derrell Lipman <derrell.lipman at unwireduniverse.com>
Date:   Sat Jan 17 13:35:12 2009 -0500

    Determine case sensitivity based on file system attributes.
    
    - Most of the time, we can determine from the file system we're connecting to
      whether it supports case sensitivity. In those cases, we now set the
      internal case sensitivity flag automatically. For those cases where the
      request to retrieve file system attributes fails, we'll use the
      user-specified option value.
    
    Derrell

commit 91d30b8a3406d01b5fca97a96ad5964703813f0e
Author: Derrell Lipman <derrell.lipman at unwireduniverse.com>
Date:   Fri Jan 16 20:29:28 2009 -0500

    [Bug 6022] smbc_urlencode and smbc_urldecode were not exported
    
    - Since the revamp of libsmbclient, there has still been an external
      declaration for smbc_urlencode and smbc_urldecode in libsmbclient.h, yet
      those functions were renamed and made private. The two choices were to
      remove the function names from libsmbclient.h or to make them public
      again. The reported requested that they be public. This commit makes it so.
    
    Derrell

commit ac4baafeb8d74bf1db7f2ce84b2bc3abdef90337
Author: Derrell Lipman <derrell.lipman at unwireduniverse.com>
Date:   Fri Jan 16 16:00:41 2009 -0500

    Treat file names in POSIX-like case-sensitive fashion by default
    
    *** THIS COMMIT CAUSES A CHANGE OF DEFAULT BEHAVIOR IN libsmbclient!!! ***
    
    - libsmbclient now calls cli_set_case_sensitive() for a new CLI. By default,
      it requests case-sensitive, but the old behavior of case-insensitive can be
      requested with smbc_setOptionCaseSensitive(context, False);
    
      The change of behavior is considered a bug fix, as it was previously
      possible to accidentally overwrite a file that had the same case-insensitive
      name but a different case-sensitive name as a previously-existing file,
      while creating a new file.
    
    Derrell

commit d9f66f3e3d9af9c3323029207e62391f382632e9
Author: Andreas Schneider <anschneider at suse.de>
Date:   Fri Jan 16 12:23:00 2009 -0800

    Fix a segfault if ? is there but the options are NULL. This is the case if SMBC_parse_path is called by SMBC_stat_ctx.

commit 3504910d91fa6d174861815255062efefb0c46aa
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Jan 16 11:55:40 2009 -0800

    "First thing, kill all the language lawyers" :-). Ensure possible insane compilers
    can't kill us later.
    Jeremy.

commit 2cca28b3e999a8886539b9a5dde267bb8a3a1db7
Author: Tim Prouty <tprouty at samba.org>
Date:   Thu Jan 8 17:21:08 2009 -0800

    s3: Remove a few unnecessary checks from the streams depot module and fix to work with NTRENAME
    
    Handling of error codes when renaming a file to a stream and a stream
    to a file is now done in rename_internals_fsp.
    
    The NTRENAME stream path only passes in the stream name, so the new
    base can now be different from the old base.

commit 078c4fbab8a5be2e23acda1978fd6d6071898dd9
Author: Tim Prouty <tprouty at samba.org>
Date:   Thu Jan 8 17:20:14 2009 -0800

    s3: Remove a few unnecessary checks from the streams xattr module
    
    Handling of error codes when renaming a file to a stream and a stream
    to a file is now done in rename_internals_fsp.
    
    The NTRENAME stream path only passes in the stream name, so the new
    base can now be different from the old base.

commit ac7c18d642bef231730927347e7b0296b1c9d82b
Author: Tim Prouty <tprouty at samba.org>
Date:   Thu Jan 8 17:19:24 2009 -0800

    s3: Allow renames of streams via NTRENAME and fix stream error codes on rename
    
    The test_streams_rename2 test in RAW-STREAMS verifies these changes

commit b13f7e296a70e1280baae9f2f3156043c48bafa9
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Jan 15 15:54:07 2009 -0800

    Fix bug #6040 -  Missing <th> header in Status page.
    Based on a patch from pkg-samba-maint at lists.alioth.debian.org.
    Jeremy.

commit a2944e99825943f91d0260c218de06817acfcf51
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Jan 15 15:51:40 2009 -0800

    Allow reinit_after_fork to be called safely from within swat and other binaries that don't have
    an event context or a msg context. Fixes crash bug in swat.
    Jeremy.

commit 76555085fd9bb40a4c0e2c18b5bf965dcf636cb1
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Jan 15 10:30:19 2009 -0800

    Fix bug #6040 - Calling Samba print server with an aliased DNS-name fails.
    Jeremy.

commit 7c0b99baafc4a0bc04251c9a456bf2cc104058c4
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Jan 14 13:17:02 2009 -0800

    Fix bug #6035 - Possible race between fcntl F_SETLKW and alarm delivery.
    Jeremy.

commit 25e035815681136e69b9d49d548b7d7b908011c5
Author: Bo Yang <boyang at novell.com>
Date:   Wed Jan 14 11:49:11 2009 -0800

    Fix bug in get_dc_name_via_netlogon(), null pointer refrence.

commit e443cfaa25c26a7761113bdde9b7453a97f8e5d5
Author: Bo Yang <boyang at novell.com>
Date:   Wed Jan 14 11:13:27 2009 -0800

    Don't send message to any other child in child process.

commit 3ac7289b4d7fef830b05a8cb351476480681b28a
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jan 14 09:48:19 2009 +0100

    Remove proto.h that got accidentially committet to v3-2-test
    
    in commit 61c5589d1fa4d6fe7ce7293a6f6ceab96d4ee193
    (fix for bug #6019)
    
    When cherry-picking from v3-3-test (or master) to v3-2-test,
    we need to check that proto.h gets removed before committing,
    since v3-2-test still has make proto.
    
    Michael

commit e1af2b4bc824450615454adec460e6698a83cefc
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jan 13 15:57:53 2009 -0800

    From boyang - ensure we never "return" from a forked child, always _exit().
    Jeremy.

commit 61c5589d1fa4d6fe7ce7293a6f6ceab96d4ee193
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jan 13 11:15:10 2009 -0800

    Fix bug #6019 File corruption in Clustered SMB/NFS environment managed via CTDB
    Jeremy.

commit b4dc70f3bd79505de0e66283bf6d312dd3b53b27
Merge: 62d547e1b853b6c5c871f1f9cb265d3cdd40a21d 38b297f99ec166e5c40ba33774222b37b45b4fec
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jan 12 10:47:02 2009 -0800

    Merge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into v3-2-test

commit 62d547e1b853b6c5c871f1f9cb265d3cdd40a21d
Author: Tim Prouty <tprouty at samba.org>
Date:   Sat Dec 6 16:08:35 2008 -0800

    Fix a delete on close divergence from windows [2/2]
    
    This second patch cleans up by removing all of the code that is made
    obsolete by the first patch.  It should cause no functional changes.

commit e2b4e25b433a43960bb37258c0f24d9b77598056
Author: Tim Prouty <tprouty at samba.org>
Date:   Sun Dec 7 10:30:01 2008 -0800

    Fix a delete on close divergence from windows [1/2]
    
    smbtorture4's BASE-DELETE:deltest17 was failing against win2k8,
    win2k3, and winXPsp2 but passing against samba.
    
    deltest17 does the following:
    
    1. open file -> file is created
    2. closes file
    3. open file with DOC -> fnum1
    4. check that DOC is not reported as being set from fnum1
    5. opens file again Read Only -> fnum2
    6. check that DOC is not reported as being set from either file handle
    7. close fnum1 (the file handle that requested DOC to be set)
    8. check if DOC is reported as being set from fnum2
     * This is where windows and samba begin to diverge.  Windows
       reports that the DOC bit is set, while samba reports that it is not set.
    9. close fnum2 (the last remaining open handle for the file)
    10.See if the file has been deleted.
     * On samba the file still exists.  On windows the file was deleted.
    
    The way open_file_ntcreate is written now, if an open has the DOC bit
    set on the wire, DOC (fsp->initial_delete_on_close) is not set unless:
    a. the open creates the file, or b. there is an open file handle with
    a share_entry in the struct lck that has the
    SHARE_MODE_ALLOW_INITIAL_DELETE_ON_CLOSE bit set (let's call it
    SM_AIDOC).
    
    My understanding of SM_AIDOC is that it was added to differentiate
    between DOC being set on an open that creates a file vs an open that
    opens an existing.  As described in step 8/10 above, it appears that
    windows does not make this differentiation.
    
    To resolve this issue there are two patches.  This first patch is a
    simple proof of concept change that is sufficient to fix the bug.  It
    removes the differentiation in open_file_ntcreate, and updates
    deltest17 to allow it to pass against win2k3/xp.  This makes
    open_file_ntcreate more closely match the semantics in open_directory
    and rename_internals_fsp.  This change also does not break any other
    tests in BASE-DELETE or "make test".  Specifically test deltest20b
    which verifies the CIFSFS rename DOC semantics still passes :).

-----------------------------------------------------------------------

Summary of changes:
 .../Samba3-ByExample/SBE-DomainAppsSupport.xml     |    2 +-
 .../Samba3-ByExample/SBE-SecureOfficeServer.xml    |    4 +-
 docs-xml/Samba3-ByExample/SBE-TheSmallOffice.xml   |    4 +-
 docs-xml/Samba3-HOWTO/TOSHARG-Compiling.xml        |    6 +-
 docs-xml/Samba3-HOWTO/TOSHARG-Winbind.xml          |    4 +-
 docs-xml/manpages-3/vfs_fileid.8.xml               |  112 ++++++++++++++++++++
 source/include/libsmb_internal.h                   |   15 +--
 source/include/libsmbclient.h                      |   21 ++++
 source/include/smb.h                               |    1 -
 source/lib/sendfile.c                              |    4 +-
 source/lib/util.c                                  |   24 +++--
 source/lib/util_sock.c                             |    9 +-
 source/libsmb/libsmb_context.c                     |    1 +
 source/libsmb/libsmb_dir.c                         |    2 +-
 source/libsmb/libsmb_path.c                        |   10 +-
 source/libsmb/libsmb_server.c                      |   66 +++++++++++-
 source/libsmb/libsmb_setget.c                      |   26 +++++
 source/locking/locking.c                           |   46 +--------
 source/modules/vfs_fileid.c                        |    8 ++-
 source/modules/vfs_streams_depot.c                 |   30 +++--
 source/modules/vfs_streams_xattr.c                 |   11 --
 source/nsswitch/pam_winbind.c                      |    2 +-
 source/passdb/pdb_smbpasswd.c                      |    2 +-
 source/smbd/nttrans.c                              |   14 ++--
 source/smbd/open.c                                 |   11 +-
 source/smbd/reply.c                                |   31 +++---
 source/web/statuspage.c                            |    3 +-
 source/winbindd/winbindd_cm.c                      |    8 +-
 source/winbindd/winbindd_dual.c                    |   38 ++++++-
 29 files changed, 364 insertions(+), 151 deletions(-)
 create mode 100644 docs-xml/manpages-3/vfs_fileid.8.xml


Changeset truncated at 500 lines:

diff --git a/docs-xml/Samba3-ByExample/SBE-DomainAppsSupport.xml b/docs-xml/Samba3-ByExample/SBE-DomainAppsSupport.xml
index 6d144ab..c9ccd43 100644
--- a/docs-xml/Samba3-ByExample/SBE-DomainAppsSupport.xml
+++ b/docs-xml/Samba3-ByExample/SBE-DomainAppsSupport.xml
@@ -477,7 +477,7 @@ Password for ADMINISTRATOR at LONDON.ABMAS.BIZ:
 <screen>
 &rootprompt; smbd -D
 &rootprompt; nmbd -D
-&rootprompt; winbindd -B
+&rootprompt; winbindd -D
 </screen>
 		</para></step>
 
diff --git a/docs-xml/Samba3-ByExample/SBE-SecureOfficeServer.xml b/docs-xml/Samba3-ByExample/SBE-SecureOfficeServer.xml
index e03c010..2e60b4a 100644
--- a/docs-xml/Samba3-ByExample/SBE-SecureOfficeServer.xml
+++ b/docs-xml/Samba3-ByExample/SBE-SecureOfficeServer.xml
@@ -1910,8 +1910,8 @@ Loaded services file OK.
 14290 ?        S      0:00 /usr/sbin/smbd -D
 
 $rootprompt; ps ax | grep winbind
-14293 ?        S     0:00 /usr/sbin/winbindd -B
-14295 ?        S     0:00 /usr/sbin/winbindd -B
+14293 ?        S     0:00 /usr/sbin/winbindd -D
+14295 ?        S     0:00 /usr/sbin/winbindd -D
 </screen>
 			The <command>winbindd</command> daemon is running in split mode (normal), so there are also
 			two instances<footnote><para>For more information regarding winbindd, see <emphasis>TOSHARG2</emphasis>, 
diff --git a/docs-xml/Samba3-ByExample/SBE-TheSmallOffice.xml b/docs-xml/Samba3-ByExample/SBE-TheSmallOffice.xml
index ca39af3..b178749 100644
--- a/docs-xml/Samba3-ByExample/SBE-TheSmallOffice.xml
+++ b/docs-xml/Samba3-ByExample/SBE-TheSmallOffice.xml
@@ -767,8 +767,8 @@ Ignoring unknown parameter "dogbert"
 14290 ?        S      0:00 /usr/sbin/smbd -D
 
 $rootprompt; ps ax | grep winbind
-14293 ?        S     0:00 /usr/sbin/winbindd -B
-14295 ?        S     0:00 /usr/sbin/winbindd -B
+14293 ?        S     0:00 /usr/sbin/winbindd -D
+14295 ?        S     0:00 /usr/sbin/winbindd -D
 </screen>
 			The <command>winbindd</command> daemon is running in split mode (normal), so there are also
 			two instances of it. For more information regarding <command>winbindd</command>, see
diff --git a/docs-xml/Samba3-HOWTO/TOSHARG-Compiling.xml b/docs-xml/Samba3-HOWTO/TOSHARG-Compiling.xml
index 130da81..1f1f51c 100644
--- a/docs-xml/Samba3-HOWTO/TOSHARG-Compiling.xml
+++ b/docs-xml/Samba3-HOWTO/TOSHARG-Compiling.xml
@@ -492,9 +492,9 @@ netbios-ns dgram udp wait root /usr/local/samba/sbin/nmbd nmbd
 
 <para><programlisting>
 #!/bin/sh
-/usr/local/samba/sbin/smbd -D 
-/usr/local/samba/sbin/winbindd -B
-/usr/local/samba/sbin/nmbd -D 
+/usr/local/samba/sbin/smbd -D
+/usr/local/samba/sbin/winbindd -D
+/usr/local/samba/sbin/nmbd -D
 </programlisting></para>
 
 	<para>
diff --git a/docs-xml/Samba3-HOWTO/TOSHARG-Winbind.xml b/docs-xml/Samba3-HOWTO/TOSHARG-Winbind.xml
index 7731e4e..adb0ba2 100644
--- a/docs-xml/Samba3-HOWTO/TOSHARG-Winbind.xml
+++ b/docs-xml/Samba3-HOWTO/TOSHARG-Winbind.xml
@@ -1016,7 +1016,7 @@ start() {
 in the example above with:
 
 <programlisting>
-        daemon /usr/local/samba/sbin/winbindd -B
+        daemon /usr/local/samba/sbin/winbindd -D
 </programlisting>.
 </para>
 
@@ -1125,7 +1125,7 @@ Again, if you would like to run Samba in dual daemon mode, replace:
 </programlisting>
 in the script above with:
 <programlisting>
-/usr/local/samba/sbin/winbindd -B
+/usr/local/samba/sbin/winbindd -D
 </programlisting>
 </para>
 
diff --git a/docs-xml/manpages-3/vfs_fileid.8.xml b/docs-xml/manpages-3/vfs_fileid.8.xml
new file mode 100644
index 0000000..202d693
--- /dev/null
+++ b/docs-xml/manpages-3/vfs_fileid.8.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
+<refentry id="vfs_fileid.8">
+
+<refmeta>
+	<refentrytitle>vfs_fileid</refentrytitle>
+	<manvolnum>8</manvolnum>
+	<refmiscinfo class="source">Samba</refmiscinfo>
+	<refmiscinfo class="manual">System Administration tools</refmiscinfo>
+	<refmiscinfo class="version">3.2</refmiscinfo>
+</refmeta>
+
+
+<refnamediv>
+	<refname>vfs_fileid</refname>
+	<refpurpose>Generates file_id structs with unique device id values for
+	cluster setups</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+	<cmdsynopsis>
+		<command>vfs objects = fileid</command>
+	</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1>
+	<title>DESCRIPTION</title>
+
+	<para>This VFS module is part of the
+	<citerefentry><refentrytitle>samba</refentrytitle>
+	<manvolnum>7</manvolnum></citerefentry>
+	suite.</para>
+
+	<para>Samba uses file_id structs to uniquely identify files
+	for locking purpose. By default the file_id contains the device
+	and inode number returned by the <command>stat()</command> system call.
+	As the file_id is a unique identifier of a file, it must be the same
+	on all nodes in a cluster setup. This module overloads the
+	<command>SMB_VFS_FILE_ID_CREATE()</command> operation and
+	generates the device number based on the configured algorithm
+	(see the "fileid:algorithm" option).
+	</para>
+</refsect1>
+
+
+<refsect1>
+	<title>OPTIONS</title>
+
+	<variablelist>
+
+		<varlistentry>
+		<term>fileid:algorithm = ALGORITHM</term>
+		<listitem>
+		<para>Available algorithms are <command>fsname</command>
+		and <command>fsid</command>. The default value is
+		<command>fsname</command>.
+		</para>
+		<para>The <command>fsname</command> algorithm generates
+		device id by hashing the kernel device name.
+		</para>
+		<para>The <command>fsid</command> algorithm generates
+		the device id from the <command>f_fsid</command> returned
+		from the <command>statfs()</command> syscall.
+		</para>
+		</listitem>
+		</varlistentry>
+
+		<varlistentry>
+		<term>fileid:mapping = ALGORITHM</term>
+		<listitem>
+		<para>This option is the legacy version of the
+		<command>fileid:algorithm</command> option, which was used in earlier
+		versions of fileid mapping feature in custom Samba 3.0 versions.
+		</para>
+		</listitem>
+		</varlistentry>
+
+	</variablelist>
+</refsect1>
+
+<refsect1>
+	<title>EXAMPLES</title>
+
+	<para>Usage of the <command>fileid</command> module with the
+	<command>fsid</command> algorithm:</para>
+
+<programlisting>
+        <smbconfsection name="[global]"/>
+	<smbconfoption name="vfs objects">fileid</smbconfoption>
+	<smbconfoption name="fileid:algorithm">fsid</smbconfoption>
+</programlisting>
+
+</refsect1>
+
+<refsect1>
+	<title>VERSION</title>
+
+	<para>This man page is correct for version 3.2 of the Samba suite.
+	</para>
+</refsect1>
+
+<refsect1>
+	<title>AUTHOR</title>
+
+	<para>The original Samba software and related utilities
+	were created by Andrew Tridgell. Samba is now developed
+	by the Samba Team as an Open Source project similar
+	to the way the Linux kernel is developed.</para>
+
+</refsect1>
+
+</refentry>
diff --git a/source/include/libsmb_internal.h b/source/include/libsmb_internal.h
index 7cf0330..a00547f 100644
--- a/source/include/libsmb_internal.h
+++ b/source/include/libsmb_internal.h
@@ -176,6 +176,11 @@ struct SMBC_internal_data {
          */
         smbc_smb_encrypt_level                  smb_encryption_level;
 
+        /*
+         * Should we request case sensitivity of file names?
+         */
+        bool                                    case_sensitive;
+
         struct smbc_server_cache * server_cache;
 
         /* POSIX emulation functions */
@@ -397,16 +402,6 @@ SMBC_errno(SMBCCTX *context,
 
 /* Functions in libsmb_path.c */
 int
-SMBC_urldecode(char *dest,
-               char *src,
-               size_t max_dest_len);
-
-int
-SMBC_urlencode(char *dest,
-               char *src,
-               int max_dest_len);
-
-int
 SMBC_parse_path(TALLOC_CTX *ctx,
 		SMBCCTX *context,
                 const char *fname,
diff --git a/source/include/libsmbclient.h b/source/include/libsmbclient.h
index 74d0d5c..70f63de 100644
--- a/source/include/libsmbclient.h
+++ b/source/include/libsmbclient.h
@@ -551,6 +551,27 @@ void
 smbc_setOptionSmbEncryptionLevel(SMBCCTX *c, smbc_smb_encrypt_level level);
 
 /**
+ * Get whether to treat file names as case-sensitive if we can't determine
+ * when connecting to the remote share whether the file system is case
+ * sensitive. This defaults to FALSE since it's most likely that if we can't
+ * retrieve the file system attributes, it's a very old file system that does
+ * not support case sensitivity.
+ */
+smbc_bool
+smbc_getOptionCaseSensitive(SMBCCTX *c);
+
+/**
+ * Set whether to treat file names as case-sensitive if we can't determine
+ * when connecting to the remote share whether the file system is case
+ * sensitive. This defaults to FALSE since it's most likely that if we can't
+ * retrieve the file system attributes, it's a very old file system that does
+ * not support case sensitivity.
+ */
+void
+smbc_setOptionCaseSensitive(SMBCCTX *c, smbc_bool b);
+
+
+/**
  * Get from how many local master browsers should the list of workgroups be
  * retrieved.  It can take up to 12 minutes or longer after a server becomes a
  * local master browser, for it to have the entire browse list (the list of
diff --git a/source/include/smb.h b/source/include/smb.h
index e248164..dc346d8 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -764,7 +764,6 @@ struct pending_message_list {
 };
 
 #define SHARE_MODE_FLAG_POSIX_OPEN	0x1
-#define SHARE_MODE_ALLOW_INITIAL_DELETE_ON_CLOSE      0x2
 
 /* struct returned by get_share_modes */
 struct share_mode_entry {
diff --git a/source/lib/sendfile.c b/source/lib/sendfile.c
index 20b2371..11582af 100644
--- a/source/lib/sendfile.c
+++ b/source/lib/sendfile.c
@@ -65,7 +65,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
 #endif
 		} while (nwritten == -1 && errno == EINTR);
 		if (nwritten == -1) {
-			if (errno == ENOSYS) {
+			if (errno == ENOSYS || errno == EINVAL) {
 				/* Ok - we're in a world of pain here. We just sent
 				 * the header, but the sendfile failed. We have to
 				 * emulate the sendfile at an upper layer before we
@@ -143,7 +143,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
 			nwritten = sendfile(tofd, fromfd, &small_offset, small_total);
 		} while (nwritten == -1 && errno == EINTR);
 		if (nwritten == -1) {
-			if (errno == ENOSYS) {
+			if (errno == ENOSYS || errno == EINVAL) {
 				/* Ok - we're in a world of pain here. We just sent
 				 * the header, but the sendfile failed. We have to
 				 * emulate the sendfile at an upper layer before we
diff --git a/source/lib/util.c b/source/lib/util.c
index d42ff4f..017384d 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -1052,18 +1052,22 @@ bool reinit_after_fork(struct messaging_context *msg_ctx,
 		return false;
 	}
 
-	/*
-	 * For clustering, we need to re-init our ctdbd connection after the
-	 * fork
-	 */
-	status = messaging_reinit(msg_ctx);
-	if (!NT_STATUS_IS_OK(status)) {
-		DEBUG(0,("messaging_reinit() failed: %s\n",
-			 nt_errstr(status)));
-		return false;
+	if (msg_ctx) {
+		/*
+		 * For clustering, we need to re-init our ctdbd connection after the
+		 * fork
+		 */
+		status = messaging_reinit(msg_ctx);
+		if (!NT_STATUS_IS_OK(status)) {
+			DEBUG(0,("messaging_reinit() failed: %s\n",
+				 nt_errstr(status)));
+			return false;
+		}
 	}
 
-	event_context_reinit(ev_ctx);
+	if (ev_ctx) {
+		event_context_reinit(ev_ctx);
+	}
 
 	return true;
 }
diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c
index 9c37e0c..650bd13 100644
--- a/source/lib/util_sock.c
+++ b/source/lib/util_sock.c
@@ -2080,6 +2080,7 @@ const char *get_mydnsfullname(void)
 bool is_myname_or_ipaddr(const char *s)
 {
 	TALLOC_CTX *ctx = talloc_tos();
+	char addr[INET6_ADDRSTRLEN];
 	char *name = NULL;
 	const char *dnsname;
 	char *servername = NULL;
@@ -2131,11 +2132,11 @@ bool is_myname_or_ipaddr(const char *s)
 	if (!is_ipaddress(servername)) {
 		/* Use DNS to resolve the name, but only the first address */
 		struct sockaddr_storage ss;
-		if (interpret_string_addr(&ss, servername,0)) {
-			print_sockaddr(name,
-					sizeof(name),
+		if (interpret_string_addr(&ss, servername, 0)) {
+			print_sockaddr(addr,
+					sizeof(addr),
 					&ss);
-			servername = name;
+			servername = addr;
 		}
 	}
 
diff --git a/source/libsmb/libsmb_context.c b/source/libsmb/libsmb_context.c
index 5e075d1..0193e90 100644
--- a/source/libsmb/libsmb_context.c
+++ b/source/libsmb/libsmb_context.c
@@ -69,6 +69,7 @@ smbc_new_context(void)
         smbc_setOptionFullTimeNames(context, False);
         smbc_setOptionOpenShareMode(context, SMBC_SHAREMODE_DENY_NONE);
         smbc_setOptionSmbEncryptionLevel(context, SMBC_ENCRYPTLEVEL_NONE);
+        smbc_setOptionCaseSensitive(context, False);
         smbc_setOptionBrowseMaxLmbCount(context, 3);    /* # LMBs to query */
         smbc_setOptionUrlEncodeReaddirEntries(context, False);
         smbc_setOptionOneSharePerServer(context, False);
diff --git a/source/libsmb/libsmb_dir.c b/source/libsmb/libsmb_dir.c
index 5fe2731..b0762e8 100644
--- a/source/libsmb/libsmb_dir.c
+++ b/source/libsmb/libsmb_dir.c
@@ -894,7 +894,7 @@ smbc_readdir_internal(SMBCCTX * context,
 
                 /* url-encode the name.  get back remaining buffer space */
                 max_namebuf_len =
-                        SMBC_urlencode(dest->name, src->name, max_namebuf_len);
+                        smbc_urlencode(dest->name, src->name, max_namebuf_len);
 
                 /* We now know the name length */
                 dest->namelen = strlen(dest->name);
diff --git a/source/libsmb/libsmb_path.c b/source/libsmb/libsmb_path.c
index 2c3a5f8..6d69924 100644
--- a/source/libsmb/libsmb_path.c
+++ b/source/libsmb/libsmb_path.c
@@ -41,7 +41,7 @@ hex2int( unsigned int _char )
 }
 
 /*
- * SMBC_urldecode()
+ * smbc_urldecode()
  * and urldecode_talloc() (internal fn.)
  *
  * Convert strings of %xx to their single character equivalent.  Each 'x' must
@@ -122,7 +122,7 @@ urldecode_talloc(TALLOC_CTX *ctx, char **pp_dest, const char *src)
 }
 
 int
-SMBC_urldecode(char *dest,
+smbc_urldecode(char *dest,
                char *src,
                size_t max_dest_len)
 {
@@ -138,7 +138,7 @@ SMBC_urldecode(char *dest,
 }
 
 /*
- * SMBC_urlencode()
+ * smbc_urlencode()
  *
  * Convert any characters not specifically allowed in a URL into their %xx
  * equivalent.
@@ -146,7 +146,7 @@ SMBC_urldecode(char *dest,
  * Returns the remaining buffer length.
  */
 int
-SMBC_urlencode(char *dest,
+smbc_urlencode(char *dest,
                char *src,
                int max_dest_len)
 {
@@ -286,7 +286,7 @@ SMBC_parse_path(TALLOC_CTX *ctx,
                 DEBUG(4, ("Found options '%s'", q));
                 
 		/* Copy the options */
-		if (*pp_options != NULL) {
+		if (pp_options && *pp_options != NULL) {
 			TALLOC_FREE(*pp_options);
 			*pp_options = talloc_strdup(ctx, q);
 		}
diff --git a/source/libsmb/libsmb_server.c b/source/libsmb/libsmb_server.c
index 4581d84..91a77fe 100644
--- a/source/libsmb/libsmb_server.c
+++ b/source/libsmb/libsmb_server.c
@@ -245,6 +245,8 @@ SMBC_server(TALLOC_CTX *ctx,
 	int tried_reverse = 0;
         int port_try_first;
         int port_try_next;
+        int is_ipc = (share != NULL && strcmp(share, "IPC$") == 0);
+	uint32 fs_attrs = 0;
         const char *username_used;
  	NTSTATUS status;
         
@@ -310,6 +312,38 @@ SMBC_server(TALLOC_CTX *ctx,
                                 srv = NULL;
                         }
                         
+                        /* Determine if this share supports case sensitivity */
+                        if (is_ipc) {
+                                DEBUG(4,
+                                      ("IPC$ so ignore case sensitivity\n"));
+                        } else if (!cli_get_fs_attr_info(c, &fs_attrs)) {
+                                DEBUG(4, ("Could not retrieve "
+                                          "case sensitivity flag: %s.\n",
+                                          cli_errstr(c)));
+
+                                /*
+                                 * We can't determine the case sensitivity of
+                                 * the share. We have no choice but to use the
+                                 * user-specified case sensitivity setting.
+                                 */
+                                if (smbc_getOptionCaseSensitive(context)) {
+                                        cli_set_case_sensitive(c, True);
+                                } else {
+                                        cli_set_case_sensitive(c, False);
+                                }
+                        } else {
+                                DEBUG(4,
+                                      ("Case sensitive: %s\n",
+                                       (fs_attrs & FILE_CASE_SENSITIVE_SEARCH
+                                        ? "True"
+                                        : "False")));
+                                cli_set_case_sensitive(
+                                        c,
+                                        (fs_attrs & FILE_CASE_SENSITIVE_SEARCH
+                                         ? True
+                                         : False));
+                        }
+
                         /*
                          * Regenerate the dev value since it's based on both
                          * server and share
@@ -355,7 +389,7 @@ again:
 		errno = ENOMEM;
 		return NULL;
 	}
-        
+
         if (smbc_getOptionUseKerberos(context)) {
 		c->use_kerberos = True;
 	}
@@ -370,7 +404,7 @@ again:


-- 
SAMBA-CTDB repository


More information about the samba-cvs mailing list