Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH]: restore permissions and mode on HISTFILE when renaming it



On Dec 16,  9:42am, Arkadiusz Miskiewicz wrote:
}
} Exaple, I'm working as user arekm and .historyz has arekm:users
} user/group but if I do sudo zsh; ls; exit then it's renamed and I end
} up with .historyz being root:root

Ick.  I don't think it's appropriate for root's history to get written
into some other user's SAVEHIST file.  A better solution to this would
probably be to skip writing the history entirely if the file owner is
not the same as the current EUID.

} Attached patch makes zsh restore original permissions/owner/group of
} HISTFILE after sucessful rename. It's against HEAD (4.3) cvs version.

Even if that approach is chosen, the race conditions you mentioned
could be avoided by changing the file attributes *before* renaming it.



Messages sorted by: Reverse Date, Date, Thread, Author