summaryrefslogtreecommitdiff
path: root/sys/src
AgeCommit message (Collapse)Author
2022-11-01lib9p: fix missing newlines in fprint()cinap_lenrek
2022-10-30rc: make `flag f [+-]` clear status on successMichael Forney
Otherwise, the old status will be retained, which may be non-empty if it follows an if command whose branch wasn't taken. This is problematic for scripts using -e.
2022-10-31lib9p: double the buffer for /srv/$servicecinap_lenrek
Use a buffer bigger than the name limit of devsrv (127 characters), as this will produce the correct error message when trying to create the srv file instead of silently truncating the buffer before.
2022-10-31reform: only override console=0 when no plan9.ini is passedcinap_lenrek
The kernel used to always set console=0, which as usefull during bring-up, but makes it impossible to use the uart for other purposes. We now have the ability to pass plan9.ini using the u-boot script, so add the console=0 line there. To make debugging easy, we still apply console=0 if no plan9.ini has been passed.
2022-10-31ape: fix warning building mkstempOri Bernstein
mkstemp uses mktemp, which is only declared when including files with _BSD_SOURCE, so define _BSD_SOURCE before including the headers
2022-10-31zuke: don't fall into the ratholeOri Bernstein
2022-10-31libflac: work around kencc running out of registers on armOri Bernstein
2022-10-04vt: fix home/end sequences in xterm modeMichael Forney
According to the ncurses terminfo database, we have $ for k in khome kend; do printf '%s:\t' "$k"; TERM=xterm tput $k | od -An -tc; done khome: 033 O H kend: 033 O F $ This differs from vt220fk, so add a new xtermfk table with the proper sequences.
2022-10-30patch: improve hunk searchMichael Forney
Keep track of last hunk offset so we are more likely to find future hunks. Start search within the range of lines where we could possibly find the hunk. This fixes a bug where if the file shrunk since the patch was generated, and we start the search past the end of the file and immediately abort the search. Add an extra offset for the end of the file to the lines array so that lines[nlines] is the length of the file. This way, when we start the search at line nlines-oldcnt, we don't access past the end of the array if oldcnt==0. When we find a hunk, set lastln to ln + h->oldcnt; we can't apply another hunk that starts before the previous hunk ends.
2022-10-30upas/fs: support date format used in RFC 4155 mbox filesMichael Forney
The RFC says that the message separator line consists of > a timestamp indicating the UTC date and time when the message > was originally received, conformant with the syntax of the > traditional UNIX 'ctime' output sans timezone (note that the > use of UTC precludes the need for a timezone indicator); It also references http://qmail.org/man/man5/mbox.html as an authoritative source, which says the date "always contains exactly 24 characters in asctime format". Add this date format for compatibility with tools using the standard mbox format, in particular git format-patch.
2022-10-29upas/fs: clear errstr after chkunixMichael Forney
The readmessage loop clears errstr at start and expects it not to change unless there is a read error. However, strtotm may use multiple calls to tmparse while trying to determine the date format, which may leave errstr non-empty on success. Clear it after chkunix so that this doesn't get treated as a message read error. This also fixes handling of naked From lines, which were previously just warned about, but since the conversion to tmparse they accidentally triggered a message read failure.
2022-10-29tmdate: provide better parse errorsOri Bernstein
it's often not obvious what date component caused an error when eyeballing a date format string and date; make the error message contain this information.
2022-10-29/sys/src/cmd/mkfile: append to $NOMK so user can provide their ownJacob Moody
ie NOMK=(gs games) @{ cd /sys/src && mk install }
2022-10-26audio/flacdec: don't run pcmconv on s16r44100c2Sigrid Solveig Haflínudóttir
2022-10-26zuke: kill off decoders; use more OCEXECSigrid Solveig Haflínudóttir
2022-10-24bar: revert boundaries fix, the old ones are fineqwx
2022-10-23bar: fix item boundaries misspacingqwx
2022-10-23sdnvme: fix missing unlock() in submit queue full casecinap_lenrek
when we have more processors than submit queues, the submit queues are shared between some processors and hence we have to acquire its lock. in the case of the submit queue being full, we have to unlock it again before retrying otherwise we have a deadlock. sorry :(
2022-10-22patch: fix bounds check for hunk scan in forward directionMichael Forney
Previously, hunks that end exactly at the end of the file could not be found when the matching lines were located at a positive offset.
2022-10-01cdfs: handle block sizes correctlyArne Meyer
The Readblock enum does not work when you try to read audio cds. 4 cdda blocks are lager than 8192 and the command fails (at least when using an usb cd drive). This sets the block count according to the track block size. With this and the fix for libdisk I can rip audio cds on my el cheapo usb dvd drive. Tested with "Midnight Oil - Blue Sky Mining"
2022-10-22exportfs: fix clunk of first attach with -SMichael Forney
0 is a valid mid so should not be used as a nil value, since then the first mount (mid=0) will never be unmounted.
2022-10-22plot: fix disc and circle operationsan2qzavok
Discs and circles were drawn on screen directly and later erased by offscreen buffer. This change puts them in line with other operations, which draw to offscreen first and to screen when necessary
2022-10-21git/walk: don't list untracked files after removalOri Bernstein
git/walk had some confusing behavior, where git/add of a file and then immediate removal would leave it in the list of files as 'removed'. This was harmless, but confusing to users. Now, 'git/add' and 'git/rm' without a commit in between will not list the file as removed.
2022-10-21kernel: fix freeb() for custom poolscinap_lenrek
Some ethernet drivers like ethervt6105M maintain a custom pool of Blocks using Block.free callback. To maintain that Block.list pointer is nil when reused, we have to clear it before returning it to the custom pool as the custom pool code is not aware of it. Also, poison Block.list pointer before free().
2022-10-19rio: prevent some more keyboard lockupsJacob Moody
Triggered these from ktrans a couple times when poking at it, the issue is that we get stuck wanting to emit to the tap without a valid listener. This ensures we are never stuch sending to a deleted window or dead tap user.
2022-10-18zuke: fix wrong string width of playback position calculated on network streamsSigrid Solveig Haflínudóttir
2022-10-18mothra: get rid of soft hyphensSigrid Solveig Haflínudóttir
2022-10-17libtags: opus/vorbis: make sure to get to the last frame to have the full ↵Sigrid Solveig Haflínudóttir
duration
2022-10-17zuke: display currently enabled modes when stoppedSigrid Solveig Haflínudóttir
2022-10-17zuke: less garbage dereferencing, stop interrupting decodersSigrid Solveig Haflínudóttir
2022-10-17zuke: use percentile to calculate relative widths of columnsSigrid Solveig Haflínudóttir
2022-10-17zuke: update ICY title from the stream metadata while playingSigrid Solveig Haflínudóttir
2022-10-16zuke: fix repeat and replay gain modes not showing when playing network streamsSigrid Solveig Haflínudóttir
2022-10-15zuke: basic replay gain supportSigrid Solveig Haflínudóttir
2022-10-15libtags: pick R128 gainSigrid Solveig Haflínudóttir
2022-10-14git/compat: fix 'git init --bare' and 'git ls-remote' (thanks floren)Ori Bernstein
2022-10-13libtags: vorbis, opus: ignore tags past the ogg pageSigrid Solveig Haflínudóttir
As it is implemented right now, OGG pages are not treated properly, so in case of huge embedded pictures inside metadata the file could end up ignore by audio/readtags and audio/mkplist. Workaround by ignoring tags that span across pages for now.
2022-10-12ktrans(1): remove README filesJacob Moody
While the logic described in these has been preserved carefully and still accurate, the man page now covers all that is presented and includes documentation on newer features.
2022-10-12ktrans: revisit grammer handling and do some spring cleaningJacob Moody
Revisiting the man page example and README from the original ktrans there was some descripency on how to handle punction marks and special characters. Notably 。(.) and 、(,) need special casing. If we have anything in the buffer we need to tack on these characters as an Okuri tail and avoid the actual punction from entering the Kanji buffer. Newlines were previously modified to be taken as a completion if there was runes in the buffer. This has been backed out, instead Shift + Space can serve this role via kbmap should they prefer (and as is done in the jp kbmap). Instead we treat newlines as hints to reset the buffer. There was also a bug in where after cycling through all options the original hiragana was not printed back. This has been corrected. The max number of candidates has been bumped to 32 and moved to an enum. This does nearly double our resident memory size, but we reguarly had matches exceed this limit. A better solution is slated. The man page now makes an attempt to explain the rules around Okuri and Joshi input modes.
2022-10-12reform/pm: lpc comms: increase delays to 80msSigrid Solveig Haflínudóttir
Apparently 60ms isn't always enough.
2022-10-11rio: close the display on the way outJacob Moody
This restores the window image when exiting a subrio.
2022-10-10upas/fs/imap.c: additional sanity checking during `Expunge` to avoid suicideIgor Böhm
We have to ensure the size we compute for memmove(...) in `Expunge` is properly bounded. For certain combinations of inputs we compute an illegal size causing a suicide: upas/fs: imap: fetchrsp: fetchrsp: bad idx 7 upas/fs: user: igor; note: sys: trap: fault read addr=0x0 pc=0x214f92 fs 531: suicide: sys: trap: fault read addr=0x0 pc=0x214f92 Stack trace including state of data-structures: term% acid -l /sys/src/cmd/upas/fs/imap.acid 531 /proc/531/text:amd64 plan 9 executable /sys/lib/acid/port /sys/lib/acid/amd64 acid: lstk() memmove(p2=0x8e5928,n=0xffffffffffffffe8)+0x42 /sys/src/libc/amd64/memmove.s:36 imap4resp0(imap=0x423c80,mb=0x0,m=0x0)+0x448 /sys/src/cmd/upas/fs/imap.c:522 unexp=0x58b00000000 p=0x425d17 ep=0x425d17 line=0x425d0b n=0x425d100000058c verb=0x425d10 op=0x2e6d6f63 imap4resp()+0x1b /sys/src/cmd/upas/fs/imap.c:556 imap4read(imap=0x423c80,mb=0x4239e0)+0x30 /sys/src/cmd/upas/fs/imap.c:928 s=0x425d29 f=0x425d29 n=0x58b0000058c ll=0x5008a34b0 i=0x425d290000058b m=0x171bd1f85150e2a6 imap4sync(mb=0x4239e0)+0x62 /sys/src/cmd/upas/fs/imap.c:1059 imap=0x423c80 err=0x0 syncmbox(mb=0x4239e0,doplumb=0x70616d6900000001)+0x5c /sys/src/cmd/upas/fs/mbox.c:76 a=0x58f n=0x400bc800000000 d=0x0 y=0x0 next=0x171bd206499a9366 m=0x66939a4906d21b17 reader()+0xde /sys/src/cmd/upas/fs/fs.c:1488 t=0x204ca163404153 mb=0x692e6d68656f622f io()+0x212 /sys/src/cmd/upas/fs/fs.c:1416 n=0x0 main(argc=0x0,argv=0x7fffffffef58)+0x31e /sys/src/cmd/upas/fs/fs.c:353 mboxfile=0x7fffffffef7a nodflt=0x300000000 srvpost=0x0 v=0x7fffffffef38 _argc=0x6d _args=0x40d7bd p=0x400000003 maildir=0x0 mbox=0x0 srvfile=0x0 _main+0x40 /sys/src/libc/amd64/main9.s:15 acid: Imap(0x423c80) mbox 0x0000000000428b90 freep 0x0000000000423c20 host 0x0000000000423c27 user 0x0000000000423c36 refreshtime 60 cap 0x00 flags 0x05 tag 872 validity 605040277 newvalidity 605040277 nmsg 1419 size 0 f 0x00000000008dd408 nuid 1420 muid 1420 Biobuf bin { Biobufhdr { icount -28 ocount 0 rdline 16 runesize 0 state 1 fid 10 flag 0 offset 280380 bsize 8192 bbuf 0x0000000000423d35 ebuf 0x0000000000425d35 gbuf 0x0000000000425cd1 errorf 0x0000000000000000 iof 0x0000000000228d17 aux 0x0000000000000000 } b end+0x388 } Biobuf bout { Biobufhdr { icount 0 ocount -8192 rdline 0 runesize 0 state 2 fid 10 flag 0 offset 33362 bsize 8192 bbuf 0x0000000000425d9d ebuf 0x0000000000427d9d gbuf 0x0000000000427d9d errorf 0x0000000000000000 iof 0x0000000000228d3a aux 0x0000000000000000 } b 0x425d98 } binit 1 fd 10 The root cause is an integer underflow where we subtract -1 from 0 using an unsigned type. The above acid trace shows the following values for key local variables: • nmsg ... 1419 • muid ... 1420 • n ... 1420 • idx ... 1419 The key section of code is /sys/src/cmd/upas/fs/imap.c:516,522 case Expunge: if(n < 1 || n > imap->muid){ snprint(error, sizeof(error), "bad expunge %d (nmsg %d)", n, imap->nuid); return error; } idx = n - 1; memmove(&imap->f[idx], &imap->f[idx + 1], (imap->nmsg - idx - 1)*sizeof(imap->f[0])); Plugging the above values into the call to memmove(...) demonstrates the issue: memmove(&imap->f[1419], &imap->f[1419 + 1], (1419 - 1419 - 1)*sizeof(imap->f[0])); ^^^^^^^^^^^^^^^ The third argument of memmove(...) is an unsigned size type causing the size to be a value that is way too large (the stack trace shows the size to be the unsigned value 0xffffffffffffffe8). The `Expunge` case can be fixed by amending the bounds checking condition before the memmove(...): case Expunge: if(n < 1 || n > imap->muid || (n - 1) >= imap->nmsg){ ^^^^^^^^^^^^^^^^^^^^^ snprint(error, sizeof(error), "bad expunge %d (nmsg %d)", n, imap->nuid); return error; } idx = n - 1; memmove(&imap->f[idx], &imap->f[idx + 1], (imap->nmsg - idx - 1)*sizeof(imap->f[0])); To add some additional context, this issue has been introduced in revision: term% git/export 84c4c81ceecfa8f51949787fc2dbe7b14164a353 Date: Mon, 02 Dec 2019 01:12:19 +0000 Subject: [PATCH] upas/fs imap fixes and improvements do incremental imap fetches after startup, fixes validity handling, record flags correctly when we aren't in the process of directly updating a message, fixes off by one in flag parsing, fixes mis-indexing messages in sync when we get an unsolicited fetch response. ...
2022-10-09ktrans: gui and man page reworkJacob Moody
Graphical display shows current candidate list.
2022-10-09usbsdmux: Add program to control usb-sd-mux devicecinap_lenrek
2022-10-08reform/pm: oops. do not invertSigrid Solveig Haflínudóttir
2022-10-08reform/pm: kbdoled: allow any size/depth of uncompressed image - convert ↵Sigrid Solveig Haflínudóttir
ourselves
2022-10-08nusb/disk: always allow raw scsi request (even without media present)cinap_lenrek
2022-10-08mergecinap_lenrek
2022-10-08devip: use port/netif.h constants for ethermediumcinap_lenrek
2022-10-08git/hist: fix with repository other than /Michael Forney
$gitroot has a trailing slash only when the repository is at /. When it is not, this path construction doesn't work. Use $gitfs/... like the other git scripts.