redirection and smbwrapper

Andrew Tridgell tridge at
Sat Oct 3 14:39:41 GMT 1998

> I assume you're running the shell with smbwrapper pre-loaded.

yes, I'm running smbsh (a little shell script I wrote that launches
the whole thing - see the smbwrapper directory).

> How about an environment variable?  The library start-up code could
> check whether the variable is defined and use its contents to map file 
> descriptors to SMB files.

that might work. hmmm, something like this:

1) wrap dup2() and dup() to catch the file descriptor creation
2) wrap fork() and create environment variables for all open files
   like SMBW_FD_nn=/full/path
3) in the first wrapper call check for a SMBW_FD environment variable
   and if set then open the files specified in the env and dup2() them
   to the right fd

all of this should work, but it's going to be fairly intricate to
implement. I'll think about it some more. Thanks for the idea!

Cheers, Tridge

More information about the samba-technical mailing list