#2798 Delete multiple aliases may lead to aliases file corruption

1.330
closed
5
2007-04-03
2007-04-03
No

1. &renumber_list is called with wrong arguments in &delete_alias and &modify_alias function.
It is erroneously assumed, that alias to be deleted or modified is one lined (line == eline). This leads to %list_aliases_cache corruption and possible corruption of aliases file during batch aliases delete in delete_aliases.cgi.

2. &renumber_list works wrong, when called from &modify_alias with multi lined aliases (line != eline).
When alias becomes multi lined (e.g. comment added), 'eline' of modified alias cache entity is greater than 'eline' of &renumber_list position-object argument. This triggers 'eline' modification rule in &renumber_list.
You may check this using Data::Dumper. Currently, it does not lead to any problem, since &modify_alias is not called in batch mode.

Attached is a patch fixing these problems. It tested on alias deletion and modification operations. It is NOT tested on all other operations where &renumber_list is used.

Discussion

  • Jamie Cameron

    Jamie Cameron - 2007-04-03

    Logged In: YES
    user_id=129364
    Originator: NO

    Thanks, I checked your patch and it looks correct to me - I will include it in the next Webmin release.
    Other calls to &renumber were actually already correct..

     
  • Jamie Cameron

    Jamie Cameron - 2007-04-03
    • status: open --> closed
     

Log in to post a comment.