* When releasing a vnode, it tried to trim down the allocation even if the file
system was mounted read-only. * bfs_rename() did not check the access privileges of the directories involved. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18718 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
793f542244
commit
03a2985277
|
@ -303,7 +303,7 @@ bfs_release_vnode(void *_ns, void *_node, bool reenter)
|
||||||
|
|
||||||
// since a directory's size can be changed without having it opened,
|
// since a directory's size can be changed without having it opened,
|
||||||
// we need to take care about their preallocated blocks here
|
// we need to take care about their preallocated blocks here
|
||||||
if (inode->NeedsTrimming()) {
|
if (!volume->IsReadOnly() && inode->NeedsTrimming()) {
|
||||||
Transaction transaction(volume, inode->BlockNumber());
|
Transaction transaction(volume, inode->BlockNumber());
|
||||||
|
|
||||||
if (inode->TrimPreallocation(transaction) == B_OK)
|
if (inode->TrimPreallocation(transaction) == B_OK)
|
||||||
|
@ -932,11 +932,18 @@ bfs_rename(void *_ns, void *_oldDir, const char *oldName, void *_newDir, const c
|
||||||
if (oldDirectory == newDirectory && !strcmp(oldName, newName))
|
if (oldDirectory == newDirectory && !strcmp(oldName, newName))
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
|
// are we allowed to do what we've been told?
|
||||||
|
status_t status = oldDirectory->CheckPermissions(W_OK);
|
||||||
|
if (status == B_OK)
|
||||||
|
status = newDirectory->CheckPermissions(W_OK);
|
||||||
|
if (status < B_OK)
|
||||||
|
return status;
|
||||||
|
|
||||||
RecursiveLocker locker(volume->Lock());
|
RecursiveLocker locker(volume->Lock());
|
||||||
|
|
||||||
// get the directory's tree, and a pointer to the inode which should be changed
|
// get the directory's tree, and a pointer to the inode which should be changed
|
||||||
BPlusTree *tree;
|
BPlusTree *tree;
|
||||||
status_t status = oldDirectory->GetTree(&tree);
|
status = oldDirectory->GetTree(&tree);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
RETURN_ERROR(status);
|
RETURN_ERROR(status);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue