#2591 filesystem-7-7 fails

obsolete: 8.5a0
closed-fixed
5
2004-07-02
2004-02-02
Don Porter
No

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

Discussion

  • Vince Darley

    Vince Darley - 2004-02-02

    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...

     
  • Don Porter

    Don Porter - 2004-02-02

    Logged In: YES
    user_id=80530

    yes, every time.

     
  • Don Porter

    Don Porter - 2004-02-05

    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.

     
  • Don Porter

    Don Porter - 2004-02-05

    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?

     
  • Don Porter

    Don Porter - 2004-02-05

    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.

     
  • Don Porter

    Don Porter - 2004-05-26

    Logged In: YES
    user_id=80530

    looks like this was fixed
    some time ago? Can be closed, yes?

     
  • Vince Darley

    Vince Darley - 2004-07-02
    • status: open --> closed-fixed