PATCH: verbose mode for smbclient tar

Jim Brown jim.brown at rsmas.miami.edu
Wed Jan 3 22:17:35 UTC 2018


isdir is uninitialized for all non-directory items.
isdir should be initialized and then used the if statement.

     isdir = finfo->mode & FILE_ATTRIBUTE_DIRECTORY;
     if (isdir) {
         old_dir = talloc_strdup(ctx, initial_dir);

On 1/3/18 17:02, Björn JACKE via samba-technical wrote:
> +	bool isdir;
>   	int rc;
>   	TALLOC_CTX *ctx = talloc_new(NULL);
>   	if (ctx == NULL) {
> @@ -846,7 +863,19 @@ static NTSTATUS get_file_callback(struct cli_state *cli,
>   		goto out;
>   	}
>   
> -	status = tar_create_skip_path(&tar_ctx, remote_name, finfo, &skip);
> +	if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) {
> +		isdir = true;
> +		old_dir = talloc_strdup(ctx, initial_dir);
> +		new_dir = talloc_asprintf(ctx, "%s\\", remote_name);
> +		if ((old_dir == NULL) || (new_dir == NULL)) {
> +			status = NT_STATUS_NO_MEMORY;
> +			goto out;
> +		}
> +	}




More information about the samba-technical mailing list