preexec: return code not used?

David Lee T.D.Lee at
Thu Jul 1 16:39:32 GMT 1999

System: samba 2.0.4b on Solaris 2.x.

We are considering using the "preexec" mechanism to issue occasional
messages to occasional users as their home directory is mounted. 
Something like: 
   preexec = sh -c \
             'if [ <this user needs a message at this time> ] \
             then \
                 <generate message> | smbclient -M %m \
             fi' &

It seems fine.

But we'd like to go one step further and have the return code from preexec
be used to continue or abort the connection being established.  The script
above would be modified to generate this return code.

Looking through the source code (smbd/service.c), it doesn't seem to check
the return code (calling smbrun to do the preexec).

Is there any reason for this apparent oversight?  Or is it a bug?
Should I try to adjust the source code and submit a patch?


:  David Lee                                I.T. Service          :
:  Systems Programmer                       Computer Centre       :
:                                           University of Durham  :
:  Phone:    +44 191 374 2882 (ddi)         South Road            :
:  Fax:      +44 191 374 7759               Durham                :
:  Internet: T.D.Lee at           U.K.                  :

More information about the samba mailing list