Joel Hammer
2001-Nov-08 16:52 UTC
Permission problem in message command with guest ftp user
I haven't seen this posted so I will add one more reason why the message command may not work: Permissions. I have this in my [global]: message command = /bin/bash -c 'cat %s | mutt -s You_logged_on jlh;rm %s' & This never would work and I never could figure out why. Turns out that I have guest user ftp, who for security reasons doesn't have much in the way of write privileges in my /var/spool/mail/jlh file: -rwxrwxr-x jlh mail Nov 8 19:26 jlh All my logons are as a guest. I couldn't find any errors in any logs, and other commands would work, just not mutt (for example, echo Message sent > /tmp/message). So, here is the clue: ls -al `which mutt` -rwxr-xr-x 1 root root /usr/local/bin/mutt However, here is ls -al `which mail` -rwxr-sr-x 1 root mail /bin/mail Here is the from address of the mail that samba sends me: From: FTP user <ftp@cc241769-a.twsn1.md.home.com So, keeping things simple, I just changed mutt to mail in my message command, and now all it fine. I could have changed permission and ownership on mutt, but, it it working fine, so, why mess with it. At least I now know why the mail boxes must be in group mail! I suspect that a command like kedit %s would fail too, because ftp wouldn't have permissions, unless added by xhost +ftp, to write to the xserver. I think I just posted to a "newbie" that permissions are 1/3 of the grief of linux. Maybe I should have said 80%. I JUST WISH I could have found this error reflected in some log somewhere! Joel
Joel Hammer
2001-Nov-08 17:20 UTC
Permission problem in message command with guest ftp user
Boy, how wrong I was. There is a permissions problem, but not what I dreamt of, with kedit %s as the message command. Here is the message as it arrives on the client computer in /tmp: -rw------- 1 ftp ftp 1517 Nov 8 19:26 msg.20m8g9 Yes, that's right, the client, who is not user ftp, cannot read this message. root can read it, but of course, he needs to be added to xhosts before he can run kedit. I tried to change the permission of kedit: -rwsr-sr-x 1 root root 210589 Apr 3 1999 /opt/kde/bin/kedit but my regular user still can't read the message file. That is puzzling, at least to me. I guess this is a good reason not to use guest logons, at least for linux clients. I suppose a more careful choice of the guest account might get around this problem. Joel