Commit graph

19652 commits

Author SHA1 Message Date
Andreas Kling
a7fb50567b TextEditor: Make sure to mark the Window as unmodified after saving
This comes with a FIXME, as it would be nicer if this information
would propagate from TextDocument all the way out somehow.
2021-05-01 19:42:29 +02:00
Andreas Kling
f0cc712246 TextEditor: Use an automatic "modified" marker in the window title
This simplifies the application somewhat as we no longer need to
manually update the window title whenever the text document changes.
2021-05-01 19:42:29 +02:00
Andreas Kling
20dd5735ce WindowServer+LibGfx: Automatic "modified" markers in window titles
You can now add the string "[*]" to a window title and it will be
replaced with " (*)" if the window is modified, and with "" otherwise.
2021-05-01 19:42:29 +02:00
Andreas Kling
e9c40b0243 TextEditor: Plumb modified state from GUI::TextDocument to GUI::Window
Instead of tracking this stuff ourselves at the application level,
we now just act as an intermediary and pass along the information to
the windowing system.
2021-05-01 19:42:29 +02:00
Andreas Kling
5b68a76c77 LibGUI: Track modified state in GUI::TextDocument
Until now, this has been hackishly tracked by the TextEditor app's
main widget. Let's do it in GUI::TextDocument instead, so that anyone
who uses this class can know whether it's modified or not.
2021-05-01 19:42:29 +02:00
Andreas Kling
443775754f TextEditor: Add some missing curly braces around a nested if statement 2021-05-01 19:42:29 +02:00
Andreas Kling
e5ceabfbbb TextEditor: Remove some unnecessary #include statements 2021-05-01 19:42:29 +02:00
Andreas Kling
b424e6c86f TextEditor: Rename TextEditorWidget => TextEditor::MainWidget 2021-05-01 19:42:29 +02:00
Andreas Kling
2fa765bbd5 LibGUI: Add getter/setter for GUI::Window modified state
This state lives in WindowServer and has no local copy in the client
process for now. This may turn out to be a performance issue, and if
it does we can easily cache it.
2021-05-01 19:42:29 +02:00
Andreas Kling
492464f4c1 WindowServer: Add Window "modified" state
This will be used to track which windows contain some kind of unsaved
data that the user may want some help remembering to save. :^)
2021-05-01 19:42:29 +02:00
Idan Horowitz
5c385d06e8 Lagom/Fuzzers: Add fuzzers for Windows-1251 and Windows-1255 decoders 2021-05-01 17:59:08 +02:00
Idan Horowitz
87cabda80d LibTextCodec: Implement a Windows-1251 decoder
This encoding (a superset of ascii that adds in the cyrillic alphabet)
is currently the third most used encoding on the web, and because
cyrillic glyphs were added by Dmitrii Trifonov recently, we can now
support it as well :^)
2021-05-01 17:59:08 +02:00
Andreas Kling
4b0098e52f Everywhere: Rename app_menu to file_menu or game_menu 2021-05-01 17:40:54 +02:00
Gal Horowitz
b119fa5a0a Base: Add bold Hebrew character glyphs to the Katica Bold 10 font
The glyph for the letter `Shin` (U+05E9) looks a bit wonky because the
width of the font is too small. Unfortunately it doesn't look like the
FontEditor is capable of changing the width of an existing font, so if
that option will be added in the future this glyph can be fixed.
2021-05-01 17:25:43 +02:00
Ali Mohammad Pur
70728b49e2 Shell: Move the heredocs vector to a local value before processing it
Otherwise we would end up trying to parse the same heredoc entry, if it
contained a sequence terminated by a newline.
e.g. `<<-x\n$({` would attempt to read a heredoc entry after `x`, and
then after `{` while inside the first heredoc entry.
To make this work, we can simply empty the instance vector and keep the
state on the stack.
Issue found through oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33852
2021-05-01 15:58:31 +02:00
Ali Mohammad Pur
323a408d8c Shell: Make set_is_syntax_error() also copy the error location 2021-05-01 15:58:31 +02:00
Ali Mohammad Pur
f1d49d391e Shell: Disallow non-bareword nodes as part of a heredoc key
Found by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33854
2021-05-01 15:58:31 +02:00
Gunnar Beutner
f18895c0d6 LibCore: Fix building the library on macOS 2021-05-01 15:56:16 +02:00
Mango0x45
1635942951 Man: Add a manpage for rev(1) 2021-05-01 14:15:30 +02:00
Mango0x45
10fc9231d5 Userland: Add the rev(1) utility to reverse lines 2021-05-01 14:15:30 +02:00
Mango0x45
ec0abec9ee Userland: Remove an unused function declaration from tac.
The function declaration seems to have come from an earlier commit. The
function is no longer here so there is no reason to keep this around.
2021-05-01 14:15:23 +02:00
Olivier De Cannière
56fc949646 HackStudio: Detection of externally deleted files
HackStudio can now detect that files that have been opened in it were
deleted. When this occurs, it will update the list of open files and
reasign a file to the editors that showed the deleted file before the
deletion. The new file is either another file that was opened or the
default editor is no other open file is available

Closes SerenityOS#6632
2021-05-01 13:39:43 +02:00
Gunnar Beutner
a6201f708e Ports: Generate host keys for OpenSSH 2021-05-01 12:40:12 +02:00
Gunnar Beutner
e69b729733 Ports: Use sendfd()/recvfd() for mm_send_fd()/mm_receive_fd() 2021-05-01 12:40:12 +02:00
Gunnar Beutner
17e5ba70b1 LibC: Make sure that parse_pwddb_entry doesn't write to stderr
Library functions shouldn't write to stdout/stderr as that might not
be expected by the caller.
2021-05-01 12:40:12 +02:00
Gunnar Beutner
302f9798ee LibC: Implement support for getspnam() and friends 2021-05-01 12:40:12 +02:00
Gunnar Beutner
ce77caf479 LibC: Move crypt() and crypt_r() to the right header file
According to POSIX.1 these should be in <crypt.h>.
2021-05-01 12:40:12 +02:00
Brian Gianforcaro
f05086a5d2 Kernel: Harden Ext2FileSystem Vector usage against OOM. 2021-05-01 09:10:30 +02:00
Brian Gianforcaro
2ee1731966 Kernel: Harden Process Vector usage against OOM. 2021-05-01 09:10:30 +02:00
Brian Gianforcaro
ee84b8a845 Kernel: Harden DevFS Vector usage against OOM.
The dance here is not complicated, but it is something that should
be taken note of. Since we append to both lists, we don't want to
orphan the new Inode in the m_links/m_subfolders Vector in the event
that the append to m_parent_fs.m_nodes fails.
2021-05-01 09:10:30 +02:00
Brian Gianforcaro
a678851b41 Kernel: Harden sys$setgroups Vector usage against OOM 2021-05-01 09:10:30 +02:00
Brian Gianforcaro
f0568bff9b Kernel: Harden Socket Vector usage against OOM 2021-05-01 09:10:30 +02:00
Brian Gianforcaro
e8d6d478c4 Kernel: Harden LocalSocket Vector usage against OOM. 2021-05-01 09:10:30 +02:00
Gunnar Beutner
a9f488c55b LibC: Make EWOULDBLOCK an alias for EAGAIN
According to POSIX.1 all error codes have to be distinct - with
the exception for EAGAIN and EWOULDBLOCK. Other libcs including
eglibc and newlib define EWOULDBLOCK as an alias for EAGAIN and
some software including OpenTTD expect this behavior.
2021-05-01 09:02:57 +02:00
Gunnar Beutner
03f4c48de1 Ports: Disable GetPerformanceTimer() for OpenTTD
OpenTTD calls gettimeofday() so many times per second that the
game becomes unusable after joining a reasonably active network
game.
2021-05-01 09:02:57 +02:00
Hendiadyoin1
f6aad70541 LibX86+UserspaceEmulator: Add MMX insns prototypes 2021-05-01 08:56:52 +02:00
Brian Gianforcaro
38fe67abb4 Base: Add a man page for the 'bt' command. 2021-05-01 08:44:33 +02:00
Brian Gianforcaro
ca213ab374 bt: Enumerate all threads when symbolizing stacks in the bt utility.
Enumerate tid's from /proc/{pid}/stacks/ and use it to print the
backtrace for all active threads in the specified process.
2021-05-01 08:44:33 +02:00
Brian Gianforcaro
f1c98dc5ea bt: Fix generation of click-able links for source files.
When the default build location was moved from /Build to the new
architecture specific directory, /Build/i686, this code broke.
All file names are now path relative one additional level up.

So continue the hack, and introduce another dummy directory to
make the relative paths resolve correctly.
2021-05-01 08:44:33 +02:00
Carlos César Neves Enumo
69e2431c64 Lagom/CMake: Add -fconstexpr-steps for AppleClang 2021-05-01 07:38:43 +02:00
Tobias Christiansen
22d6fbeb12 LibWeb: Use new way of generating list-style-type: *-alpha
Removed the local conversion from number to alphabet and used the one
offered in AK/String instead.
2021-05-01 01:19:40 +02:00
Tobias Christiansen
ef8f97635e Spreadsheet: Use String::bijective_base_from for column name resolution
Updated Spreadsheet to use the new way of converting a number to a
String represenation using the alphabet.
The code responsible for this conversion now lives in AK/String, so it
gets deleted from Spreadsheet.cpp.
2021-05-01 01:19:40 +02:00
Tobias Christiansen
4016e04061 AK: Move bijective-base-conversion into AK/String
This allows everybody to create a String version of their number
in a arbitrary bijective base. Bijective base meaning that the mapping
doesn't have a 0. In the usual mapping to the alphabet the follower
after 'Z' is 'AA'.
The mapping using the (uppercase) alphabet is used as a standard but
can be overridden specifying 'base' and 'map'.

The code was directly yanked from the Spreadsheet.
2021-05-01 01:19:40 +02:00
inalone
4dbf40399b Demos: Added Alt+F4 funtionality to demos that lacked it
The Fire, LibGfxDemo and LibGfxScaleDemo demos did not have Alt+F4
functionality as they lacked menubars - I just added basic menubars with
Quit entries to allow this shortcut with the demos that didn't have it.
2021-05-01 01:11:35 +02:00
Andreas Kling
51f88cb00d Kernel/IPv4: Unbreak raw socket (port allocation failing is OK)
Raw sockets don't need a local port, so we shouldn't fail operations
if allocation yields an ENOPROTOOPT.

I'm not in love with the factoring here, just patching up the bug.
2021-05-01 00:03:33 +02:00
Valtteri Koskivuori
8fac7a1d5d
LibGUI: Bump up common locations width from 90 to 95
The Documents directory shows up properly now when selected.
Previously the bold text would not fit horizontally, causing an
ellipsis at the end.
2021-04-30 23:27:29 +02:00
Gunnar Beutner
e0ac611a08 Kernel: Tear down connections when we receive an RST packet 2021-04-30 23:11:56 +02:00
Gunnar Beutner
c03cbf83ab Kernel: Record MAC addresses for incoming IPv4 packets
This way we don't have to do ARP just to send packets back to
an address which just sent us a packet.
2021-04-30 23:11:56 +02:00
Gunnar Beutner
fb2ad94195 Kernel: Remove socket from the listener's accept list when it is closed
Without this patch we end up with sockets in the listener's accept
queue with state 'closed' when doing stealth SYN scans:

Client -> Server: SYN for port 22
Server -> Client: SYN/ACK
Client -> Server: RST (i.e. don't complete the TCP handshake)
2021-04-30 23:11:56 +02:00
Gunnar Beutner
866e577f1d Kernel: Don't put closed/listener sockets into the closing_sockets list 2021-04-30 23:11:56 +02:00