smbclient messages to a specific user ?

Luke Kenneth Casson Leighton lkcl at samba.org
Fri Jan 14 01:42:41 GMT 2000


i'm sure that this can be done without mods to samba source, you admins
out there can work it out, or i'm sure one of you already has!

On Fri, 14 Jan 2000, Tavis Barr wrote:

> 
> Could I make another request to the Samba developers, something along 
> these lines for the "It would be nice...." list?  It would be great if 
> there were a parameter specifying a file (like /etc/motd) that could be 
> sent out as a WinPopUp message to all machines after a successful login.  
> Right now we do it through root preexec, but it comes up a little more 
> often than we'd like.  I suspect it wouldn't be too hard for someone 
> familiar with the Samba code to add in, but I'm not such a person.
> 
> With much appreciation,
> Tavis
> 
> 
> On Fri, 14 Jan 2000, Andrew Perrin - Demography wrote:
> 
> > We handle this problem in a not-very-elegant but nevertheless functional
> > way:
> > 
> > - in smb.conf:
> > [homes]
> > 	...
> >   root preexec = echo %u > /opt/samba/status/%m ; echo %T::%u::%m::login
> > >> /opt/samba/userlog
> >   root postexec = rm -f /opt/samba/status/%m ; echo %T::%u::%m::logout >>
> > /opt/samba/userlog
> > 
> > I then wrote a script (which I'll put at
> > http://demog.berkeley.edu/~aperrin/tips/src/ntwall.pl.txt for anyone
> > interested) that checks the files in /opt/samba/status and sends popup
> > messages only to those machines from which a homes share is currently
> > open.  This, in practical terms, maps to those machines into which someone
> > is currently logged.  This solves the problem of having winpopup messages
> > show up on machines when users log in even if the messages were sent days
> > before.
> > 
> > If you wanted to be more specific, you could check the contents of the
> > status/* files and only send to specific users.
> > 
> > Hope this is of some help.
> > 
> > ap
> > 
> > ---------------------------------------------------------------------
> > Andrew J. Perrin - aperrin at demog.berkeley.edu - NT/Unix Admin/Support
> > Department of Demography    -    University of California at Berkeley
> > 2232 Piedmont Avenue #2120  -    Berkeley, California, 94720-2120 USA
> > http://demog.berkeley.edu/~aperrin --------------------------SEIU1199
> > 
> > On Fri, 14 Jan 2000, Cole, Timothy D. wrote:
> > 
> > > > -----Original Message-----
> > > > From:	Dejan Ilic [SMTP:dejan.ilic at home.se]
> > > > Sent:	Thursday, January 13, 2000 12:17
> > > > To:	Multiple recipients of list SAMBA-NTDOM
> > > > Subject:	smbclient messages to a specific user ?
> > > > 
> > > > Hello.
> > > >  I'm using Samba 2.0.5a (PDC) and "smbclient -M" to send feedback messages
> > > >  to users sitting on WinNT4 machines. The feedback is mostly accounting
> > > >  information like number of pages left that the user can print, or quota
> > > >  status when logging in etc.
> > > > 
> > > >  smbclient can send to a specific (netbiosname) machine but not to a
> > > >  specific user on that machine. You can only supply the senders user, not
> > > >  receiver. This is not a problem today as we have WinNT workstations where
> > > >  only one user at time work, and the messages are usualy directed to that
> > > >  user.
> > > > 
> > > >  But there are two problems with this limitation:
> > > >  *) Ie when printing a lengthy document the user can log out, leave the
> > > >     machine and got to the printer and wait for the printer to finish its
> > > >     job. When the job is done the server will send a message to the
> > > >     computer, but the user has left, and the message will be printed on
> > > > the
> > > >     loginscreen, or to the next user sitting on by the computer now!
> > > > 
> > > >     This could lead to some confusion and possibly leaking of semi-private
> > > > 
> > > >     information. I would like to avoid that if possible by directing the
> > > >     message to a specific user on that machine. The other users should not
> > > >     be able to see the message.
> > > > 
> > > >  *) The limitation will become unbearable when we start using WinNT 
> > > >     Terminal Servers here. Sending a message to a TS could mean that all
> > > >     the users logged in will se the message (?), when only one in realy
> > > >     interested in the result. You could imagine a server with 20-35 users
> > > >     logged in and every time someone prints or logs in everybody get a
> > > >     message that they realy shouldn't receive.
> > > > 
> > > > Windows NT4 "net send" command has a possibility to send to a specific
> > > > user. I must admit that I haven't used it, but it indicates that it should
> > > > work.
> > > > 
> > > > Is it possible to extend smbclient so that it can send messages to a
> > > > specific user on a specific machine (or domain), or is it a limitation in
> > > > Windows implementation ? Hopefully implemented in a Samba 2.0.x :-)
> > > > 
> > > 	Basically the way it works is that each user that logs in registers
> > > a NetBIOS/WINS record:  username<03h>, with the IP of the machine they're
> > > logged in on.  I believe when net send sends to a specific user, it looks up
> > > this record, then dispatches the message to the messenger service at that
> > > particular IP.
> > > 
> > > 	I don't think it's any more involved than that, since it's not
> > > unheard of to have problems with having two users with the same name in
> > > different domains to each randomly get print notifications and other
> > > messages intended for the other.  I think this is because the domain isn't a
> > > component of the 0x03 name, so the most recent user to log in gets all
> > > messages for all users with the same name in all domains.
> > > 
> > > 	This also suggests to me that the actual windows messanging setup is
> > > machine-based, rather than user-based.  I have really no idea how terminal
> > > server copes with that, or if it even does.
> > > 
> > 
> > 
> 

<a href="mailto:lkcl at samba.org"   > Luke Kenneth Casson Leighton    </a>
<a href="http://www.cb1.com/~lkcl"> Samba and Network Development   </a>
<a href="http://samba.org"        > Samba Web site                  </a>
<a href="http://www.iss.net"      > Internet Security Systems, Inc. </a>
<a href="http://mcp.com"          > Macmillan Technical Publishing  </a>

 ISBN1578701503 DCE/RPC over SMB: Samba and Windows NT Domain Internals



More information about the samba-ntdom mailing list