Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-trivial
authorJelmer Vernooij <jelmer@samba.org>
Wed, 27 Feb 2008 15:03:00 +0000 (16:03 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 27 Feb 2008 15:03:00 +0000 (16:03 +0100)
1  2 
source/ntvfs/posix/pvfs_rename.c
source/smbd/server.c

index 65755e05cb7eaf37dd84f06b9e6236af0bca6585,5693e793141c7e51854092e5085eb34037bb66ab..17c073ccabdeebfd4b9027ca11851dbf22dd603f
@@@ -134,12 -134,12 +134,12 @@@ static const char *pvfs_resolve_wildcar
    resolve a wildcard rename pattern.
  */
  static const char *pvfs_resolve_wildcard(TALLOC_CTX *mem_ctx, 
 +                                       struct smb_iconv_convenience *iconv_convenience,
                                         const char *fname, 
                                         const char *pattern)
  {
        const char *base1, *base2;
        const char *ext1, *ext2;
 -      struct smb_iconv_convenience *iconv_convenience = lp_iconv_convenience(global_loadparm);
        char *p;
  
        /* break into base part plus extension */
@@@ -192,11 -192,11 +192,11 @@@ static NTSTATUS pvfs_rename_one(struct 
  {
        struct pvfs_filename *name1, *name2;
        TALLOC_CTX *mem_ctx = talloc_new(req);
+       struct odb_lock *lck = NULL;
        NTSTATUS status;
-       struct odb_lock *lck, *lck2;
  
        /* resolve the wildcard pattern for this name */
 -      fname2 = pvfs_resolve_wildcard(mem_ctx, fname1, fname2);
 +      fname2 = pvfs_resolve_wildcard(mem_ctx, lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx), fname1, fname2);
        if (fname2 == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
  
        status = pvfs_can_rename(pvfs, req, name1, &lck);
        if (!NT_STATUS_IS_OK(status)) {
+               talloc_free(lck);
                goto failed;
        }
  
        status = pvfs_resolve_partial(pvfs, mem_ctx, 
                                      dir_path, fname2, &name2);
        if (NT_STATUS_IS_OK(status)) {
-               status = pvfs_can_delete(pvfs, req, name2, &lck2);
+               status = pvfs_can_delete(pvfs, req, name2, NULL);
                if (!NT_STATUS_IS_OK(status)) {
                        goto failed;
                }
@@@ -311,7 -312,7 +312,7 @@@ static NTSTATUS pvfs_rename_mv(struct n
        struct pvfs_state *pvfs = ntvfs->private_data;
        NTSTATUS status;
        struct pvfs_filename *name1, *name2;
-       struct odb_lock *lck;
+       struct odb_lock *lck = NULL;
  
        /* resolve the cifs name to a posix name */
        status = pvfs_resolve_name(pvfs, req, ren->rename.in.pattern1, 
  
        status = pvfs_can_rename(pvfs, req, name1, &lck);
        if (!NT_STATUS_IS_OK(status)) {
+               talloc_free(lck);
                return status;
        }
  
@@@ -375,7 -377,6 +377,6 @@@ static NTSTATUS pvfs_rename_nt(struct n
        struct pvfs_state *pvfs = ntvfs->private_data;
        NTSTATUS status;
        struct pvfs_filename *name1, *name2;
-       struct odb_lock *lck;
  
        switch (ren->ntrename.in.flags) {
        case RENAME_FLAG_RENAME:
                return status;
        }
  
-       status = pvfs_can_rename(pvfs, req, name1, &lck);
+       status = pvfs_can_rename(pvfs, req, name1, NULL);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
diff --combined source/smbd/server.c
index 8ad3e030ff0a6a288d556590cd2e7df35511ba77,fdeb5415761fd523f9260d62eaf37cea5eedd20a..fe38a4e5aba9d4ca52d6046a707473a165581c4a
@@@ -253,7 -253,7 +253,7 @@@ static int binary_smbd_main(const char 
        umask(0);
  
        DEBUG(0,("%s version %s started.\n", binary_name, SAMBA_VERSION_STRING));
-       DEBUGADD(0,("Copyright Andrew Tridgell and the Samba Team 1992-2007\n"));
+       DEBUGADD(0,("Copyright Andrew Tridgell and the Samba Team 1992-2008\n"));
  
        if (sizeof(uint16_t) < 2 || sizeof(uint32_t) < 4 || sizeof(uint64_t) < 8) {
                DEBUG(0,("ERROR: Samba is not configured correctly for the word size on your machine\n"));
                exit(1);
        }
  
 -      share_init();
 -
        gensec_init(cmdline_lp_ctx); /* FIXME: */
  
        ntptr_init(cmdline_lp_ctx);     /* FIXME: maybe run this in the initialization function