This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

path_conv::check() gets confused by recently opened files


I stumbled across a problem with path_conv::check() when scp-ing a
read-only file.  I can reproduce the problem with the attached simple
test case, tchmod.cc.  For example:

    $ ls -l -d foo foo/readonly 
    ls: foo/readonly: No such file or directory
    drwxr-xr-x    2 jt       Domain U        0 May 21 15:13 foo
    $ tchmod foo/readonly
    $ ls -l -d foo foo/readonly
    dr--r--r--    2 jt       Domain U        0 May 21 15:13 foo
    -rw-r--r--    1 jt       Domain U        0 May 21 15:13 foo/readonly

Note that foo's permissions should not have changed and foo/readonly
should be read-only instead of read-write.

The expected results which can be forced by supplying a second argument
is:

    $ ls -l -d foo foo/readonly
    ls: foo/readonly: No such file or directory
    drwxr-xr-x    2 jt       Domain U        0 May 21 15:23 foo
    $ tchmod foo/readonly 1
    $ ls -l -d foo foo/readonly
    drwxr-xr-x    2 jt       Domain U        0 May 21 15:23 foo
    -r--r--r--    1 jt       Domain U        0 May 21 15:23 foo/readonly

Unfortunately, I haven't figured out how to teach path_conv::check()
to deal with recently opened files.  I'm also a little leery to perturb
this code.  Any hints or help would be greatly appreciated.

Thanks,
Jason

Attachment: tchmod.cc
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]