--On 2006-12-04 8:39 PM -0800 Mark Crispin <[EMAIL PROTECTED]> wrote:
Hmm.  It should only do that if the EUID was still you.

Try su instead of sudo and see what happens.

Using a just-downloaded and vanilla imap-2006d.DEV.SNAP-0612041740 distribution:

% make sol
 ...
% cd mailutil
% ./mailutil copy INBOX inbox-copy
 [creates ~/inbox-copy as expected]
% rm ~/inbox-copy
% sudo -u emchen ./mailutil copy INBOX inbox-copy
Can't create mailbox node /home/m/s/msirota/inbox-copy: Permission denied

That's my home directory, not emchen's, that it's trying to create
the file in.

% sudo su emchen -c "/usr/local/src/apps/imap-2006d.DEV.SNAP-0612041740/mailutil/mailutil copy INBOX inbox-copy"
Can't create mailbox node /home/m/s/msirota/inbox-copy: Permission denied

Same thing.

% sudo su - emchen -c "/usr/local/src/apps/imap-2006d.DEV.SNAP-0612041740/mailutil/mailutil copy INBOX inbox-copy"

That works.  In my opinion it's a little overcomplicated just to satisfy
the folks who use multiple usernames with different home directories and
the same UID; why not just use $HOME as you already do, rather than the
getlogin() route?  It forces me to create login shells as each user, which
runs a lot more out of their startup environment and is therefore more
expensive.

But at least I have a workaround now.  I'll have to consider whether to
keep carrying this patch around vs. patching my tools to use
'sudo su - user -c  "command"' rather than 'sudo -u user command'.

Mark

_______________________________________________
Imap-uw mailing list
Imap-uw@u.washington.edu
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to