Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ssmtp hates apache [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
KWhat
l33t
l33t


Joined: 04 Sep 2005
Posts: 660
Location: Los Angeles

PostPosted: Tue Feb 24, 2009 11:48 pm    Post subject: ssmtp hates apache [SOLVED] Reply with quote

So I have always used ssmtp with php and apache because its simple and it worked. Recently I have run into a very cute problem. SSMTP is complaining that "Could not find password entry for UID 81". Well uid 81 is apache right, and of course it doesnt have a password or a login shell for obvious reasons. (apache:x:81:81:added by portage for apache:/var/www:/bin/false)

So I dug through some code found the following in ssmtp.c thats been there for a very long time but this use to work.
Code:

int ssmtp(char *argv[])
{
   char buf[(BUF_SZ + 1)], *p, *q;
#ifdef MD5AUTH
   char challenge[(BUF_SZ + 1)];
#endif
   struct passwd *pw;
   int i, sock;
   uid_t uid;

   uid = getuid();
   if((pw = getpwuid(uid)) == (struct passwd *)NULL) {
      die("Could not find password entry for UID %d", uid);
   }
   get_arpadate(arpadate);

   if(read_config() == False) {
      log_event(LOG_INFO, "%s/ssmtp.conf not found", SSMTPCONFDIR);
   }


So my question is what happend that is causeing getpwuid(getuid()) == (struct passwd *)NULL for apache now? Is anyone else having this issue? I guess maybe getpwuid could be returning an issue and ssmtp forgot to check what it was? Ideas would be helpful. Thanks.


Last edited by KWhat on Tue Feb 24, 2009 11:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
KWhat
l33t
l33t


Joined: 04 Sep 2005
Posts: 660
Location: Los Angeles

PostPosted: Tue Feb 24, 2009 11:58 pm    Post subject: Reply with quote

For some reason my permissions were messed up on the /etc/passwd file.

Solution: chmod 644 /etc/passwd
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum