Commit graph

10907 commits

Author SHA1 Message Date
Ori Bernstein
394e9c2235 libc/runeistype: accept out of range runes
out of range runes should just return 0 for whether
they're within any of the classes.
2024-10-05 00:06:50 +00:00
cinap_lenrek
4d484968bf kernel: avoid recursive lockloop() prints from screenputs() (thanks noam)
We cannot use lock() from screenputs() because lock calls
lockloop(), which would try to print() which on very slow
output (such as qemu) can cause kernel stack overflow.

It got triggered by noam with his rube-goldberg qemu setup:

lock 0xffffffff8058bbe0 loop key 0xdeaddead pc 0xffffffff80111114 held by pc 0xffffffff80111114 proc 339
 panic: kenter: -40 stack bytes left, up 0xffffffff80bdfd00 ureg 0xffffffff80bddcd8 at pc 0xffffffff80231597
 dumpstack
 ktrace /kernel/path 0xffffffff80117679 0xffffffff80bddae0 <<EOF

We might want move this locking logic outside of screenputs()
in the future. It is very similar to what iprint() does.
2024-10-03 20:25:58 +00:00
Ori Bernstein
d8973bdc75 git/export: don't try to diff dirs 2024-10-03 15:36:43 +00:00
Ori Bernstein
8e301036fa merge3: remove unnecessary variables 2024-10-02 21:45:17 +00:00
Ori Bernstein
1cf37db07a merge3: fix funny merge cases and crashes 2024-10-02 21:43:20 +00:00
Ori Bernstein
9fa2b25133 merge3: clamp aligned lines to be within the file. 2024-10-01 18:13:55 +00:00
Noam Preil
0c4e4cb9e9 git/diff: fix -c flag 2024-10-01 12:08:29 +00:00
Noam Preil
91b19a1983 aux/cddb: fix artist line splitting 2024-09-29 15:08:34 +00:00
Noam Preil
be48d656d3 mkmany: check more carefully for test folder 2024-09-17 07:45:01 +00:00
Noam Preil
8624a54632 aux/cddb: support very long artist+album name combos 2024-09-24 06:47:26 +00:00
Noam Preil
dcff4acbb6 git/commit: preserve merge-parents on failed commit 2024-09-22 20:24:16 +00:00
Jacob Moody
f3f659b54b look: fix case sensitivity when using base > 10
Old attempt at this did not make any sense.
Also fix the reference to look in ascii(1) to be more correct.
2024-09-29 18:35:30 +00:00
cinap_lenrek
dc318a6471 git/test: add noam.rc testcase 2024-09-29 17:29:48 +00:00
cinap_lenrek
798352644e git/save: and try again... 2024-09-29 17:28:48 +00:00
cinap_lenrek
0e7690a4f8 git/save: pffff. revert last change... 2024-09-29 16:47:47 +00:00
cinap_lenrek
de7d3753a5 git/save: fix the "noam" bug
git/save gets a list of paths (added or removed)
passed to it, and we have to ALWAYS stat the
file in the working directory to determine the
effective file-type.

There was a bug in the "skip children paths"
loop that would compare the next path element
instead of the full path prefix including
the next element.

reproducer:

	git/init
	touch a
	git/add a
	git/commit -m 'add a' a
	rm a
	mkdir a
	touch a/b
	git/add a/b
	git/commit -m 'switch to folder' a a/b
2024-09-29 16:30:39 +00:00
cinap_lenrek
1c682a98fe ip/ipconfig: make ra limiter less agressive (thanks cgnarne)
For handling route invalidations, we have to allow
short bursts of traffic. Therefore we keep track
of the number of ra's received in the ra interal
and only start dropping packets when reaching 100
packets.
2024-09-29 11:41:50 +00:00
cinap_lenrek
d0f4f620cf walk: qid.vers should be ignored (thanks BurnZeZ)
No idea who committed this in 2022 as its "glenda@9front.local",
but as qid.vers is incremented for each write and we definitely
should not use it as the cache tag.

Also, the initial code was stolen from du.c as the comment says,
and that one does the right thing.
2024-09-23 18:31:46 +00:00
Ori Bernstein
4374194306 git/branch: make it more robust
don't move to new branches or update the index until after
all changes are applied successfully, and the merge attempt
has been made.
2024-09-22 17:06:14 +00:00
cinap_lenrek
772f3099ef git/test: run tests with a temporary install bound to /bin/git
We want to run test before we do the installation
into the system.

So do a temporary install into test/$cputype.git/
direcotry and bind it on /bin/git, that way,
all the scripts run the local source version.
2024-09-16 22:55:40 +00:00
Ori Bernstein
e2fa84d6cd git/serve: we don't do thin packs -- advertise it. 2024-09-16 22:51:25 +00:00
Ori Bernstein
0636bfc774 git/query: process full contents of queue, even with skips
When skipping objects, we need to process the full queue,
because some of the objects in the queue may have already
been painted with keep. This can cost a small amount of time,
but should not need to advance the frontier by more than
one object, so the additional time should be proportional
to the spread of the graph.
2024-09-16 22:48:02 +00:00
Ori Bernstein
d9edee8b1a merge3: correctly handle 1-based closed intervals
the previous bug wasn't a missing clamp, but a
mishandling of the 1-based closed intervals that
we were genrating internally, and some asserts
that assumed open intervals.
2024-09-15 02:22:27 +00:00
cinap_lenrek
1a53aacc60 git/test: improve ftype test (also test dir -> file transition)
The ftype.rc test now tests both: file->dir and dir->file changes.
2024-09-14 19:21:17 +00:00
Ori Bernstein
d03b67430f merge3: fix assert in merge of identical deletions 2024-09-14 15:57:24 +00:00
Ori Bernstein
f63dcb4b9b git/branch: handle dirents changing between file and dir correctly (thanks cinap) 2024-09-13 16:28:32 +00:00
rodri
9482f887f9 jpg/tga: decode TGA32 images into RGBA32 ones 2024-09-12 19:09:40 +00:00
cinap_lenrek
ce97bb4998 merge 2024-09-09 16:54:41 +00:00
aap
79eb47ef8e acme, abaco: render scrollbar like rio 2024-09-09 13:03:15 +00:00
Ori Bernstein
36e5075ded gefs: protect fids with rwlock 2024-09-07 19:00:06 +00:00
qwx
084c9d6eba g: add .in, fix earlier fuckup (thanks mkf)
2d63bdbb44 was pushed modified
compared to the patch actually submitted by mkf, in error.
2024-09-04 19:57:16 +00:00
cinap_lenrek
87cbf8e792 sshnet(4): fix title (thanks arne) 2024-08-31 18:50:25 +00:00
mkf
2d63bdbb44 g: add cxx and hxx 2024-08-31 07:33:30 +00:00
Jacob Moody
9d2f21b2cf ndb/dns: refuse recursive requests harder when given -R (thanks be0ba)
Before we would refuse to recurse, but would still give
a response with hints back. Some nefarious clients will interpret the
lack of a Refused response code as us being an open resolver.
2024-08-31 02:23:05 +00:00
cinap_lenrek
761452154a gefs: clunk dent and mnt when dropping rclose message
When clunking a Fid while the file-system is read
only, dont just free the Amsg, but also drop the
references to dent and mnt.

Make clunkfid() nil fid->rclose, so no reuse
after free is possible.

Make clunkfid() always set the return pointer,
avoid missing prior initialization.
2024-08-30 19:54:26 +00:00
cinap_lenrek
d31382ca17 gefs: fix fidtab locking order in clunkfid()
Do not abuse fidtab lock for serializing
clunking.

The clunk should serialize on Fid.Lock
instead, so add a canlock check here.

The lock order is strictly:

Fid.Lock > Conn.fidtab[x].Lock
2024-08-30 19:16:13 +00:00
cinap_lenrek
0ab0a036ed gefs: fix use after free in putconn() 2024-08-30 18:54:43 +00:00
cinap_lenrek
15341e1116 gefs: fix Fid refcounting bugs
The AuthRpc was attached to the Fid, but this doesnt
work as it does not handle dupfid() properly.

Instead attach the AuthRpc to the directory entry,
which is refcounted.

The dupfid() function retuns the new Fid* struct with
an extra reference. If we don't use it, we have to
putfid() it.

Use ainc()/adec() consistently and dont mix it with
agetl().
2024-08-30 18:46:50 +00:00
cinap_lenrek
d8cf26110d gefs: properly close and free connections
Before, we would just leak all the "Conn"
structures.

fshangup() could cause problems as it just
forcefully closes the file descriptors,
not considering someone else going to
write them afterwards.

Instead, we add a "hangup" flag to Conn,
which readers and writers check before
attempting i/o.

And we only close the file-descriptors
when the last reader/writer drops the
connection. (Make it ref-counted).

For faster teardown, also preserve the
"ctl" file descriptor from listen()
amd use it to kill the connection quickly
when fshangup() is called.
2024-08-28 18:34:14 +00:00
cinap_lenrek
b061a21bfa kbdfs: consult also escaped scancode table when decoding runes (thanks aap)
When at the task of decomposing a rune into its
"button" and "rune", also consider the keyboard
map table with the escaped scancodes.

This fixes Shift + left/right combinations in
drawterm.
2024-08-28 18:30:28 +00:00
cinap_lenrek
09d69e04b9 libc: cleanup hangup() function (avoid duplicated literal string) 2024-08-25 19:49:09 +00:00
cinap_lenrek
f384231c60 gefs: only allow 'none' attach when previously authenticated
For each connection, remember if authentication
protocol ran successfully and only then, allow
attach as 'none' user.

This prevents anonymous remote mounts of none.

The 'none' user also shouldnt attach to the dump
file system.
2024-08-25 14:47:17 +00:00
cinap_lenrek
9645ae07eb hjfs: implement "none" attaches properly
The Tauth for "none" should always fail,
but Tattach should only succeed when
the channel ran a successfull authentication
before.

Also, prevent "none" from attaching "dump".
2024-08-24 23:47:19 +00:00
cinap_lenrek
a97ee572b9 lib9p: add "authok" flag to Srv struct
We want to implement "none" attaches for hjfs,
but only if the 9p-"channel" ran a successfull
authentication before, to prevent anonymous
remote mounts as "none".

Add a flag to the Srv struct for this.
2024-08-24 23:45:51 +00:00
Jacob Moody
07aa9bfeef lib9p: verify uname against returned AuthInfo from factotum (thanks humm)
Before this it was possible to Tauth and Tattach with one
user name and then authenticate with factotum using a different
user name. To fix this we now ensure that the uname matches the returned
cuid from AuthInfo.

This security bug is still pending a cute mascot and theme song.
2024-08-24 16:58:31 +00:00
rodri
b05c74e7cb geometry(2): correct typo (thanks ndeuteron!) 2024-08-23 10:14:50 +00:00
Ori Bernstein
3d497649e7 gefs: use correct snap name with autosnaps
*shame*
2024-08-20 04:27:40 +00:00
rodri
7059938e94 libgeometry: add lineXsphere function 2024-08-19 21:30:14 +00:00
Ori Bernstein
a584d29458 tmdate(2): fix formatting for sub-second specifiers 2024-08-10 10:04:22 +00:00
qwx
6dc60ec3a9 qcowfs: add 9p debug flag 2024-08-05 22:23:51 +00:00