Skip to content

Actions seem to be processed in reverse order? #42

@stephenreay

Description

@stephenreay

I'm trying to debug an issue we're seeing in a production environment: a csync2 group has several actions defined, in a specific order:

  • action 1 sets the correct ownership of the file via chown;
  • action 2 runs setfacl to ensure correct filesystem ACLs are in place;
  • action 3 runs a custom script via sudo -u ... to do some processing on the file;

After running some sync's with -v -v it seems that csync2 is reading the actions in the reverse order, and thus executing them in reverse order, which fails because the script is run as a user who doesn't yet own the file.

Is this intended behaviour, or have we discovered some kind of bug? Is there an explicit way to specify the order the actions should be performed?

I looked quickly in action.c and there's nothing obvious there to my eyes, about why it would be reversing the order, but I also don't really know enough about how the config parser works to know that it isn't being parsed backwards.

Lastly - if the order is not deterministic currently, would you be open to adding the ability to make it deterministic?
I'm happy to try and help with a patch for this, but C really isn't my day job, so it's quite possible that even a patch which "works" will need to be fixed to make it usable/safe/what have you...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions