summaryrefslogtreecommitdiff
path: root/Servers/LookupServer
AgeCommit message (Collapse)Author
2020-03-14LibCore: Rename Udp classes to UDPShannon Booth
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 :)
2020-03-06AK: Remove Optional::operator bool()Andreas Kling
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().
2020-02-15LibCore: Replace manual forward declarations with <LibCore/Forward.h>Andreas Kling
2020-02-14LibCore: Add a forward declaration headerAndreas Kling
This patch adds <LibCore/Forward.h> and uses it in various places to shrink the header dependency graph.
2020-02-14AK: Add a forward declaration headerAndreas Kling
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.
2020-02-06LibCore: Remove leading C from filenamesAndreas Kling
2020-02-02LibCore: Put all classes in the Core namespace and remove the leading CAndreas Kling
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.
2020-01-26LookupServer: Don't cache already-expired DNS answersAndreas Kling
2020-01-26LookupServer: Cache DNS answers for TTL secondsAndreas Kling
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.
2020-01-26LookupServer: Rename "custom_hosts" => "etc_hosts"Andreas Kling
This makes it more obvious that these mappings come from /etc/hosts.
2020-01-26LookupServer: Rename setting "DNS/IPAddress" => "DNS/Nameserver"Andreas Kling
2020-01-26LookupServer: Use CUdpSocket instead of the POSIX APIAndreas Kling
LibCore's UDP socket is a bit more comfortable to work with. :^)
2020-01-26LookupServer: Add missing copyright headersAndreas Kling
2020-01-26LookupServer: Retry with 0x20 randomization turned off on EREFUSEDAndreas Kling
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.
2020-01-26LookupServer: Verify that DNS response questions match the requestAndreas Kling
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.
2020-01-26LookupServer: Randomize the 0x20 bit in DNS request ASCII charactersAndreas Kling
This adds a bit of extra entropy to DNS requests, making it harder to spoof a valid response. Suggested by @zecke in #10.
2020-01-26LookupServer: Randomize DNS request ID'sAndreas Kling
Suggested by @zecke in #10.
2020-01-26LookupServer: Minor overhaulAndreas Kling
- 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.
2020-01-22LookupServer: Lock unveil() after initialization.Brian Gianforcaro
Once LookupServer is initialized it should never need access to any any paths for the lifetime of the process. Lock the veil post initialization.
2020-01-18Meta: Add license header to source filesAndreas Kling
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.
2020-01-17Kernel: Add "accept" pledge promise for accepting incoming connectionsAndreas Kling
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.
2020-01-13LookupServer: Use pledge()Brian Gianforcaro
2019-12-25Build: support library and generator dependenciesjoshua stein
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.
2019-12-20Build: clean up build system, use one shared Makefilejoshua stein
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.
2019-11-26LookupServer: Port to socket takeoverSergey Bugaev
2019-11-26LookupServer: Port to LibCoreSergey Bugaev
2019-10-16LookupServer: Remove debug spam about /etc/hostsAndreas Kling
2019-10-16LookupServer: Cache successful DNS lookup responses for 1 minuteAndreas Kling
This reduces DNS traffic spam during web browsing. We can definitely do a lot better here, this is just a very low-hanging fruit.
2019-09-30ByteBuffer: Remove pointer() in favor of data()Andreas Kling
We had two ways to get the data inside a ByteBuffer. That was silly.
2019-09-21LibCore: Convert CFile to ObjectPtrAndreas Kling
2019-09-06AK: Rename <AK/AKString.h> to <AK/String.h>Andreas Kling
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. :^)
2019-07-24AK: Make HashMap::get(Key) return an Optional<Value>.Andreas Kling
This allows HashMap::get() to be used for value types that cannot be default constructed (e.g NonnullOwnPtr.)
2019-07-21Userspace: Deal with select() returning EINTR on a signal interruptionRobin Burchell
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.
2019-07-03AK: Rename the common integer typedefs to make it obvious what they are.Andreas Kling
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
2019-06-30Meta: Removed all gitignore in the source tree only keeping the root oneVAN BOSSUYT Nicolas
2019-06-20LookupServer: Use a CFile for loading /etc/hosts.Andreas Kling
This fixes an issue with the lines having extra bytes at the end due after converting from ByteBuffer to String.
2019-06-07LookupServer: use /etc/hosts even for reverse lookupsChristopher Dumas
2019-06-07LookupServer: Load hostnamesChristopher Dumas
2019-06-07LookupServer: Clang-FormatChristopher Dumas
2019-06-06LookupServer+LibC: Add support for reverse DNS lookups via gethostbyaddr().Andreas Kling
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. :^)
2019-06-02AK: Add implicit String -> StringView conversionRobin Burchell
And tidy up existing view() users.
2019-05-28Add clang-format fileRobin Burchell
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.
2019-05-28LibC: Move struct timeval to sys/time.h. #POSIXAndreas Kling
2019-05-27can now tile background and made sure the IRC choose server popup still worksChristopher Dumas
2019-05-27Network stack is now configurable, and resolution is also configurable, but ↵Christopher Dumas
loading cursors causes a page-fault?
2019-05-13Fix "make clean" not deleting app binaries.Andreas Kling
2019-04-21Include Makefile.common in all other Makefiles.Andreas Kling
2019-04-20AK: Add String::copy(BufferType) helper.Andreas Kling
This will create a String from any BufferType that has data() and size().
2019-04-20Get rid of SERENITY macro since the compiler already defines __serenity__Andreas Kling
This makes it a bit easier to use AK templates out-of-tree.
2019-04-02LookupServer: Only interpret A records as 32-bit IPv4 addresses.Andreas Kling
This fixes a bug where CNAME records would be interpreted as if they were IP addresses, causing much confusion.