[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: ruby-dev summary 26090-26127

Berger, Daniel

5/12/2005 6:18:00 PM

> -----Original Message-----
> From: Ara.T.Howard@noaa.gov [mailto:Ara.T.Howard@noaa.gov]
> Sent: Thursday, May 12, 2005 12:15 PM
> To: ruby-talk ML
> Subject: Re: ruby-dev summary 26090-26127
>
>
> On Fri, 13 May 2005, Tanaka Akira wrote:
>
> > In article <Pine.LNX.4.62.0505120944380.9643@harp.ngdc.noaa.gov>,
> > Ara.T.Howard@noaa.gov writes:
> >
> >>> There are following two solutions.
> >>>
> >>> * Use chdir.
> >>> * Change a permission to 700 and change a owner.
> >>
> >> what about making a tmpdir of 0700, moving to that, then
> cleaning the
> >> dir under the tmp dir, and removing to tmpdir? i think
> just doing a
> >> chmod will fail on nfs since it caches inode information...
> >
> > They are different ideas. They are not expected to combine.
>
> maybe i was unclear - i meant:
>
> mkdir dir_to_be_removed.tmp
>
> chmod 0700 dir_to_be_removed.tmp
>
> mv dir_to_be_removed dir_to_be_removed.tmp # avoid race
> condition, ignore
> # errors here
>
> rm -rf dir_to_be_removed.tmp/dir_to_be_removed
>
> rm -rf dir_to_be_removed.tmp/
>
>
> - no race, even on nfs
>
> - no security issue since all chmod'ing done during removal
> will happen
> under a restricted directory
>
>
> cheers.
>
> -a

Whatever solution you decide on, please ensure it doesn't barf on Win32
afterwards.

Regards,

Dan