On Wed, Oct 08, 2003 at 09:17:40PM -0700, Sagara Wijetunga wrote:
> Now it says:
> Internal error (module sqconfig.c, line 63) - contact
> system administrator
> 
> Unable to open for write:
> ./sqwebmail-ip
> Permission denied
> 
> Since SqWebMail is installed as set-userid-root, I
> expect it to run as the root user, so why a permission
> problem? 

It gives up its root privileges at the earliest opportunity and becomes the
uid of the authenticated user. Hence if the user has logged in a "bruce" but
the Maildir is owned by "sheila" then you will get that error.

> Is there any possibility to enhance your patch as
> follows:
> 1.    To print the effective user (ie. As what user it is
> attempting to open the file in write mode)
> 
> 2.    To print the current working (ie. Where it is
> trying to create the sqwebmail-ip)

Yes it's possible; just add in the appropriate lines of C code. You can call
the functions getcwd() which gives the current working directory as a
string, and getuid() to return the numeric user id. I might do it later if I
get a chance.

Regards,

Brian.

Reply via email to