What can be used for computers to send each other quick messages over a LAN

The situation may seem familiar to some users, that they are hosting numerous computers on their LAN, and that they’d like to send a message from one to the other. Some users who were accustomed to ‘WinPopup’ and ‘LinPopup’, have been longing for a replacement. Because WinPopup is no longer a part of Windows, and because LinPopup is no longer a part of the standard Linux repositories, their use is extremely limited. For example, even if we custom-compile LinPopup and install it to our Samba server, there is no way for an up-to-date Windows computer to send us a message, because we cannot and should not install this to Windows. And, when sending a message from a Linux machine, it will often work best to do so from the ‘smbclient’ command-line, and not even to use this old program / GUI. [:1]

Yet, If we choose to install this type of software, we would like for it to be compatible between Windows and Linux machines. Otherwise, we could just be installing any software, from any programmer, paying a subscription fee per machine, and only find that our solution does not support Linux.

And so one solution which I have gone with, is called “IP Messenger“. This software is popular in Japan, and has Windows installers. There is only one note of caution from me though: Version 3.52, which I have installed under Windows, does not allow us to disable the Autostart feature, and this behavior can seem a bit malware-like. Also, if we have this daemon running, it can prevent a Windows machine from going into standby correctly. The computer could just keep waking itself up. And so my standard behavior is to terminate this program from the Systray Icon’s Context Menu manually, after every reboot.

What some people may like about this solution, is that there are at least two working Linux versions which we can install directly from the package manager: ‘xipmsg’ and ‘iptux’ . ‘g2ipmsg‘ does not work on recent Linux versions, due to “Attempting To Unlock A Mutex Which Wasn’t Locked”.

‘xipmsg’ is a bit of a kluge, an old implementation based solely on X-server-libraries, that has few of the features which IP Messenger is supposed to have. ‘xipmsg’ will simply allow a text message to be sent and received, and that is all, while the full version will also allow for messages to be given simplistic encryption and for file attachments. ‘iptux’ has more of a full-featured GUI, and allows for these features to be used under Linux as well – assuming that the machine on the other side also has these extensions installed.

Another way in which ‘IP Messenger’ differs from ‘LinPopup’ though, is that the old solution would virtually guarantee that we can receive a message, even if we don’t have this service running, “as long as our computer is turned on”. ‘IP Messenger’ cannot offer this. We would need to have the service running, in order for messages to be received, at the time they were sent.

Dirk

[Edit 1: ] If we did try to send a LinPopup message to an up-to-date Samba server, in my experience, the server will request a password authentication from the sender, even though none should be necessary. Thus, the ‘smbclient’ command-line used would need to specify an ‘-N’ parameter, in addition to the ‘-M’ parameter, the former of which suppresses the password prompt.

However, when the LinPopup v2.1.0 GUI was written in 2009, there was no awareness of this specific need on the side of the sender. Hence, LinPopup would try to invoke ‘smbclient’ without this parameter, and then some users were mystified as to why the message was not sent.

So that GUI cannot even be used to send, to a current server version.

 

It is possible to mistake a configuration file for a shell script.

One source of error which I’ve observed, was even recommended in the old ‘linpopup’ package documentation.

ICYMI, “Linpopup” was a Linux extension to the Samba server, meant to allow messages to be passed directly from one computer to another on a LAN. It was based on the old “WinPopup” feature, which Microsoft discontinued with Windows XP (Service Pack 2 ? )

I think that one of the problems with the original WinPopup was, that its messages were allowed to be rich text, including URLs, which users were tricked into clicking on, because users did not recognize that pop-up windows they were getting, were in fact intended as a feature, but that these messages were eventually sent out to blocks of IP addresses as a form of spam, sometimes carrying a payload of malware.

Unlike its Windows predecessor, LinPopup only allows Plain Old Text to be sent. But this posting is not meant to describe this, as a feature of Samba. I’m intending to showcase this as an example of a type of mistake, which modern-day thinkers make when creating configuration files. In order to ready a Samba server to receive these messages, a Linux user is given the suggestion to put the following into their /etc/samba/smb.conf, near the end of their [global] section:

message command = /usr/local/bin/LinPopUp "%f" "%m" %s; rm %s

I know this, because I custom-compiled the old package, and this was stated in the documentation.

Now, it is possible to configure some other program to receive the message, which Samba leaves in the temporary file ‘%s’, as long as we remember that any message command which Samba runs, will be run as user ‘nobody’, with the privileges of user ‘nobody’. That’s not a problem. But there is a problem with this configuration line, which users ran in to, and which users had trouble pinpointing.

This is meant for a configuration file, but the above syntax would be suitable for a shell script. A configuration file will often allow for an executable program to be specified, and will even go so far as to allow command-line parameters to be passed in. But a configuration file will not go so far, as to allow two programs to be executed in sequence. That is a luxury which too many modern coders take for granted, apparently.

The two programs referred to above are

/usr/local/bin/LinPopUp

rm

In fact, this configuration mistake will pass in the semicolon, as part of the parameters to /usr/local/bin/LinPopUp , thereby mangling the ability of this program to identify the file the message is in. And then it will pass in the string “rm” as well…

What I had to do myself, was something like

message command = bash -c '/usr/local/bin/linpopup "%f" "%m" %s ; rm %s' &

The one program I’m telling Samba to run, is ‘bash’. It, in turn, can run several other programs synchronously, asynchronously, etc..

Also, it should be noted that the ‘&’ at the end of my line, is not equivalent to its use in shell scripts, where it tells a running instance of ‘bash’, to disconnect the child process immediately, and to continue running the rest of the script. My ‘&’ does not assume that ‘bash’ is already running, and appears as a parameter to ‘bash’ itself.

For all I know, ‘bash’ could simply ignore this. But I do know, that this ‘&’ does not interfere in my message command working…

Dirk

(Edit : ) And, It is up to the way the Samba server parses its configuration file, whether it expands the variables, which begin with ‘%’ , inside single quotes. It doesn’t matter that ‘bash’ would not do so.