Skip to content
Tcl Source Code View Ticket
Login

View Ticket

filesystem-7-7 fails

Closed / Fixed889182ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 22 years ago
Descriptionplain2004-02-02 17:17:00
On Solaris 9:

==== filesystem-7.7 cross-filesystem dir copy with
-force FAILED
==== Contents of test case:

    set dir [pwd]
    cd [tcltest::temporaryDirectory]
    file delete -force simpledir
    file mkdir simpledir
    file mkdir dir2
    set fout [open [file join simpledir simplefile] w]
    puts -nonewline $fout "1234567890"
    close $fout
    testsimplefilesystem 1
    # First copy should succeed
    set res [catch {file copy simplefs:/simpledir dir2}
err]
    lappend res $err
    file attributes dir2 -permissions 0000
    # Second copy should fail (no -force)
    lappend res [catch {file copy simplefs:/simpledir
dir2} err]
    lappend res $err
    # Third copy should succeed (-force)
    # I've noticed on some Unices that this only succeeds
    # intermittently (some runs work, some fail).  This
needs
    # examining further.
    lappend res [catch {file copy -force
simplefs:/simpledir dir2} err]
    lappend res $err
    lappend res [file exists [file join dir2
simpledir]]  [file exists [file join dir2 simpledir
simplefile]]
    testsimplefilesystem 0
    file delete -force simpledir
    file delete -force dir2
    cd $dir
    set res

---- Result was:
0 {} 1 {error copying "simplefs:/simpledir" to
"dir2/simpledir": permission denied} 1 {error copying
"simplefs:/simpledir" to "dir2/simpledir": permission
denied} 0 0
---- Result should have been (exact matching):
0 {} 1 {error copying "simplefs:/simpledir" to
"dir2/simpledir": file already exists} 0 {} 1 1
==== filesystem-7.7 FAILED
vincentdarleyplain2004-02-03 00:36:22
Logged In: YES 
user_id=32170

Does this fail every time?  I've seen it fail
intermittently, and haven't been able to understand why...
dgpplain2004-02-03 00:41:17
Logged In: YES 
user_id=80530

yes, every time.
dgpplain2004-02-06 02:42:25
Logged In: YES 
user_id=80530

Is there just a mistaken intent here?

I think the -force option is meant
to disable the "safety" feature of
not overwriting an existing file.
I don't think it's intended to (nor
is it capable of) confer super-user
powers so that files and directories
can be manipulated in ways that
are beyond current permissions.
dgpplain2004-02-06 03:08:17
Logged In: YES 
user_id=80530


hmmm... I see that this test
is also marked as "unixOnly".

Is there  any unix system
on which this test passes
in its current form?
dgpplain2004-02-06 03:12:09
Logged In: YES 
user_id=80530


Looks like the permissions
reset is a red herring.  If I
comment out the "-permissions 0000"
line, then the test passes, and
appears to be testing the -force
option correctly.

I think that's the proper fix.  Leaving
it to the maintainer to agree and
take action.
dgpplain2004-05-26 23:51:06
Logged In: YES 
user_id=80530

looks like this was fixed
some time ago?  Can be closed, yes?
vincentdarley Closed ticket [889182ffff]. [History diff]2004-07-02 15:07:30
Log in (anonymous is fine) to add a comment.