Age | Commit message (Collapse) | Author |
|
The kernel was already using the UDP prefix, and the TCP LibCore classes
are also uppercased. Let's rename for consistency.
Also order the LibCore Makefile alphabetically, because everywhere else
seems to be doing that :)
|
|
This was causing some obvious-in-hindsight but hard to spot bugs where
we'd implicitly convert the bool to an integer type and carry on with
the number 1 instead of the actual value().
|
|
|
|
This patch adds <LibCore/Forward.h> and uses it in various places to
shrink the header dependency graph.
|
|
You can now #include <AK/Forward.h> to get most of the AK types as
forward declarations.
Header dependency explosion is one of the main contributors to compile
times at the moment, so this is a step towards smaller include graphs.
|
|
|
|
I've been wanting to do this for a long time. It's time we start being
consistent about how this stuff works.
The new convention is:
- "LibFoo" is a userspace library that provides the "Foo" namespace.
That's it :^) This was pretty tedious to convert and I didn't even
start on LibGUI yet. But it's coming up next.
|
|
|
|
We now keep DNS answers around in a cache for TTL seconds after getting
them the first time. The cache is capped at 256 responses for now.
Suggested by @zecke in #10.
|
|
This makes it more obvious that these mappings come from /etc/hosts.
|
|
|
|
LibCore's UDP socket is a bit more comfortable to work with. :^)
|
|
|
|
Apparently some authoritative servers don't handle 0x20 randomization
well and may send EREFUSED. Retry with randomization turned off then.
Reference: https://github.com/dns-violations/dns-violations/blob/master/2017/DVE-2017-0006.md
More work towards #10.
|
|
To protect against DNS spoof attacks, we now check that the questions
in incoming responses match the questions in the request we sent out.
Suggested by @zecke in #10.
|
|
This adds a bit of extra entropy to DNS requests, making it harder to
spoof a valid response.
Suggested by @zecke in #10.
|
|
Suggested by @zecke in #10.
|
|
- Break out request building into a DNSRequest class.
- Break out response parsing into a DNSResponse class.
A DNSRequest contains one or more DNSQuestion objects.
A DNSResponse contains all the DNSQuestions asked, and a DNSAnswer
object for each answer.
|
|
Once LookupServer is initialized it should never need
access to any any paths for the lifetime of the process.
Lock the veil post initialization.
|
|
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.
For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.
Going forward, all new source files should include a license header.
|
|
This patch adds a new "accept" promise that allows you to call accept()
on an already listening socket. This lets programs set up a socket for
for listening and then dropping "inet" and/or "unix" so that only
incoming (and existing) connections are allowed from that point on.
No new outgoing connections or listening server sockets can be created.
In addition to accept() it also allows getsockopt() with SOL_SOCKET
and SO_PEERCRED, which is used to find the PID/UID/GID of the socket
peer. This is used by our IPC library when creating shared buffers that
should only be accessible to a specific peer process.
This allows us to drop "unix" in WindowServer and LookupServer. :^)
It also makes the debugging/introspection RPC sockets in CEventLoop
based programs work again.
|
|
|
|
Instead of directly manipulating LDFLAGS, set LIB_DEPS in each
subdirectory Makefile listing the libraries needed for
building/linking such as "LIB_DEPS = Core GUI Draw IPC Core".
This adds each library as an -L and -l argument in LDFLAGS, but
also adds the library.a file as a link dependency on the current
$(PROGRAM). This causes the given library to be (re)built before
linking the current $(PROGRAM), but will also re-link any binaries
depending on that library when it is modified, when running make
from the root directory.
Also turn generator tools like IPCCompiler into dependencies on the
files they generate, so they are built on-demand when a particular
directory needs them.
This all allows the root Makefile to just list directories and not
care about the order, as all of the dependency tracking will figure
it out.
|
|
Allow everything to be built from the top level directory with just
'make', cleaned with 'make clean', and installed with 'make
install'. Also support these in any particular subdirectory.
Specifying 'make VERBOSE=1' will print each ld/g++/etc. command as
it runs.
Kernel and early host tools (IPCCompiler, etc.) are built as
object.host.o so that they don't conflict with other things built
with the cross-compiler.
|
|
|
|
|
|
|
|
This reduces DNS traffic spam during web browsing. We can definitely do
a lot better here, this is just a very low-hanging fruit.
|
|
We had two ways to get the data inside a ByteBuffer. That was silly.
|
|
|
|
This was a workaround to be able to build on case-insensitive file
systems where it might get confused about <string.h> vs <String.h>.
Let's just not support building that way, so String.h can have an
objectively nicer name. :^)
|
|
This allows HashMap::get() to be used for value types that cannot be default
constructed (e.g NonnullOwnPtr.)
|
|
Add a trivial CSafeSyscall template that calls a callback until it stops
returning EINTR, and use it everywhere we use select() now.
Thanks to Andreas for the suggestion of using a template parameter for
the syscall function to invoke.
|
|
These types can be picked up by including <AK/Types.h>:
* u8, u16, u32, u64 (unsigned)
* i8, i16, i32, i64 (signed)
|
|
|
|
This fixes an issue with the lines having extra bytes at the end due after
converting from ByteBuffer to String.
|
|
|
|
|
|
|
|
LookupServer can now take two types of requests:
* L: Lookup
* R: Reverse lookup
The /bin/host program now does a reverse lookup if the input string is a
valid IPv4 address. :^)
|
|
And tidy up existing view() users.
|
|
Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
|
|
|
|
|
|
loading cursors causes a page-fault?
|
|
|
|
|
|
This will create a String from any BufferType that has data() and size().
|
|
This makes it a bit easier to use AK templates out-of-tree.
|
|
This fixes a bug where CNAME records would be interpreted as if they were
IP addresses, causing much confusion.
|