If we change our current directory, it will be retained as a reference
down inside the VFS, preventing filesystems from being unmounted,
among other things.
Fixes#19684.
It seems this is still too early and not enough fields in the VMArea
have been initialized. Instead just check the protection manually.
Also fix some more locking behavior in the error path.
Just the library name in parentheses doesn't look so great in the book
index (in particular for libroot in the "special topics" list). So include
a short description there.
Change-Id: I99ea8f85b042c5606b078aca906a0717aff6d46f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9452
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
The RTLD_GROUP flag to dlopen comes from Solaris. It makes the symbol
resolution for dlopen not use the global symbols from the current team
(anything that's already loaded). The loaded object must be explicitly
linked against any symbol it needs to use (or it can use dlsym to search
symbols in the global scope explicitly).
This is also how symbol resolution worked in BeOS, meaning we already
have the code to do this, and just need to enable it.
This can be used in dosemu, where DOS-like executable are linked against
their own C library and should not use symbols from libroot.
Fixes#19674.
Change-Id: I8d127c7812a31e231edb1e44edf70b868c2670e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9450
Reviewed-by: waddlesplash <[email protected]>
* When resetting the file cache, use file_cache_disable() to remove
all pages, instead of calling file_cache_delete().
* Possible fix for #19656.
file_cache_delete doesn't actually delete the VMCache object, so when
file_cache_create() is called the returned file_cache_ref just points
to the same VMCache as before.
Change-Id: Ifba42b51c52f11980fd97212d0c3bdfdc1e55085
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9448
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* Split the "is only cache user" logic from cut_area into
a helper routine.
* If we can't modify a cache in cut_area, then we can't modify
its commitment either, so add that to the check.
* If we didn't split the areas, then modifying the commitments
doesn't make sense and will cause problems, so move that logic
into the "modify cache" branch.
* Use the new helper routine in set_memory_protection rather than
checking only cache->temporary.
Combined with the previous commit, seems to fix#19624.
Like check_access_permissions() but for write_stat() hook instead
of access().
Basic logic copied from BFS, but with the UID/GID logic rewritten
to better conform to behavior on other OSes: notably, we allow
chown() requests that keep the UID the same to go through, same
as Linux seems to, which should fix#19666. We now also validate
that the GID is one of the current team's groups.
* When the DirectoryCache is updated, compare the new contents with
the old. If any of the old entries are obsolete, treat the
respective node as stale.
* Create FileSystem::TrashStaleNode() to avoid duplicating code.
* Possible fix for #19656.
This helps the client keep current with changes made to server files
by other users.
While the comparison will be slow for a large directory, it won't be
executed unless another user has changed the contents of a directory
since the last time the Haiku client read the directory.
Change-Id: I03e65aaaad5027c66b10265f2b4a21ed9d2b6744
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9445
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
We need to change all groups, not just the primary group.
Otherwise, other groups will be left intact, which may
include groups the new user doesn't have permissions for.
This way, we can't inadvertently end up in a state where the
window is deleted but some things are still attached to it.
Fixes#19662.
Change-Id: I3ce7b5ccffc8cf12670209f3023613b32e31c41c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9437
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: John Scipione <[email protected]>
That is, just add the supertype if it does not exist. Leave getting it
to the callers that need it.
Fixes: #19653
Change-Id: I79d804161d28684e16a0d84ec3a2fb6788c0b506
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9436
Reviewed-by: waddlesplash <[email protected]>
x86_64 already does this and it seems to work fine. Since stack areas
grow downwards and should always have a guard page, overruns shouldn't
be too much of a concern (for that matter, randomization still makes
a difference here also, it seems.)
This allows us to regain another ~256 MB or so of contiguous address
space (areas smaller than that could still be inserted in the 0x6.. to
0x7.. block, but if you had 10MB of free address space below 0x6..,
and 246MB above it, you couldn't allocate a 256MB block.)
Part of #19592.
We ideally want to avoid further fragmentation and just insert in the
smallest possible slot in that case.
Part of #19592. With DISABLE_ASLR=1, seems to save about 120 MB or so
of address space, which is a lot on 32-bit.
This doesn't matter so much because the hint's used for
an AVL tree lookup both for next and previous, but it
probably does at least a bit because the new area's size
is used in the tree lookups.
The kernel will ignore the reservations if there's not enough space
left in the address space anyway.
It seems using larger reservations prevents address space fragmentation,
and so this by itself may be enough to fix#19592.
128 MB should be more than enough memory in the global cache
for most applications (this limit's hit once the application
has 512 MB of live allocations, based on the current free
percentage of 25%.)
Otherwise we might get lock-order inversion in the VFS (see comment in
VMCache::RemoveArea) and deadlock the system, which indeed I observed
while testing some things today.
If the resize-needed amount changed while we were allocating memory,
then we'd leak the new buffer.
In testing, I added an ASSERT() to check if this case actually happened,
and it didn't seem to fire when using the system (with a debug kernel
though, admittedly.)
Inspired by a change suggested on GitHub, but implemented in a
completely different way (that cleans up the code at the same time.)
Remove shared message handling from ColorListView,
you are expected to implement this yourself and these
message constants were not actually being used by
the message target.
Do color drop handling in Appearance and Terminal.
Handle all color drops in WasDropped().
Allow current selection to remain, only update color.
TODO Changing selection on external drops should be
fixed in BListView. Work-around in BColorListView.
Fixes#19562
Change-Id: Ic99bbb1288fd736778eac831d38e453122815abc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9296
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Adjust tray icons and clock to fit accordingly. Leaf menu height is
reduced by 1 in vertical mode to match.
This makes the overlap of maximized windows and Deskbar less noticeable,
especially in horizontal mini-mode.
Fixes#16231
Change-Id: I622d008ee093e018ebcb46e3c45647577f46184f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8833
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
To allow consumers to cause the "don't fragment" bit to be set in
all IPv4 packet headers.
There is no standard way of doing this, and different OSes expose
this option in different ways. Linux has "IP_MTU_DISCOVER", but it
takes an enum, not a boolean. NetBSD and OpenBSD appear to have
no socket option, instead they have "IP_MTUDISC", an option for
the "ip_output()" kernel-level network stack method.
"IP_DONTFRAG" sockopt originates on FreeBSD, and it seems macOS now
also supports it in version 11+. Windows has "IP_DONTFRAGMENT",
which, at a glance, appears to do the same thing. So this looks
like the one that makes the most sense to adopt.
This doesn't add any code to process MTU changes yet, though.
Change-Id: I492d22dbd0ee5f4ab35c600396ad3d3ec9f4f200
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9401
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Using the new net_error_data parameter to error_received.
Move the "update routing table" TODO into the IPv4 module,
since the ICMP module doesn't deal with the routing table
at all, while the IPv4 module already does.
Also add a missing endian swap in ICMP error_reply.
Change-Id: I1135eaa442f515d656143c76ab130be19cdcbaf2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9400
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Same structure as used for error_reply, to contain information
(like path MTU or redirect gateway) from the original error packet,
so that upper layers don't have to re-parse it.
Nothing uses or passes it around at present, but it will be used
in the next commits.
Change-Id: I38a3dec5506bdcb77a7850294082db7be74dd80f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9399
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>