samba-cvs.cvs
[Top] [All Lists]

[SCM] Samba Shared Repository - branch v3-3-stable updated - release-3-3

Subject: [SCM] Samba Shared Repository - branch v3-3-stable updated - release-3-3-0rc2-121-g777f16a
From: Karolin Seeger
Date: Mon, 12 Jan 2009 02:56:24 -0600 CST
The branch, v3-3-stable has been updated
       via  777f16abf15afdce4bb9017306276c5b745f116c (commit)
       via  9e030b967f340767a85553b39bf0f6f57dfb3013 (commit)
       via  da752d5d212a5b2d3b84ce88e2141a0ecfb3f5a7 (commit)
       via  deff29ad0d320108aa6992ebe96d770cd893c868 (commit)
       via  325e0a2237a12e801cb5a360070f628ef40ec157 (commit)
       via  1a95b9b8ddf698553da1d767d8800c111db20ae8 (commit)
       via  c0d6fd9204da08b01fe08053ee16fed013640ccf (commit)
       via  4ac5552f257f59c2853c6dcc1d96758db89fbd4e (commit)
      from  4f8c8a84a39b2fe06e7cdac6bb7dc14d836444a6 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-stable


- Log -----------------------------------------------------------------
commit 777f16abf15afdce4bb9017306276c5b745f116c
Author: Bo Yang <boyang@xxxxxxxxxx>
Date:   Sat Jan 10 14:09:48 2009 -0800

    Don't set child->requests to NULL in parent after fork
    (cherry picked from commit e4505156522560fb0c7ee3aadd75d4fc9d446609)

commit 9e030b967f340767a85553b39bf0f6f57dfb3013
Author: Karolin Seeger <kseeger@xxxxxxxxx>
Date:   Fri Jan 9 19:39:46 2009 -0800

    s3/smbpasswd: Check if Unix account exists before asking for the password.
    
    Admins shouldn't have to type in the password twice when the passdb account
    cannot be created because the Unix account is missing.
    
    Karolin
    (cherry picked from commit af0ceb784af1ea8d591f5c35fb010d60b178a8d2)

commit da752d5d212a5b2d3b84ce88e2141a0ecfb3f5a7
Author: Karolin Seeger <kseeger@xxxxxxxxx>
Date:   Fri Jan 9 11:22:00 2009 +0100

    docs: Improve man mount.cifs.
    
    Add hint about specifying the workgroup in the credentials file.
    Whitespace cleanup.
    
    This fixes bug #4541.
    Patch based on proposed patch from Christian Perrier <bubulle@xxxxxxxxxx>.
    Thanks for reporting and providing a patch!
    
    Karolin
    (cherry picked from commit 1f7e09ea542df3a2f5f553c0cb11a39c74712950)
    (cherry picked from commit b99d98ff2ef5491979301656e7f516d3c8829f6e)

commit deff29ad0d320108aa6992ebe96d770cd893c868
Author: Tim Prouty <tprouty@xxxxxxxxx>
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.
    (cherry picked from commit 98eb11ef99418e690ae43116432c0566a28da8a0)

commit 325e0a2237a12e801cb5a360070f628ef40ec157
Author: Tim Prouty <tprouty@xxxxxxxxx>
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.
    (cherry picked from commit b377bce1371553e4a9545092cfc8527925b57b67)

commit 1a95b9b8ddf698553da1d767d8800c111db20ae8
Author: Tim Prouty <tprouty@xxxxxxxxx>
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
    (cherry picked from commit fb888dd4f10b00edb258e965ea06e29fa76827d6)

commit c0d6fd9204da08b01fe08053ee16fed013640ccf
Author: Jeremy Allison <jra@xxxxxxxxx>
Date:   Thu Jan 8 15:42:38 2009 -0800

    Fix bug #6021 - smbclient du command does not recuse properly
    Jeremy.
    (cherry picked from commit 935173a514bf54ebdf6269e872adfb86a9625f27)

commit 4ac5552f257f59c2853c6dcc1d96758db89fbd4e
Author: Jeremy Allison <jra@xxxxxxxxx>
Date:   Thu Jan 8 10:34:23 2009 -0800

    Fix race condition in alarm lock processing noticed by Richard Sharpe 
<realrichardsharpe@xxxxxxxxx>.
    "It seems to me that if the lock is already held by another process when we
    enter this code, there is a race between the timeout and the granting. If
    the lock is subsequently granted, the process releasing the lock will signal
    the wait variable (or whatever) and our process will be scheduled. However,
    if the timeout occurs before we are scheduled, the timeout will be delivered
    first.
    
    We will have the lock but will forget we have the lock, and never release
    it."
    Jeremy.
    (cherry picked from commit 92c251ace583391ea1540f0ae455399f8a75cecf)

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

Summary of changes:
 docs-xml/manpages-3/mount.cifs.8.xml |    8 +++++---
 source/client/client.c               |    8 ++++----
 source/lib/util_tdb.c                |    2 +-
 source/libsmb/clidfs.c               |    3 ++-
 source/modules/vfs_streams_depot.c   |   30 ++++++++++++++++++------------
 source/modules/vfs_streams_xattr.c   |   11 -----------
 source/smbd/nttrans.c                |   14 +++++++-------
 source/smbd/reply.c                  |   25 +++++++++++++++----------
 source/utils/smbpasswd.c             |    9 +++++++++
 source/winbindd/winbindd_dual.c      |    1 -
 10 files changed, 61 insertions(+), 50 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/mount.cifs.8.xml 
b/docs-xml/manpages-3/mount.cifs.8.xml
index ff9ab66..9382365 100644
--- a/docs-xml/manpages-3/mount.cifs.8.xml
+++ b/docs-xml/manpages-3/mount.cifs.8.xml
@@ -89,7 +89,7 @@ to be specified as part of the username.
 
                <listitem><para>specifies the CIFS password. If this
 option is not given then the environment variable
-<emphasis>PASSWD</emphasis> is used. If the password is not specified 
+<emphasis>PASSWD</emphasis> is used. If the password is not specified
 directly or indirectly via an argument to mount, 
<emphasis>mount.cifs</emphasis> will prompt
 for a password, unless the guest option is specified.
 </para>
@@ -106,14 +106,16 @@ below) or entered at the password prompt will be read 
correctly.
 
                <listitem><para>
                                specifies a file that contains a username
-                               and/or password. The format of the file is:
+                               and/or password and optionally the name of the
+                               workgroup. The format of the file is:
                        </para>
 
 <programlisting>
                username=<replaceable>value</replaceable>
                password=<replaceable>value</replaceable>
+               workgroup=<replaceable>value</replaceable>
 </programlisting>
-               
+
                <para>
 This is preferred over having passwords in plaintext in a
 shared file, such as <filename>/etc/fstab</filename>. Be sure to protect any
diff --git a/source/client/client.c b/source/client/client.c
index 4d7085e..df92bae 100644
--- a/source/client/client.c
+++ b/source/client/client.c
@@ -728,11 +728,11 @@ static void do_list_helper(const char *mntpoint, 
file_info *f, const char *mask,
                                return;
                        }
                        p = strrchr_m(mask2,CLI_DIRSEP_CHAR);
-                       if (!p) {
-                               TALLOC_FREE(dir);
-                               return;
+                       if (p) {
+                               p[1] = 0;
+                       } else {
+                               mask2[0] = '\0';
                        }
-                       p[1] = 0;
                        mask2 = talloc_asprintf_append(mask2,
                                        "%s%s*",
                                        f->name,
diff --git a/source/lib/util_tdb.c b/source/lib/util_tdb.c
index 8257232..6d61fd9 100644
--- a/source/lib/util_tdb.c
+++ b/source/lib/util_tdb.c
@@ -86,7 +86,7 @@ static int tdb_chainlock_with_timeout_internal( TDB_CONTEXT 
*tdb, TDB_DATA key,
                alarm(0);
                tdb_setalarm_sigptr(tdb, NULL);
                CatchSignal(SIGALRM, SIGNAL_CAST SIG_IGN);
-               if (gotalarm) {
+               if (gotalarm && (ret == -1)) {
                        DEBUG(0,("tdb_chainlock_with_timeout_internal: alarm 
(%u) timed out for key %s in tdb %s\n",
                                timeout, key.dptr, tdb_name(tdb)));
                        /* TODO: If we time out waiting for a lock, it might
diff --git a/source/libsmb/clidfs.c b/source/libsmb/clidfs.c
index 35922b1..9fdc239 100644
--- a/source/libsmb/clidfs.c
+++ b/source/libsmb/clidfs.c
@@ -306,10 +306,11 @@ static void cli_cm_set_mntpoint(struct cli_state *c, 
const char *mnt)
        }
 
        if (p) {
-               char *name = clean_name(NULL, p->mount);
+               char *name = clean_name(NULL, mnt);
                if (!name) {
                        return;
                }
+               TALLOC_FREE(p->mount);
                p->mount = talloc_strdup(p, name);
                TALLOC_FREE(name);
        }
diff --git a/source/modules/vfs_streams_depot.c 
b/source/modules/vfs_streams_depot.c
index d543ea3..8ff617c 100644
--- a/source/modules/vfs_streams_depot.c
+++ b/source/modules/vfs_streams_depot.c
@@ -525,6 +525,7 @@ static int streams_depot_rename(vfs_handle_struct *handle,
        char *nsname = NULL;
        char *ostream_fname = NULL;
        char *nstream_fname = NULL;
+       char *newname_full = NULL;
 
        DEBUG(10, ("streams_depot_rename called for %s => %s\n",
                   oldname, newname));
@@ -536,11 +537,6 @@ static int streams_depot_rename(vfs_handle_struct *handle,
                return SMB_VFS_NEXT_RENAME(handle, oldname, newname);
        }
 
-       if (!(old_is_stream && new_is_stream)) {
-               errno = ENOSYS;
-               return -1;
-       }
-
        frame = talloc_stackframe();
 
        if (!NT_STATUS_IS_OK(split_ntfs_stream_name(talloc_tos(), oldname,
@@ -549,7 +545,7 @@ static int streams_depot_rename(vfs_handle_struct *handle,
                goto done;
        }
 
-       if (!NT_STATUS_IS_OK(split_ntfs_stream_name(talloc_tos(), oldname,
+       if (!NT_STATUS_IS_OK(split_ntfs_stream_name(talloc_tos(), newname,
                                                    &nbase, &nsname))) {
                errno = ENOMEM;
                goto done;
@@ -561,17 +557,27 @@ static int streams_depot_rename(vfs_handle_struct *handle,
                goto done;
        }
 
-       if (StrCaseCmp(obase, nbase) != 0) {
-               errno = ENOSYS;
-               goto done;
-       }
-
        ostream_fname = stream_name(handle, oldname, false);
        if (ostream_fname == NULL) {
                return -1;
        }
 
-       nstream_fname = stream_name(handle, newname, false);
+       /*
+        * Handle passing in a stream name without the base file.  This is
+        * exercised by the NTRENAME streams rename path.
+        */
+       if (StrCaseCmp(nbase, "./") == 0) {
+               newname_full = talloc_asprintf(talloc_tos(), "%s:%s", obase,
+                                              nsname);
+               if (newname_full == NULL) {
+                       errno = ENOMEM;
+                       goto done;
+               }
+       }
+
+       nstream_fname = stream_name(handle,
+                                   newname_full ? newname_full : newname,
+                                   false);
        if (nstream_fname == NULL) {
                return -1;
        }
diff --git a/source/modules/vfs_streams_xattr.c 
b/source/modules/vfs_streams_xattr.c
index ecfc319..7124c57 100644
--- a/source/modules/vfs_streams_xattr.c
+++ b/source/modules/vfs_streams_xattr.c
@@ -511,11 +511,6 @@ static int streams_xattr_rename(vfs_handle_struct *handle,
                return SMB_VFS_NEXT_RENAME(handle, oldname, newname);
        }
 
-       if (!(o_is_stream && n_is_stream)) {
-               errno = ENOSYS;
-               goto fail;
-       }
-
        frame = talloc_stackframe();
        if (!frame) {
                goto fail;
@@ -544,12 +539,6 @@ static int streams_xattr_rename(vfs_handle_struct *handle,
                goto fail;
        }
 
-       /* the new base should be empty */
-       if (StrCaseCmp(obase, nbase) != 0) {
-               errno = ENOSYS;
-               goto fail;
-       }
-
        if (StrCaseCmp(ostream, nstream) == 0) {
                goto done;
        }
diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c
index 91d896c..a3f5114 100644
--- a/source/smbd/nttrans.c
+++ b/source/smbd/nttrans.c
@@ -1263,13 +1263,6 @@ void reply_ntrename(struct smb_request *req)
                return;
        }
 
-       if( is_ntfs_stream_name(oldname)) {
-               /* Can't rename a stream. */
-               reply_nterror(req, NT_STATUS_ACCESS_DENIED);
-               END_PROFILE(SMBntrename);
-               return;
-       }
-
        if (ms_has_wild(oldname)) {
                reply_nterror(req, NT_STATUS_OBJECT_PATH_SYNTAX_BAD);
                END_PROFILE(SMBntrename);
@@ -1318,6 +1311,13 @@ void reply_ntrename(struct smb_request *req)
                return;
        }
 
+       /* The new name must begin with a ':' if the old name is a stream. */
+       if (is_ntfs_stream_name(oldname) && (newname[0] != ':')) {
+               reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+               END_PROFILE(SMBntrename);
+               return;
+       }
+
        DEBUG(3,("reply_ntrename : %s -> %s\n",oldname,newname));
 
        switch(rename_type) {
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index f78fb33..a613459 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -5506,7 +5506,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
        SMB_STRUCT_STAT sbuf, sbuf1;
        NTSTATUS status = NT_STATUS_OK;
        struct share_mode_lock *lck = NULL;
-       bool dst_exists;
+       bool dst_exists, old_is_stream, new_is_stream;
 
        ZERO_STRUCT(sbuf);
 
@@ -5575,6 +5575,18 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
                return NT_STATUS_OK;
        }
 
+       old_is_stream = is_ntfs_stream_name(fsp->fsp_name);
+       new_is_stream = is_ntfs_stream_name(newname);
+
+       /* Return the correct error code if both names aren't streams. */
+       if (!old_is_stream && new_is_stream) {
+               return NT_STATUS_OBJECT_NAME_INVALID;
+       }
+
+       if (old_is_stream && !new_is_stream) {
+               return NT_STATUS_INVALID_PARAMETER;
+       }
+
        /*
         * Have vfs_object_exist also fill sbuf1
         */
@@ -5586,18 +5598,11 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
                return NT_STATUS_OBJECT_NAME_COLLISION;
        }
 
-       if(replace_if_exists && dst_exists) {
-               /* Ensure both or neither are stream names. */
-               if (is_ntfs_stream_name(fsp->fsp_name) !=
-                               is_ntfs_stream_name(newname)) {
-                       return NT_STATUS_INVALID_PARAMETER;
-               }
-       }
-
        if (dst_exists) {
                struct file_id fileid = vfs_file_id_from_sbuf(conn, &sbuf1);
                files_struct *dst_fsp = file_find_di_first(fileid);
-               if (dst_fsp) {
+               /* The file can be open when renaming a stream */
+               if (dst_fsp && !new_is_stream) {
                        DEBUG(3, ("rename_internals_fsp: Target file open\n"));
                        return NT_STATUS_ACCESS_DENIED;
                }
diff --git a/source/utils/smbpasswd.c b/source/utils/smbpasswd.c
index b18ab55..78c1ce8 100644
--- a/source/utils/smbpasswd.c
+++ b/source/utils/smbpasswd.c
@@ -430,6 +430,15 @@ static int process_root(int local_flags)
                }
                
                if((local_flags & LOCAL_SET_PASSWORD) && (new_passwd == NULL)) {
+                       struct passwd *passwd = getpwnam_alloc(NULL, user_name);
+
+                       if (!passwd) {
+                               fprintf(stderr, "Cannot locate Unix account for 
"
+                                       "'%s'!\n", user_name);
+                               exit(1);
+                       }
+                       TALLOC_FREE(passwd);
+
                        new_passwd = prompt_for_new_password(stdin_passwd_get);
                        
                        if(!new_passwd) {
diff --git a/source/winbindd/winbindd_dual.c b/source/winbindd/winbindd_dual.c
index e066944..a20b628 100644
--- a/source/winbindd/winbindd_dual.c
+++ b/source/winbindd/winbindd_dual.c
@@ -1243,7 +1243,6 @@ static bool fork_domain_child(struct winbindd_child 
*child)
                DLIST_ADD(children, child);
                child->event.fd = fdpair[1];
                child->event.flags = 0;
-               child->requests = NULL;
                add_fd_event(&child->event);
                return True;
        }


-- 
Samba Shared Repository

<Prev in Thread] Current Thread [Next in Thread>
  • [SCM] Samba Shared Repository - branch v3-3-stable updated - release-3-3-0rc2-121-g777f16a, Karolin Seeger <=