The branch, master has been updated
       via  8d54bdb vfs_netatalk should be using strstr_m, not strstr to find 
.AppleDouble paths.
       via  f5ae41d The last argument to atalk_build_paths() is always false, 
remove it.
      from  47aa9ed lib/util: skip single hex digit at the end of the input 
sting - fix potential segfault

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 8d54bdb5e199b2198990ee8d572662a128506337
Author: Jeremy Allison <j...@samba.org>
Date:   Tue Oct 18 11:54:53 2011 -0700

    vfs_netatalk should be using strstr_m, not strstr to find .AppleDouble 
paths.
    
    Autobuild-User: Jeremy Allison <j...@samba.org>
    Autobuild-Date: Wed Oct 19 00:05:45 CEST 2011 on sn-devel-104

commit f5ae41d8235fe54ca04542877059aaa2e287b0c2
Author: Jeremy Allison <j...@samba.org>
Date:   Tue Oct 18 11:24:35 2011 -0700

    The last argument to atalk_build_paths() is always false, remove it.

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

Summary of changes:
 source3/modules/vfs_netatalk.c |   31 ++++++++++++++-----------------
 1 files changed, 14 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_netatalk.c b/source3/modules/vfs_netatalk.c
index 8d2c9b7..3e5606b 100644
--- a/source3/modules/vfs_netatalk.c
+++ b/source3/modules/vfs_netatalk.c
@@ -34,8 +34,7 @@ static int atalk_build_paths(TALLOC_CTX *ctx, const char 
*path,
                             const char *fname,
                             char **adbl_path, char **orig_path,
                             SMB_STRUCT_STAT *adbl_info,
-                            SMB_STRUCT_STAT *orig_info,
-                            bool fake_dir_create_times);
+                            SMB_STRUCT_STAT *orig_info);
 
 static int atalk_unlink_file(const char *path);
 
@@ -61,8 +60,7 @@ static int atalk_build_paths(TALLOC_CTX *ctx, const char 
*path,
                             const char *fname,
                             char **adbl_path, char **orig_path,
                             SMB_STRUCT_STAT *adbl_info,
-                            SMB_STRUCT_STAT *orig_info,
-                            bool fake_dir_create_times)
+                            SMB_STRUCT_STAT *orig_info)
 {
        int ptr0 = 0;
        int ptr1 = 0;
@@ -75,7 +73,7 @@ static int atalk_build_paths(TALLOC_CTX *ctx, const char 
*path,
 #if 0
        DEBUG(3, ("ATALK: PATH: %s[%s]\n", path, fname));
 #endif
-       if (strstr(path, APPLEDOUBLE) || strstr(fname, APPLEDOUBLE)) {
+       if (strstr_m(path, APPLEDOUBLE) || strstr_m(fname, APPLEDOUBLE)) {
                DEBUG(3, ("ATALK: path %s[%s] already contains %s\n", path, 
fname, APPLEDOUBLE));
                return -1;
        }
@@ -88,7 +86,7 @@ static int atalk_build_paths(TALLOC_CTX *ctx, const char 
*path,
        /* get pointer to last '/' */
        ptr1 = atalk_get_path_ptr(*orig_path);
 
-       sys_lstat(*orig_path, orig_info, fake_dir_create_times);
+       sys_lstat(*orig_path, orig_info, false);
 
        if (S_ISDIR(orig_info->st_ex_mode)) {
                *adbl_path = talloc_asprintf(ctx, "%s/%s/%s/", 
@@ -103,7 +101,7 @@ static int atalk_build_paths(TALLOC_CTX *ctx, const char 
*path,
 #if 0
        DEBUG(3, ("ATALK: DEBUG:\n%s\n%s\n", *orig_path, *adbl_path)); 
 #endif
-       sys_lstat(*adbl_path, adbl_info, fake_dir_create_times);
+       sys_lstat(*adbl_path, adbl_info, false);
        return 0;
 }
 
@@ -128,7 +126,7 @@ static void atalk_add_to_list(name_compare_entry **list)
 
        if (cur_list) {
                for (i = 0, count = 0; cur_list[i].name; i ++, count ++) {
-                       if (strstr(cur_list[i].name, APPLEDOUBLE))
+                       if (strstr_m(cur_list[i].name, APPLEDOUBLE))
                                return;
                }
        }
@@ -237,7 +235,7 @@ static int atalk_rmdir(struct vfs_handle_struct *handle, 
const char *path)
         * from this module, gotta use talloc stuff..
         */
 
-       strstr(path, APPLEDOUBLE) ? (add = False) : (add = True);
+       strstr_m(path, APPLEDOUBLE) ? (add = False) : (add = True);
 
        if (!(ctx = talloc_init("remove_directory")))
                goto exit_rmdir;
@@ -276,7 +274,7 @@ static int atalk_rename(struct vfs_handle_struct *handle,
 
        if (atalk_build_paths(talloc_tos(), handle->conn->origpath, oldname,
                              &adbl_path, &orig_path, &adbl_info,
-                             &orig_info, false) != 0)
+                             &orig_info) != 0)
                goto exit_rename;
 
        if (S_ISDIR(orig_info.st_ex_mode) || S_ISREG(orig_info.st_ex_mode)) {
@@ -319,13 +317,13 @@ static int atalk_unlink(struct vfs_handle_struct *handle,
        if (!handle->conn->hide_list) return ret;
 
        for (i = 0; handle->conn->veto_list[i].name; i ++) {
-               if (strstr(handle->conn->veto_list[i].name, APPLEDOUBLE))
+               if (strstr_m(handle->conn->veto_list[i].name, APPLEDOUBLE))
                        break;
        }
 
        if (!handle->conn->veto_list[i].name) {
                for (i = 0; handle->conn->hide_list[i].name; i ++) {
-                       if (strstr(handle->conn->hide_list[i].name, 
APPLEDOUBLE))
+                       if (strstr_m(handle->conn->hide_list[i].name, 
APPLEDOUBLE))
                                break;
                        else {
                                DEBUG(3, ("ATALK: %s is not hidden, 
skipped..\n",
@@ -337,7 +335,7 @@ static int atalk_unlink(struct vfs_handle_struct *handle,
 
        if (atalk_build_paths(talloc_tos(), handle->conn->origpath, path,
                              &adbl_path, &orig_path,
-                             &adbl_info, &orig_info, false) != 0)
+                             &adbl_info, &orig_info) != 0)
                goto exit_unlink;
 
        if (S_ISDIR(orig_info.st_ex_mode) || S_ISREG(orig_info.st_ex_mode)) {
@@ -371,8 +369,7 @@ static int atalk_chmod(struct vfs_handle_struct *handle, 
const char *path, mode_
                return ret;
 
        if (atalk_build_paths(ctx, handle->conn->origpath, path, &adbl_path,
-                             &orig_path, &adbl_info, &orig_info,
-                             false) != 0)
+                             &orig_path, &adbl_info, &orig_info) != 0)
                goto exit_chmod;
 
        if (!S_ISDIR(orig_info.st_ex_mode) && !S_ISREG(orig_info.st_ex_mode)) {
@@ -405,7 +402,7 @@ static int atalk_chown(struct vfs_handle_struct *handle, 
const char *path, uid_t
 
        if (atalk_build_paths(ctx, handle->conn->origpath, path,
                              &adbl_path, &orig_path,
-                             &adbl_info, &orig_info, false) != 0)
+                             &adbl_info, &orig_info) != 0)
                goto exit_chown;
 
        if (!S_ISDIR(orig_info.st_ex_mode) && !S_ISREG(orig_info.st_ex_mode)) {
@@ -440,7 +437,7 @@ static int atalk_lchown(struct vfs_handle_struct *handle, 
const char *path, uid_
 
        if (atalk_build_paths(ctx, handle->conn->origpath, path,
                              &adbl_path, &orig_path,
-                             &adbl_info, &orig_info, false) != 0)
+                             &adbl_info, &orig_info) != 0)
                goto exit_lchown;
 
        if (!S_ISDIR(orig_info.st_ex_mode) && !S_ISREG(orig_info.st_ex_mode)) {


-- 
Samba Shared Repository

Reply via email to