Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 321277 - net-im/linpopup-2.1.0 with net-fs/samba is not receiving messages from windows clients
Summary: net-im/linpopup-2.1.0 with net-fs/samba is not receiving messages from window...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard: Pending removal: 2015-01-01
Keywords: PMASKED
Depends on:
Blocks:
 
Reported: 2010-05-24 08:28 UTC by Jacek
Modified: 2015-01-07 19:28 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
linpopupwrapper.sh (linpopupwrapper.sh,64 bytes, text/plain)
2010-05-24 08:29 UTC, Jacek
Details
emerge --info (emerge_info.txt,4.06 KB, text/plain)
2010-05-24 08:30 UTC, Jacek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek 2010-05-24 08:28:22 UTC
There are 2 problems with default linpopup installation:
1. wrong permissions on /var/lib/linpopup/messages.dat - was 0600 (own by root:root), should be 0666 (root:root)
This cause linpopup is not able to read and delete messages from this file (it is required).
2. /etc/samba/smb.conf parse problem (occured in samba-3.0.37 and 3.4.6):
There is a requirement to add the following line to smb.conf file:
message command = /usr/bin/linpopup "%f" "%m" %s; rm %s

The problem (analyzed with strace) is that samba is trying to execute command:
'/usr/bin/linpopup "%f" "%m" %s; rm %s' (linpopup is an executable with 5 params:
1. "%f"
2. "%m"
3. %s;
4. rm
5. %s
)

execve("/bin/sh", ["sh", "-c", "/usr/bin/linpopup \"WKS01\" \"wks01\" /tmp/msg.XjYutj\\; rm /tmp/msg.XjYutj"], [/* 17 vars */]) = 0
execve("/usr/bin/linpopup", ["/usr/bin/linpopup", "AGENT15", "agent15", "/tmp/msg.XjYutj;", "rm", "/tmp/msg.XjYutj"], [/* 17 vars */]) = 0
access("/tmp/msg.XjYutj;", R_OK) = -1 ENOENT (No such file or directory)
write(1, "\n== LINPOPUP  V2.1.0 FATAL ERROR ==\nCan't read file /tmp/msg.XjYutj;\nExit code (1).\n\n", 85) = 85


I didn't tried to check why it is not working as expected (probably some security changes in samba code, which prevents using ; as command separator).
I created my own wrapper /usr/bin/linpopupwrapper.sh (attached; file mode: 0644 root:root) and changed "message command" line in smb.conf to:
message command = /usr/bin/linpopupwrapper.sh "%f" "%m" %s

After samba restart, popups are working correctly.


Reproduction: 
1. install linpopup
2. run /usr/bin/linpopup
3. send message from windows XP workstation (net send <linux_hostname> message) (samba must be running)
4. message does not appear (it is not working at all), message will be left in /tmp/msg.<random_name> file)
5. chmod 0666 /var/lib/linpopup/messages.dat
6. create file /usr/bin/linpopupwrapper.sh (chmod 0644; owner root:root)
7. modify /etc/samba/smb.conf "message command" line
8. restart samba
9. popups are working correctly :)
Comment 1 Jacek 2010-05-24 08:29:40 UTC
Created attachment 232675 [details]
linpopupwrapper.sh
Comment 2 Jacek 2010-05-24 08:30:51 UTC
Created attachment 232677 [details]
emerge --info
Comment 3 Víctor Ostorga (RETIRED) gentoo-dev 2010-05-24 22:14:16 UTC
The good old linpopup hasn't been updated for ages.... To be exactly since 2007. If thinks remain this way, it'll make his exit from portage soon
Comment 4 Pacho Ramos gentoo-dev 2014-11-22 18:13:43 UTC
(In reply to Víctor Ostorga from comment #3)
> The good old linpopup hasn't been updated for ages.... To be exactly since
> 2007. If thinks remain this way, it'll make his exit from portage soon

CCing treecleaners then
Comment 5 Pacho Ramos gentoo-dev 2015-01-07 19:28:11 UTC
dropped