Opened 10 years ago

Closed 10 years ago

#288 closed defect (fixed)

rename() fails if dest file is r/o

Reported by: dmik Owned by:
Priority: normal Milestone: libc-0.6.6
Component: libc Version: 0.6.5
Severity: normal Keywords:
Cc:

Description

I found out that rename ("file1", "file2") will fail if "file2" has a r/o bit set. This is because DosDelete fails on such files with RC = 5. This failure violates the POSIX requirements which in turn breaks e.g. the mv command which uses rename() internally.

See here https://github.com/bitwiseworks/mozilla-os2/issues/29#issuecomment-38677608 for more details.

Attachments (1)

rename.diff (1.9 KB) - added by dmik 10 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 10 years ago by dmik

I would really like to see this fix in libc-6.6 since mv is frequently used by make install etc. and this is a common source of failure (I saw that more than once).

Changed 10 years ago by dmik

Attachment: rename.diff added

comment:2 Changed 10 years ago by dmik

The fix (against the libc-0.6 branch) is attached. I tested it and it fixes mv here.

comment:3 Changed 10 years ago by dmik

Milestone: libc-0.7libc-0.6.6

comment:4 Changed 10 years ago by bird

Resolution: fixed
Status: newclosed

Committed a fix in r3905 for both trunk and branch.

Note: See TracTickets for help on using tickets.