Subject: Re: Samba's smbclient and NetBSD's find
To: Claude Marinier <claude.marinier@dreo.dnd.ca>
From: Chris Jones <chris@cjones.org>
List: netbsd-help
Date: 03/09/2001 14:17:09
On Thu, Mar 08, 2001 at 11:51:10AM -0500, Claude Marinier wrote:

> Hi,
> 
> This seems to work but there may be ramifications that I have no foreseen.
> Could someone confirm or deny this?
> 
> 		if (recurse)
> 			slprintf(cmd,sizeof(pstring)-1,
> 				"find . -name \"%s\" -print > %s",p,tmpname);
> 		else
> 			slprintf(cmd,sizeof(pstring)-1,
> 				"ls -1 %s > %s",p,tmpname);
> //			slprintf(cmd,sizeof(pstring)-1,
> //				"find . -maxdepth 1 -name \"%s\" -print > %s",p,tmpname);

Except you'd be better off with quotes:
                                "ls -1 \"%s\" > %s",p,tmpname);

This will break if the filename pattern has quotes in it, but that's
no worse than the original code.

Can you send-pr this?

Chris

-- 
----------------------------------------------------- chris@cjones.org
Chris Jones                                           Mad scientist at large