mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-22 16:58:55 +00:00
Merge pull request #466 from ggtakec/master
Fixed a bug about could not copy file mode from org file
This commit is contained in:
commit
a56fe0ea28
11
src/s3fs.cpp
11
src/s3fs.cpp
@ -1561,6 +1561,17 @@ static int s3fs_chmod(const char* path, mode_t mode)
|
||||
return -EIO;
|
||||
}
|
||||
StatCache::getStatCacheData()->DelStat(nowcache);
|
||||
|
||||
// check opened file handle.
|
||||
//
|
||||
// If we have already opened file handle, should set mode to it.
|
||||
// And new mode is set when the file handle is closed.
|
||||
//
|
||||
FdEntity* ent;
|
||||
if(NULL != (ent = FdManager::get()->ExistOpen(path))){
|
||||
ent->SetMode(mode); // Set new mode to opened fd.
|
||||
FdManager::get()->Close(ent);
|
||||
}
|
||||
}
|
||||
S3FS_MALLOCTRIM(0);
|
||||
|
||||
|
@ -207,8 +207,13 @@ function test_chown {
|
||||
# if they're the same, we have a problem.
|
||||
if [ $(stat --format=%u:%g $TEST_TEXT_FILE) == $ORIGINAL_PERMISSIONS ]
|
||||
then
|
||||
echo "Could not modify $TEST_TEXT_FILE ownership"
|
||||
return 1
|
||||
if [ $ORIGINAL_PERMISSIONS == "1000:1000" ]
|
||||
then
|
||||
echo "Could not be strict check because original file permission 1000:1000"
|
||||
else
|
||||
echo "Could not modify $TEST_TEXT_FILE ownership($ORIGINAL_PERMISSIONS to 1000:1000)"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# clean up
|
||||
|
Loading…
Reference in New Issue
Block a user