Failure to rename files that have active file handles

Stephen Gallimore sg at ipsys.co.uk
Tue Nov 17 10:17:36 GMT 1998


We have just installed Samba 1.9.18p10 on an Ultra Sparc, Solaris 2.5.1 .
So far we have been very impressed with the resilience and performance
of Samba in contrast to Hummingbird and Solstice NFS products while
doing large product builds on our NT4.0 sp4 machines. 

However we have come across one little problem, which may be down to
configuration, that has left us "worried" about ditching our NFS solution
completely. That is we seem to be unable to rename a file that has an
open file handle (either owned by the same process doing the rename or
a different process), this is not a problem on a local NT drive or on
an NFS mounted drive. This showed up in "makedepend" which has code
like this:

fdin = fopen("Makefile",...)
rename("Makefile","Makefile.bak")
fdout = freopen("Makefile","w",stdout)

The rename fails with "Permission denied". I have tried this with oplocks
on and off (I couldn't see any other obvious configuration option that
might effect this).

Now clearly the above code can trivially be rewritten to avoid the problem,
however this may not always be an option. I have not been able to find
any similar report in the FAQs or the samba list archives so would
appreciate any help.

Best regards,
Stephen Gallimore

*******************************************************************************
Lincoln Software Limited          Stephen Gallimore
Marlborough Court 
Pickford Street                   Tel:    +44 (0)1625 616722 
Macclesfield                      Fax:    +44 (0)1625 616780 
Cheshire. SK11 6JD                E-mail: stephen.gallimore at lincolnsoftware.com 
United Kingdom                    Web:    www.lincolnsoftware.com 
            "Never trust a crown green bowler under 30"
*******************************************************************************


More information about the samba mailing list