C library "chown()" & AmigaDOS "SetOwnerInfo()" bug
Posted: Wed Feb 25, 2015 9:24 pm
I ported an old GG (*nix) program that uses the "chown" command and discovered that setting the owner of a file with chown causes the directory containing the file to be locked and cannot be deleted. An attempt to delete the directory results in an AmigaDOS "object in use" requester.
I can't tell for sure about newlib but I checked the clib2 sources for "chown" and found that it's using AmigaDOS "SetOwner()". I wrote a short test program using OS4 AmigaDOS SetOwnerInfo() and it also causes a directory containing a file that has the owner set by SetOwnerInfo() to be locked and can't be deleted.
Summary: Setting a file owner with "chown()" or "SetOwnerInfo()" causes the directory containing the file to be locked and not deletable.
I can't tell for sure about newlib but I checked the clib2 sources for "chown" and found that it's using AmigaDOS "SetOwner()". I wrote a short test program using OS4 AmigaDOS SetOwnerInfo() and it also causes a directory containing a file that has the owner set by SetOwnerInfo() to be locked and can't be deleted.
Summary: Setting a file owner with "chown()" or "SetOwnerInfo()" causes the directory containing the file to be locked and not deletable.