I've long known that (oddly enough) when an object is set to allow users to buy a copy, when they do, the original gets a "changed" event with the CHANGED_OWNER bit set. To detect an actual change in ownership, we have to save the owner key and test it to see if it's changed.
I tried to take advantage of this, for an object where I want to pay someone a commission on each sale. Everything in my shop is "buy" rather than "pay", and I want to keep it that way. (For one thing, you're guaranteed that you get a precise copy of the sales floor model.) The copay script would delete itself for new owners.
Unfortunately, the object loses debit permissions on the "owner change". I consider this a bug. On "owner change", debit permission should be rescinded if and only if llGetOwner() does not match llGetPermissionsKey().
Has anyone else seen this or have any comments? I'm considering opening a Jira. I searched but didn't find one.
I have a simple workaround: have the copay script send a message to another object which pays the commission.