smbsh/smbwrapper/winbind linux help

Stieglitz, Eric J. (DCSA) EStieglitz at
Wed Jun 26 07:19:01 GMT 2002


  Thanks for your offer of assistance.

  Basically, smbsh fails with error EINVAL after it tries to exec
my shell using the shared library functions in The
details to this can be found in a previous message here:

I've also noticed that the file include/includes.h may define all
instances of "fcntl" as "fcntl64". Despite this, an strace while running
smbsh shows that sometimes fcntl is executed as "fcntl" and othertimes
it executes as "fcntl64". Neither of us are experienced systems programmers,
so we're not sure if this is normal behavior or not. The defines in the
include file are:

	/* this is a gross hack. 64 bit locking is completely screwed up on
	   i386 Linux in glibc 2.1.95 (which ships with RedHat 7.0). This hack
	   "fixes" the problem with the current 2.4.0test kernels
	#define fcntl fcntl64
	#undef F_SETLKW
	#undef F_SETLK
	#define F_SETLK 13
	#define F_SETLKW 14

According to Redhat, 

" It's the back door symbols _open, _read, _write which allows smbsh to wrap around the normal file calls, possibly redirect them to smb, and then call the actual C library function using the
underscore functions.  
The GNU C library maintainers have decided to remove support for these symbols in glibc 2.1and forward."

At this point, we're basically trying to figure out whether or not it's actually
possible to get smbsh to work reliably on Linux the same way it does on Solaris.
Chris and I have pretty much hit the limits of what we know how to do and debug
on this (in fact, I can say that I've certainly learned more about the internals
of samba while trying to read the code :-) and would appreciate any assistance
from somebody more knowledgable about smbsh and the OS.


-----Original Message-----
From: David Collier-Brown [mailto:davecb at] 
Sent: Wednesday, June 26, 2002 9:43 AM
To: Johnston, Christopher (DCSA)
Cc: 'samba-technical at'
Subject: Re: smbsh/smbwrapper/winbind linux help

> "Johnston, Christopher (DCSA)" wrote:
> Was curious.. does smbsh work in Linux.. I am having all sort of 
> compilation issues with file locking.. I understand there was a bug in 
> glibc 2.1 which caused havok with 64 bit locking.. I assume that has 
> been fixed by now since I am running the latest and greatest glibc..
> Redhat 7.3
> Glibc 2.2.5
> Samba 2.2.5

	It did run once, but subsequently had problems 
	with the glibc folks: at one point they actually 
	seemed to think smbsh was a bad idea (;-))

	In principle, there is nothing in Linux that
	should stop smbsh: I use exactly the same calls 
	in my Linux as my Solaris interceptors[1].
	And I'd love to see smbsh universally available[2]!

	What's the symptoms? How can  we help?

[1. I'm a former member of the ABI team at Sun, write lots
   of interceptors, and have given Linux talks on the
 2. I think HP may have had a related problem, but I haven't 
    looked lately: anyone tried it???]
David Collier-Brown,           | Always do right. This will gratify 
Performance & Engineering      | some people and astonish the rest.
Americas Customer Engineering, |                      -- Mark Twain
(905) 415-2849                 | davecb at

More information about the samba-technical mailing list