Eudes Habambyingwe wrote:
> 
> Why would vadddomain fail to update /var/qmail/users/assign?
> Eudes

There is a section of code.. which parses the assign file looking
for a string, specifically the email domain.

In the vpopmail.c file look for:

/*
 * delete a domain from the usrs/assign file
 */
int del_domain_assign( char *domain, char *dir, int uid, int gid )
{

This code should definitly be reviewed.

It has 3 sections:

1) Format the string to remove from the file

    sprintf(tmpbuf1, "+%s-:%s:%lu:%lu:%s:-::",
        domain, domain,
        (unsigned long)uid, (unsigned long)gid,
        dir);

2) Remove the line. It is done by a routine shared
   with other parts of the code. 


    remove_line( tmpbuf1, tmpbuf2);

3) set file permissions:
    chmod(tmpbuf2, VPOPMAIL_QMAIL_MODE );

4) compile the assign file (sorry, more than 3 sections)
    update_newu();

5) delete the domain from the authenication module
   by calling the plug in api

    vauth_deldomain(domain);
    return(0);
}

I think this vauth_deldomain should be moved up into the calling 
function. And there needs to be more comments.

So, you could test by printing out the format of the string
it's trying to remove, and check it against the strings in
the assign file.

Ken Jones

Reply via email to