mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-14 00:14:07 +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;
|
return -EIO;
|
||||||
}
|
}
|
||||||
StatCache::getStatCacheData()->DelStat(nowcache);
|
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);
|
S3FS_MALLOCTRIM(0);
|
||||||
|
|
||||||
|
@ -207,9 +207,14 @@ function test_chown {
|
|||||||
# if they're the same, we have a problem.
|
# if they're the same, we have a problem.
|
||||||
if [ $(stat --format=%u:%g $TEST_TEXT_FILE) == $ORIGINAL_PERMISSIONS ]
|
if [ $(stat --format=%u:%g $TEST_TEXT_FILE) == $ORIGINAL_PERMISSIONS ]
|
||||||
then
|
then
|
||||||
echo "Could not modify $TEST_TEXT_FILE ownership"
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
rm_test_file
|
rm_test_file
|
||||||
|
Loading…
Reference in New Issue
Block a user