#
e1b7c1c7 |
| 20-Apr-2020 |
Kyle Ambroff-Kao <kyle@ambroffkao.com> |
storage/SymLink: Fix Be API regression in ReadLink
After this patch, "UnitTester BSymLink" passes.
BSymLink::ReadLink() in BeOS would always return the length of the link unless an error occurred.
storage/SymLink: Fix Be API regression in ReadLink
After this patch, "UnitTester BSymLink" passes.
BSymLink::ReadLink() in BeOS would always return the length of the link unless an error occurred. Before this patch, Haiku instead seemed to emulate posix readlink() behavior, returning the number of bytes copied into the output buffer.
BeOS also did not guarantee that the string written into the output buffer is NULL terminated if the output buffer cannot contain the entire link contents, but the Haiku implementation does since it is is a basic safety issue.
This patch fixes this and updates the Haiku API docs to describe the behavior explicitly.
Fixing this required changing behavior in bfs_read_link, which required changes in many more places.
docs/user/storage/SymLink.dox: src/kits/storage/SymLink.cpp: * Don't return B_BUFFER_OVERFLOW if the provided buffer is not large enough to hold the link contents. * Update documentation to clearly describe behavior.
src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp: * Change bfs_read_link() to always return the link length. This is called by common_read_link in the VFS, which is called by _kern_read_link().
src/add-ons/kernel/file_systems/btrfs/kernel_interface.cpp: src/add-ons/kernel/file_systems/exfat/kernel_interface.cpp: src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp: src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp: src/add-ons/kernel/file_systems/netfs/client/netfs.cpp: src/add-ons/kernel/file_systems/nfs/nfs_add_on.c: src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp: src/add-ons/kernel/file_systems/reiserfs/Iterators.cpp: src/add-ons/kernel/file_systems/reiserfs/Iterators.h: src/add-ons/kernel/file_systems/reiserfs/Volume.cpp: src/add-ons/kernel/file_systems/reiserfs/Volume.h: * Update the implementation of read_link for these filesystems. Some of them were incorrect, and some had just copied the posix behavior of bfs from before this patch. * Use user_memcpy in ext2_read_link() * Use user_memcpy in nfs fs_read_link() * Use user_memcpy in reiserfs StreamReader::_ReadIndirectItem and StreamReader::_ReadDirectItem * Remove unused method Volume::ReadObject in reiserfs.
src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingLeafNode.cpp: src/add-ons/kernel/file_systems/packagefs/package_links/PackageLinkSymlink.cpp: * Update UnpackingLeafNode::ReadSymlink and PackageSymLink::ReadSymLink() to set the bufferSize out parameter to the symlink length. Both of these are called by packagefs_read_symlink. * Use user_memcpy
src/add-ons/kernel/file_systems/netfs/client/netfs.cpp: * netfs seems mostly unimplemented. Added a FIXME note for future implementers so that they know to implement the correct behavior.
src/system/libroot/posix/unistd/link.c: * readlinkat() was just wrapping _kern_read_link() because before this patch it had expected posix behavior. But now it does not, so we need to return the number of bytes written to the output buffer.
src/build/libroot/fs.cpp: * Update _kern_read_link() in the compatibility code to emulate the Haiku behavior on the host system. This is done by using an intermediate buffer that is guaranteed to fit the link contents and returning its length. The intermediate buffer is copied into the output buffer until there is no more room.
src/tests/kits/storage/SymLinkTest.cpp: * This patch also resolves some test failures similar to those resolved in ee8cf35f0 which fixed tests for BNode. The tests were failing because Haiku's error checking is just better.
BeOS allowed constructing a BSymLink with BSymLink(BDirectory*, const char*) with the entry name of "". The same is true of the equivilant SetTo() method. The BSymLink object will appear valid until you attempt to use it by, for example, calling the ReadLink method, which will return B_BAD_VALUE.
Haiku does a more appropriate thing and returns B_ENTRY_NOT_FOUND, for this constructor and the equivilant SetTo(BDirectory*, const char*) method. This patch fixes these test assertions to match Haiku behavior.
docs/develop/file_systems/overview.txt: * Add notes for future filesystem driver implementers to call this mistake when implementing fs_vnode_ops::read_symlink.
docs/user/drivers/fs_interface.dox: * Fix documentation for fs_vnode_ops::read_symlink
Change-Id: I8bcb8b2a0c9333059c84ace15844c32d4efeed9d Reviewed-on: https://review.haiku-os.org/c/haiku/+/2502 Reviewed-by: waddlesplash <waddlesplash@gmail.com> Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
show more ...
|
#
44c006d5 |
| 08-Jun-2019 |
Murai Takashi <tmurai01@gmail.com> |
file_systems/reiserfs: Fix -Wformat=
Change-Id: Ic011a5407ff5ecb832606541d258005217dcd6be Reviewed-on: https://review.haiku-os.org/c/1529 Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
|
#
25a7b01d |
| 05-May-2013 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Merge branch 'master' into package-management
Additional changes: * Add src/system/kernel/lib/zlib, which builds a kernel version of zlib, needed by packagefs. * BuildFeatures: Add a build feature
Merge branch 'master' into package-management
Additional changes: * Add src/system/kernel/lib/zlib, which builds a kernel version of zlib, needed by packagefs. * BuildFeatures: Add a build feature "gcc2" to allow for easier checks. * Referenceable.cpp: Include <OS.h> instead of <debugger.h>. The latter is not needed and prevents building for the build platform. * zlib/zutil.h: Fix gcc 2 build. We really should use the external package instead.
Conflicts: .gitignore build/jam/BuildSetup build/jam/FileRules build/jam/FloppyBootImage build/jam/HaikuImage build/jam/ImageRules build/jam/KernelRules build/jam/NetBootArchive build/jam/OptionalBuildFeatures build/jam/OptionalLibPackages build/jam/OptionalPackageDependencies build/jam/OptionalPackages build/scripts/build_haiku_image configure data/bin/installoptionalpackage data/system/boot/Bootscript headers/os/app/Message.h headers/os/package/PackageInfo.h headers/os/package/PackageInfoAttributes.h headers/os/package/PackageInfoSet.h headers/os/package/PackageRoster.h headers/os/package/PackageVersion.h headers/os/package/hpkg/PackageInfoAttributeValue.h headers/os/storage/FindDirectory.h headers/os/storage/Node.h headers/os/support/StringList.h headers/private/system/directories.h src/add-ons/kernel/drivers/audio/ac97/es1370/Jamfile src/add-ons/kernel/file_systems/packagefs/AttributeIndex.cpp src/add-ons/kernel/file_systems/packagefs/Jamfile src/add-ons/kernel/file_systems/packagefs/Package.cpp src/add-ons/kernel/file_systems/packagefs/Package.h src/add-ons/kernel/file_systems/packagefs/PackageDomain.cpp src/add-ons/kernel/file_systems/packagefs/PackageDomain.h src/add-ons/kernel/file_systems/packagefs/PackageFSRoot.cpp src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.cpp src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.h src/add-ons/kernel/file_systems/packagefs/PackageLinkSymlink.cpp src/add-ons/kernel/file_systems/packagefs/PackageLinkSymlink.h src/add-ons/kernel/file_systems/packagefs/PackageLinksDirectory.cpp src/add-ons/kernel/file_systems/packagefs/PackageNode.h src/add-ons/kernel/file_systems/packagefs/ResolvableFamily.cpp src/add-ons/kernel/file_systems/packagefs/Version.cpp src/add-ons/kernel/file_systems/packagefs/Version.h src/add-ons/kernel/file_systems/packagefs/Volume.cpp src/add-ons/kernel/file_systems/packagefs/Volume.h src/add-ons/kernel/file_systems/packagefs/kernel_interface.cpp src/add-ons/kernel/file_systems/userlandfs/shared/driver_settings.c src/apps/deskbar/BarApp.cpp src/apps/deskbar/BarMenuBar.cpp src/apps/deskbar/BarMenuBar.h src/apps/deskbar/BarView.cpp src/apps/deskbar/BarView.h src/apps/deskbar/BarWindow.cpp src/apps/deskbar/BarWindow.h src/apps/deskbar/DeskbarMenu.cpp src/apps/deskbar/DeskbarMenu.h src/apps/deskbar/DeskbarUtils.cpp src/apps/deskbar/DeskbarUtils.h src/apps/deskbar/ExpandoMenuBar.cpp src/apps/deskbar/ExpandoMenuBar.h src/apps/deskbar/TeamMenu.cpp src/apps/processcontroller/ProcessController.cpp src/apps/remotedesktop/RemoteDesktop.cpp src/bin/bash/config-top.h src/bin/finddir.c src/bin/package/Jamfile src/bin/package/command_add.cpp src/bin/package/command_create.cpp src/bin/package/command_list.cpp src/bin/package_repo/command_list.cpp src/bin/pkgman/command_refresh.cpp src/build/libbe/support/Jamfile src/build/libpackage/Jamfile src/build/libroot/Jamfile src/build/libroot/fs.cpp src/build/libroot/remapped_functions.h src/kits/locale/MutableLocaleRoster.cpp src/kits/opengl/GLRendererRoster.cpp src/kits/package/PackageInfo.cpp src/kits/package/PackageInfoSet.cpp src/kits/package/PackageRoster.cpp src/kits/package/PackageVersion.cpp src/kits/package/RepositoryCache.cpp src/kits/package/hpkg/PackageWriterImpl.cpp src/kits/package/hpkg/ReaderImplBase.cpp src/kits/package/hpkg/WriterImplBase.cpp src/kits/print/PrintTransport.cpp src/kits/print/Printer.cpp src/kits/screensaver/ScreenSaverRunner.cpp src/kits/support/StringList.cpp src/kits/tracker/ContainerWindow.cpp src/kits/tracker/DeskWindow.cpp src/kits/tracker/PoseView.cpp src/libs/print/libprint/Transport.cpp src/preferences/printers/AddPrinterDialog.cpp src/preferences/screensaver/ScreenSaverWindow.cpp src/servers/debug/DebugServer.cpp src/servers/input/AddOnManager.cpp src/servers/media_addon/MediaAddonServer.cpp src/system/boot/Jamfile src/system/boot/loader/Jamfile src/system/boot/loader/loader.cpp src/system/boot/loader/vfs.cpp src/system/kernel/fs/vfs.cpp src/system/kernel/fs/vfs_boot.cpp src/system/libroot/os/find_directory.cpp src/system/runtime_loader/runtime_loader.cpp src/tools/package/Jamfile
show more ...
|
#
cbabdc17 |
| 15-Dec-2012 |
François Revol <revol@free.fr> |
Merge branch 'master' into sam460ex
|
#
46cf7a5a |
| 14-Nov-2012 |
Przemysław Buczkowski <przemub@yahoo.pl> |
Fix typos: super block -> superblock (#8974)
Signed-off-by: Przemysław Buczkowski <przemub@yahoo.pl> Signed-off-by: Matt Madia <mattmadia@gmail.com>
|
#
37cfdb5d |
| 11-Apr-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Patch by Sean Bartell: * SuperBlock: In case of ReiserFS 3.6 we were stil loading only the old superblock format. * Added support for ReiserFS labels (volume names).
git-svn-id: file:///srv/svn/r
Patch by Sean Bartell: * SuperBlock: In case of ReiserFS 3.6 we were stil loading only the old superblock format. * Added support for ReiserFS labels (volume names).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36132 a95241bf-73f2-0310-859d-f6bbb57e9c96
show more ...
|
#
49004dc7 |
| 19-Feb-2009 |
Michael Lotz <mmlr@mlotz.ch> |
Remove the additional fs_vnode_ops arugment from get_vnode() again as it's not needed at all when used as intended. Thanks Ingo for the explanation on how this is intended to work. Adjusted the overl
Remove the additional fs_vnode_ops arugment from get_vnode() again as it's not needed at all when used as intended. Thanks Ingo for the explanation on how this is intended to work. Adjusted the overlay fs accordingly and updated/reverted the changes to the other filesystems.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29250 a95241bf-73f2-0310-859d-f6bbb57e9c96
show more ...
|
#
00405f22 |
| 09-Feb-2009 |
Michael Lotz <mmlr@mlotz.ch> |
* Add an additional argument to get_vnode() that gets the fs_vnode_ops of the node. That is needed for a layered filesystem to be able to construct a full fs_vnode out of a volume/inode pair. * A
* Add an additional argument to get_vnode() that gets the fs_vnode_ops of the node. That is needed for a layered filesystem to be able to construct a full fs_vnode out of a volume/inode pair. * Adapt places where get_vnode is used. Sadly this is a C API and we can't just use a default NULL for that argument. * Introduce a flag B_VNODE_WANTS_OVERLAY_SUB_NODE that can be returned in the flags field of a fs get_vnode call. A filesystem can use this flag to indicate that it doesn't support the full set of fs features (attributes, write support) and it'd like to have unsupported calls emulated by an overlay sub node. * Add a perliminary overlay filesystem that emulates file attributes using files on a filesystem where attributes aren't supported. It does currently only support reading attributes/attribute directories though. All other calls are just passed through to the super filesystem. * Adjust places where a HAS_FS_CALL() is taken as a guarantee that the operation is supported. For the overlay filesystem we may later return a B_UNSUPPORTED, so make sure that in that case proper fallback options are taken. * Make the iso9660 filesystem request overlay sub nodes. This can be fine tuned later to only trigger where there are features on a CD that need emulation at all.
If you happened to know the attribute file format and location you could build an iso with read-only attribute support now. Note that this won't be enough to get a bootable iso-only image as the query and index support is yet missing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29177 a95241bf-73f2-0310-859d-f6bbb57e9c96
show more ...
|
#
0af6c60b |
| 13-Jul-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Use the new get_default_partition_content_name() to construct a useful volume name -- ReiserFS volumes don't support names.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26404 a95241bf-73f2-0
Use the new get_default_partition_content_name() to construct a useful volume name -- ReiserFS volumes don't support names.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26404 a95241bf-73f2-0310-859d-f6bbb57e9c96
show more ...
|
#
396f6e29 |
| 01-Jul-2008 |
Stephan Aßmus <superstippi@gmx.de> |
bonefish+stippi: Implemented the needed fs API hooks to support identifying partitions (so ReiserFS partitions appear in the Tracker Mount menu now).
git-svn-id: file:///srv/svn/repos/haiku/haiku/
bonefish+stippi: Implemented the needed fs API hooks to support identifying partitions (so ReiserFS partitions appear in the Tracker Mount menu now).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26211 a95241bf-73f2-0310-859d-f6bbb57e9c96
show more ...
|
#
e8679dcd |
| 01-Jul-2008 |
Stephan Aßmus <superstippi@gmx.de> |
Merge Ingo's reiserfs changes which he accidentally commited to his branch: Adopted reiserfs add-on to the new fs API and added it to the image.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@
Merge Ingo's reiserfs changes which he accidentally commited to his branch: Adopted reiserfs add-on to the new fs API and added it to the image.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26209 a95241bf-73f2-0310-859d-f6bbb57e9c96
show more ...
|
#
245aecda |
| 21-Jun-2007 |
Axel Dörfler <axeld@pinc-software.de> |
Got rid of vnode_id and mount_id, replaced with ino_t and dev_t.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21485 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
f0bc043b |
| 11-Mar-2007 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Ported the ReiserFS code to the Haiku FS interface. Removed the built-in block cache.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20372 a95241bf-73f2-0310-859d-f6bbb57e9c96
|