Subject: pkg/12564: smbclient attempts to use non-existing find option (-maxdepth)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <claude.marinier@dreo.dnd.ca>
List: netbsd-bugs
Date: 04/06/2001 14:00:11
>Number:         12564
>Category:       pkg
>Synopsis:       smbclient attempts to use non-existing find option (-maxdepth)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 06 11:01:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Claude Marinier
>Release:        samba 2.0.7
>Organization:
Claude Marinier, Information Technology Group    claude.marinier@dreo.dnd.ca 
Defence Research Establishment Ottawa (DREO)    (613) 998-4901  FAX 998-2675
3701 Carling Avenue, Ottawa, Ontario  K1A 0Z4         http://www.dreo.dnd.ca
>Environment:
NetBSD 1.5 (i386) to any Windows system
System: NetBSD behemoth 1.5 NetBSD 1.5 (DREO) #0: Thu Jan 18 15:26:11 EST 2001 marinier@leviathan:/usr/src/sys/arch/i386/compile/DREO i386

>Description:
	When I use mput from smbclient, the generated find command fails
	because NetBSD 1.5 does not support the -maxdepth option.
>How-To-Repeat:
	Use mput without recursive mode.
>Fix:
One of:

1) Work around it by specifying recursive mode (the generated find command
   does not use -maxdepth),

2) wait for the Samba team to write code to replace the 'call' to find (this
   is the lastest suggestion on the Samba mailing list), or

3) change the code to use ls instead of find as follows.

*** client.c	Fri Apr  6 13:26:15 2001
--- client.c-original	Fri Apr  6 13:25:58 2001
***************
*** 1165,1171 ****
  				"find . -name \"%s\" -print > %s",p,tmpname);
  		else
  			slprintf(cmd,sizeof(pstring)-1,
! 				"ls -1 %s > %s",p,tmpname);
  		system(cmd);
  
  		f = sys_fopen(tmpname,"r");
--- 1165,1171 ----
  				"find . -name \"%s\" -print > %s",p,tmpname);
  		else
  			slprintf(cmd,sizeof(pstring)-1,
! 				"find . -maxdepth 1 -name \"%s\" -print > %s",p,tmpname);
  		system(cmd);
  
  		f = sys_fopen(tmpname,"r");

>Release-Note:
>Audit-Trail:
>Unformatted: