popup messages

David Lee t.d.lee at durham.ac.uk
Fri Nov 9 09:02:09 GMT 2001


> Date: Thu, 8 Nov 2001 21:06:48 -0500
> From: Joel Hammer <Joel at HammersHome.com>
> To: Jack Malone <jmalone at horizonind.com>, samba at lists.samba.org
> Subject: Re: popup messages
> I don't see any easy way to send pop up messages to all clients from linux
> with smbclient -M.
> If you have a win server, say your linux box,
> smbclient -L winserver -N will list them all. You will then need to make a script to
> extract the machines names, I fear. That can be a real pain.
> Of course, if you have a list of all machines on your network, you could
> just use that list, rather than mess around with extracting them from
> smbclient -L winserver.
> If you have a list of machine names in a file, ListOfNames, this might work:
> while read i; do cat YourMessageFile | smbclient -M $i;done < ListOfNames
> The good thing is you can customize it.
> smbstatus will list only those currently logged in, for example.
> smbstatus 2>/dev/null | cut -c40-70 | grep \( | sed 's/ .*//' | sort -u 
> This will get the current logged on machines. Naturally, any self respecting
> linux scripter would pipe this output into the read command above!
> There must be a better way.
> Joel
> > want to broadcast messages to all client then what command should i
> > use? currently i m using smbclient -M {hostname}.

But all that is working around something which feels as if it ought to
have a better solution.  So...

A few months ago, I sketched out, and tested, some code for the 2.2.1a
"smbd" which would implement just this, but more naturally. 

Let's look at the wider picture...

The user-visible functionality we seem to be wanting (although hitherto
not explicitly stated) is for the standard UNIX commands such as "wall"
and "write" (the 'write' that allows one terminal user to write to
another) to be available.  So (executive summary!) that is what I

I would be happy (more than that: pleased and delighted) to see this
functionality rolled into Samba, and my code is available as a basis or
example for the Samba Team if they wish.


Samba's session code includes "utmp", whose "ut_line" is a pseudo-terminal
number, e.g. "smb/99".  My code does the following:

1.  Allows this optionally to be created as a pipe (e.g. "/dev/smb/99")
    via an smb.conf parameter;

2.  "smbd" includes this in the set of sockets on which it listens;

3.  Any data on it is encoded into WinPopup message blocks (sharing
    common code with the "smbclient" program).

Note, incidentally, that allowing the creation of the pseudo-device also
fixes a long-standing (but almost completely unrelated) problem with
the "finger" command.

So we possibly need a second parameter, equivelent to the UNIX "mesg", so
that the device can still be created anyway (for sites that wish to fix
the finger problem), but messaging not used.

Can we agree on the principle of offering this functionality? 

My code is not perfect, and still needs work.  But it is sufficient to
demonstrate the principle to the Samba Team...

Hope that helps (longer term!).


:  David Lee                                I.T. Service          :
:  Systems Programmer                       Computer Centre       :
:                                           University of Durham  :
:  http://www.dur.ac.uk/t.d.lee/            South Road            :
:                                           Durham                :
:  Phone: +44 191 374 2882                  U.K.                  :

More information about the samba mailing list