[PATCH] Add a "deltree" command to smbclient.

Andreas Schneider asn at samba.org
Fri Jul 7 07:14:37 UTC 2017


On Thursday, 6 July 2017 21:05:46 CEST Alexander Bokovoy wrote:
> +       dt = talloc_zero(NULL, struct file_list);
> +       if (dt == NULL) {
> +               return NT_STATUS_NO_MEMORY;
> +       }
> +
> +       /* create absolute filename for cli_ntcreate() */
> +       dt->file_path = talloc_asprintf(dt,
> +                               "%s%s%s",
> +                               dir,
> +                               CLI_DIRSEP_STR,
> +                               finfo->name);
> +       if (dt->file_path == NULL) {

TALLOC_FREE(dt);

missing, I've added it and pushed the patchset upstream

> +               return NT_STATUS_NO_MEMORY;
> +       }


> +# Test smbclient deltree command
> +test_deltree()
> +{
> +    tmpfile=$PREFIX/smbclient_interactive_prompt_commands
> +    deltree_dir=$PREFIX/deltree_dir
> +
> +    rm -f $deltree_dir

And as this is a directory I think we want 'rm -rf'

> +    cat > $tmpfile <<EOF
> +mkdir deltree_dir
> +mkdir deltree_dir/foo
> +mkdir deltree_dir/foo/bar
> +put ${SMBCLIENT} deltree_dir/foo/bar/client
> +deltree deltree_dir
> +quit
> +EOF



	Andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list