Hi,
I had first tried your suggestion the other way around, that is, creating it as root then dcop'ing it as a user. It doesn't work. I had tried it before, but FYI, here's what it does:
- if I try dcop --user root as is, I get a warning because it doesn't find /root/.ICEauthority.
- if I export ICEAUTHORITY to my user's profile (the one from which sudo was done, and sudo doesn't modify $HOME), then retry, dcop hangs.
Then, about your idea: creating it in userland, than accessing it as root. Of *course* it works, since sudo preserves $HOME and root is, well, root.
However, when the DCOPRef is created within a sudo'd script, the same script, still running, cannot access the DCOP ref.
I think DCOP fails to register the DCOPRef in the proper space, somehow. I just don't know the details...