Re: [Rpmrebuild-project] [PATCH] Ensure that temporary directory is cleaned up
rpmrebuild build packages from modified installed packages
Brought to you by:
gerbier
From: Christopher F. <me...@cg...> - 2005-05-29 04:17:51
|
On Sat, May 28, 2005 at 10:13:42AM -0700, Valery Reznic wrote: > >--- Christopher Faylor <me...@cg...> wrote: > >> On Fri, May 27, 2005 at 02:57:54AM -0700, Valery >> Reznic wrote: >> >> >> >> >> >>+ chmod -R u+rw "$RPMREBUILD_TMPDIR" >> 2>/dev/null >> >> || : >> >> > >> >> >May be better to make that "u+rwX" in case >> someone >> >> ever creates a >> >> >directory mode 000 (yah, that doesn't make as >> much >> >> sense, but...) >> >> >> >> Yeah, I guess you're right. Might as well make >> it: >> >> >> >> chmod -R 777, then, since it is going away >> anyway. >> >No, it'll be securite problem, i suggesr >> > chmod -R 700 "$RPMREBUILD_TMPDIR" >> > >> >Why you need '|| :' ? >> >> The directory may not exist. I usually use that as >> an idiom >> for scripts which might exit on error but maybe it's >> not required >> in this case. >Now I see. I can't understoor why chmod -R may fail. > >I got another idea about chmod. >it's really needed relative rare, from one side, and >RPMREBUILD_TMPDIR could contains a lot of filea and >directories so chmod -R may be expensive. >Instead of just 'rm -rf', and only if this fail, >'chmod -R' and then 'rm -rf again', i.e: > >rm -rf "$RPMREBUILD_TMPDIR" 2>/dev/null >if [ $? -ne 0 ]; then > chmod -R "$RPMREBUILD_TMPDIR" 2>/dev/null > rm -rf "$RPMREBUILD_TMPDIR" || return >else > : >fi Good idea. I like it. cgf |