Commit graph

1748 commits

Author SHA1 Message Date
ftrvxmtrx 774065caaa aux/vga: rescale after loading new mode
Intel VBIOS seem to not update its state unless in graphical
mode, so set the scaling mode after loading new graphical mode.
2014-12-29 10:06:29 +01:00
ftrvxmtrx d908aff72f aux/vga: remove -s option, move scaling to the size string itself 2014-12-28 17:42:38 +01:00
ftrvxmtrx 0d5b33a9e8 aux/vga: scaling modes for VESA 2014-12-26 17:01:58 +01:00
cinap_lenrek 7f5f69ebb5 socksd: revert back, previous commit broke UdpAssociate request
should probably figure out a better way to get public ip
address on a interface.
2014-12-26 11:41:53 +01:00
cinap_lenrek de349cf9b0 socksd: dont use myipaddr() for announcing address 2014-12-26 09:11:04 +01:00
cinap_lenrek 4e94094e94 5l: remove -f flag and add -F flag to disable VFP code generation
almost nobody uses FPA anymore, so make VFP the default but
provide -F flag to disable it.
2014-12-24 11:38:44 +01:00
cinap_lenrek d1799f65ca nusb/serial: fix nusb/serial hang with ftdi
have to create process, not a thread in ftdi code so main
process can exit after posting fs service.
2014-12-24 11:04:18 +01:00
cinap_lenrek 127f8f0480 tee: get rid of openf[100] array and just dup() filedescriptors to 3+[0..n-1] 2014-12-21 05:12:56 +01:00
ftrvxmtrx a11fe1959d merge 2014-12-21 01:30:36 +01:00
ftrvxmtrx 758496ecaa sam: '^' and '_' cmds; same as '<' and '|' except that stdout goes to the command window 2014-12-21 01:28:14 +01:00
cinap_lenrek ffe862c543 vblade: fix code so #pragma pack isnt needed 2014-12-19 03:57:27 +01:00
cinap_lenrek 6379939642 add erik quanstros vblade utility 2014-12-19 02:50:22 +01:00
mischief 84f45a4491 acme: allow typing '\n' in window tags 2014-12-17 14:27:31 -08:00
cinap_lenrek bc97fa79b1 audio/flacdec: fix pcmconv pipeline race (thanks mischief and henesy) 2014-12-15 07:26:03 +01:00
cinap_lenrek 5c1803e1ad disk/mkfs: add -o flag to list source files 2014-12-15 00:52:22 +01:00
ftrvxmtrx 0dc1929379 png: fail on invalid bpc 2014-12-14 22:20:06 +01:00
ftrvxmtrx 96525edaae various cmds: replace magic numbers with Kdel/Keof, etc 2014-12-13 21:58:49 +01:00
mischief ff4daa7e93 stats: handle 'q' to close
a side effect of this is keys typed other than q/Del no longer get drawn on top of the window.
2014-12-13 11:28:16 -08:00
cinap_lenrek 9be64bcb8d ndb/cs: fix spelling (thanks mischief) 2014-12-13 23:16:04 +01:00
cinap_lenrek 651fa5bd50 cfs: change default mountpoint to /mnt/cfs and fix the manual (thanks mischief) 2014-12-11 20:38:04 +01:00
cinap_lenrek 854d028db9 acme: fix buffer overrun in xfidutfread() and xfidruneread(), cleanup
the utf8 buffers b1 where allocated from fbufalloc() which gives
us BUFSIZE bytes, but Xfid->count can be bigger than that. so just
emalloc() the requested number of bytes.

when converting from Runes to utf-8, we have to account for the
terminating '\0' byte snprint() places, so fix the maxrune number
calculation instead of using BUFSIZE+1 as buffer size.
2014-12-11 20:20:47 +01:00
cinap_lenrek 86e63c36ed kbmap: fix sprint() buffer overflow (thanks silasm)
A buffer can be overflowed in the init function of kbmap.c by using a filename of more than 112 characters.

sample output:
% cd /sys/lib/kbmap
% touch aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
% kbmap
kbmap 1974: suicide: sys: trap: fault write addr=0xa6a96510 pc=0x000011df
offending code is most likely the call to sprint in the init function of /sys/src/cmd/kbmap.c,
which in this case writes /sys/lib/kbmap/$file to a 128-bit buffer.
I'm willing to submit a patch for this myself along with a few minor improvements/fixes to kbmap
if I can figure out the nuances of doing so.

--silasm
2014-12-11 18:32:50 +01:00
cinap_lenrek 1985bebbdd dnsgetip: filter negative answers, remove -f flag, use dnsgetip logfile 2014-12-10 02:30:25 +01:00
mischief 230cee347f ndb: add dnsgetip program to resolve A and AAAA records during bootstrapping 2014-12-09 16:18:08 -08:00
cinap_lenrek f9d379974a factotum: accept multiple bootstrap auth servers in /net/ndb and -a arguments
we might have to deal with multiple bootstrap auth server
ip addresses (ipv4 and ipv6) in the future, so deal with them.
2014-12-09 22:07:37 +01:00
cinap_lenrek ee6936365f secstore: allow multiple server addresses in $secstore and multiple -s arguments
on bootstrap, we might have to deal with multiple auth server ip
addresses (ipv4 and ipv6), so deal with it.
2014-12-09 21:53:07 +01:00
mischief ee2d30984f ip/ipconfig: treat /32 mask as /0
some dhcp servers send a mask of 255.255.255.255 to indicate the gateway is directly routeable.

thanks to david du colombier for this patch.
2014-12-08 17:27:40 -08:00
cinap_lenrek 501e69d010 ndb/dns: ignore terminating authoritative flag for no-answer when more nameservers are provided
continue recursing when we get empty but non-negative answer
from a (claimed) authoritative nameserer that provides more
nameservers.

this fixes wordpress dns:

63766.3: sending to 192.0.80.93/ns1.wordpress.com bossypally.files.wordpress.com ip
63766: rcvd OK from 192.0.80.93 (authoritative)
	Q:    bossypally.files.wordpress.com ip
	Auth: files.wordpress.com              5 min           ns   	mdns1.wordpress.com
	      files.wordpress.com              5 min           ns   	mdns2.wordpress.com
	      files.wordpress.com              5 min           ns   	mdns3.wordpress.com
	      files.wordpress.com              5 min           ns   	mdns4.wordpress.com
	      files.wordpress.com              5 min           ns   	mdns5.wordpress.com
	Hint: mdns1.wordpress.com              4 hr            ip   	192.0.75.7
	      mdns2.wordpress.com              4 hr            ip   	198.181.117.7
	      mdns3.wordpress.com              4 hr            ip   	198.181.116.7
	      mdns4.wordpress.com              4 hr            ip   	198.181.118.7
	      mdns5.wordpress.com              4 hr            ip   	192.0.74.7


63766.4: sending to 192.0.75.7/mdns1.wordpress.com bossypally.files.wordpress.com ip
63766: rcvd OK from 192.0.75.7 (authoritative)
	Q:    bossypally.files.wordpress.com ip
	Ans:  bossypally.files.wordpress.com   5 min           ip   	192.0.72.2
	      bossypally.files.wordpress.com   5 min           ip   	192.0.72.3
----------------------------
answer bossypally.files.wordpress.com   5 min           ip   	192.0.72.2
answer bossypally.files.wordpress.com   5 min           ip   	192.0.72.3
----------------------------

note the authoritative flag in the first response from ns1.wordpress.com that
would otherwise terminate the search.
2014-12-08 01:26:07 +01:00
mischief e584f7f374 resize: fix typo 2014-11-26 19:32:16 -08:00
mischief 250e120400 astro: fix typo 2014-11-26 18:56:00 -08:00
cinap_lenrek fbdaa03d84 wpa: handle essid: with whitespaces from ether ifstats file 2014-11-17 00:53:02 +01:00
cinap_lenrek 2310258d57 wpa: fix quoting for essid with spaces 2014-11-17 00:12:55 +01:00
BurnZeZ 73eea8402b abaco: cleanup, handle image/x-icon, don't use backspace as a hotkey, and remove urlconvience()/related functions 2014-11-16 09:58:21 -05:00
cinap_lenrek 242007de7c sed: fix error handling for "Output line too long" and other stuff
sed just continued writing past genbuf when it should stop
with "Output line too long".

quit when we get unspecified options.

stupid casts from long to char* for no reason.

some 0 vs nil cleanup.
2014-11-16 01:48:18 +01:00
cinap_lenrek 9841f7f3f5 upas/fs: handle ramfs and hjfs "file locked" error 2014-11-14 10:09:29 +01:00
cinap_lenrek 52c1f712ec upas/fs: handle cwfs "file is locked" error message 2014-11-14 23:36:18 +01:00
cinap_lenrek c79dc3263e httpfile: use webfs, fix 9p flushes
we can improve performance alot by using webfs which
does http keep alives for us, so connection setup
overhead is eleminated.

fix 9p flushes and double frees.
2014-11-12 12:03:51 +01:00
cinap_lenrek 95dbc72801 io: add -E flag to access embedded controller space 2014-11-10 00:35:07 +01:00
cinap_lenrek e4af9bc392 smtpd: cleanup hello() domain check code
theres no point in doing domain checks on literal ip addresses,
so handle that case early.
2014-11-08 09:00:04 +01:00
cinap_lenrek 4908ea43d7 merge 2014-11-08 05:23:59 +01:00
cinap_lenrek 9dfe587b27 smtpd: accept literal ipv6 addresses in HELO/EHLO 2014-11-08 05:22:25 +01:00
mischief cd3a742b32 all: typo fixes from ray@raylai.com 2014-11-07 10:39:50 -08:00
cinap_lenrek 797cc13c70 fix dangerous werrstr() usages
werrstr() takes a format string as its first argument.
a common error is to pass user controlled string buffers
into werrstr() that might contain format string escapes
causing werrstr() to take bogus arguments from the stack
and crash.

so instead of doing:
	werrstr(buf);

we want todo:
	werrstr("%s", buf);

or if we have a local ERRMAX sized buffer that we can override:
	errstr(buf, sizeof buf);
2014-11-07 12:51:59 +01:00
cinap_lenrek 9ac3a0c39e wpa: fork note group when going to background (thanks jpm)
bug: as jpm pointed out, when we run aux/wpa in rio window
and delete the window, aux/wpa was killed as it shared the
note group of the window.

fix: fork the notegroup.
2014-11-02 17:23:10 +01:00
cinap_lenrek 670493fe5e realemu: make sure instruction arguments are initialized even when decoding traps 2014-11-02 00:50:37 +01:00
cinap_lenrek bb33ba6b9a nusb/kb: dont set boot protocol on HidCSP interface when we failed to read report descriptor (thanks aap_)
this fixes wireless keyboard/mouse on raspi.
2014-10-31 20:40:13 +01:00
cinap_lenrek 2cfbc3c1cb mk9660: add -E option to create EFI boot entry 2014-10-31 03:06:09 +01:00
cinap_lenrek 840ade48c4 fix syslog() use with linefeeds for various programs 2014-10-29 17:29:09 +01:00
cinap_lenrek 4616c93e8d cs: fix linefeeds in syslog(), cleanup 2014-10-29 03:20:43 +01:00
cinap_lenrek fe23dcefd4 cs: use /net/ether* instead /net/ether[0123], dont remove srv file with -n, dont write dns logfile 2014-10-29 02:43:18 +01:00
cinap_lenrek c38cd50805 rio: dont serve a kbd file per window when we didnt got one from the environment
9vx doesnt provide a /dev/kbd file and rio faking one
up causes problems with vncv. (issue #223)
2014-10-25 02:05:44 +02:00
stanley lieber ca694c51ef pkg: change default repo to http://9front.org/pkg/386 2014-10-12 13:27:53 -04:00
BurnZeZ 748a95266f rio: fix "-cd dir" in mountspec being ignored 2014-10-11 11:47:38 -04:00
aiju 4f264cedfb added crc32 2014-09-30 13:07:36 +02:00
cinap_lenrek 4f4d71b941 hgfs: make data files with meta headers having the right size after open
to get the right data size of a file, the revlog needs to have been
opened and the metaheader parsed. as an optimization, we used to
open revlog only on the first read resulting revlogs with metaheaders
having the wrong size returned by fstat() until the first read().

tar relies on fstat() giving the correct file size, so just open
the revlog on open. reading directories can still yield the wrong
size but it is not that critical.
2014-09-29 21:01:51 +02:00
cinap_lenrek c1dc5d15c3 snap: change ulong return of stackptr() to uvlong for amd64 2014-09-29 20:11:58 +02:00
cinap_lenrek a494cc74ad ndb/dns: request recursion only for local dns servers
we used to set RD flag in requests unconditionally, which
is fine by the standard but some dns server administrators
seem to use it as a denial of service indicator (for ther
non recursive authoritative nameservers) and ignore the
request.

so only set the RD flag when talking to local dns servers.
2014-09-28 05:15:25 +02:00
cinap_lenrek decc7ec518 6c/8c: eleminate moves by swaping source and destination operands in peephole pass 2014-09-24 20:45:16 +02:00
cinap_lenrek 4cb032442a acid: fix sysr1() stack corruption
the syscall stubs (for amd64) currently have a unconditional
spill of the first (register) argument to the stack.

sysr1 (and _nsec) are exceptional in that they do not
take any arguments, so the stub is writing unconditionally
to ther first argument slot on the stack.

i could avoid emiting the spill in the syscall stubs for
sysr1 but that would also break truss which assumes fixed
instruction sequence from stub start to the syscall number.

i'm not going to complicate the syscall stubs just for
sysr1 (_nsec is not used in 9front), but just add a dummy
argument to sysr1 definition that can receive the bogus
argument spill.
2014-09-22 23:07:59 +02:00
cinap_lenrek 2604bc3603 stats: handle /dev/sysstat 32bit overflow in delta calculation
the numbers from /dev/sysstat overflow on 32bit, so have
to do subtraction modulo 2^32 as we calculate with 64bit
integers.

thanks mischief for reporting this.
2014-09-20 18:06:59 +02:00
cinap_lenrek ce80c5029e oggdec: recognize "begin of stream" packets and restart decoding 2014-09-16 20:25:01 +02:00
mischief e5c47ca18e ramfs: allow changing mtime in wstats 2014-09-15 15:49:39 -07:00
cinap_lenrek 7011194af1 ramfs: fix directory check in wstat() (thanks mischief) 2014-09-16 22:33:27 +02:00
cinap_lenrek 7f295c2055 telnetd: let the kernel place the shared segment in segattach() (thanks kenji arisawa) 2014-09-14 21:20:13 +02:00
mischief 8348a233ae vi: implement _nsec syscall 2014-09-13 06:07:57 -07:00
BurnZeZ 62a8bf1846 acme: remove unused #include 2014-09-11 12:47:04 -04:00
cinap_lenrek a49ddece8b ip/ayiya: experimental anything in anything tunnel protocol client
this is a work in progress implementation of the ayiya (anything
in anything) protocol as used by sixxs.net. hiro tested it and it
worked for him, but progress has stalled as sixxs.net rejected my
request for an account and ignored my emails since.
2014-09-06 22:59:58 +02:00
cinap_lenrek 3a322e9f32 5e: fix signed long multiply 2014-09-04 22:53:54 +02:00
cinap_lenrek e890c3d943 5e: push ERRMAX for note message on stack avoiding unaligned stack pointer 2014-09-03 19:23:55 +02:00
cinap_lenrek 7996878864 ipconfig: remove sleep() left over from debug :-) 2014-08-27 01:41:02 +02:00
cinap_lenrek 46b8a0ac00 ipconfig: fix readipifc() memory leaks in recvra6 and sendra6 processes
to avoid continuously leaking memory in recvra6 and sendra6
processes, pass the previous Ipifc* pointer to readipifc().
2014-08-27 01:12:42 +02:00
cinap_lenrek 7ad08a8515 ipconfig: cleanup code duplication in ip6cfg() 2014-08-26 21:09:57 +02:00
cinap_lenrek dbf165e1bd ping: don't spin when we get error reading icmp connection, print error and sleep 2014-08-26 21:07:59 +02:00
cinap_lenrek 2161885034 secstore: improve error messages, newSConn() can't fail 2014-08-21 01:18:36 +02:00
cinap_lenrek 98e3e12d92 5a: revert MOVM .S and .W are exclusive (broke bcm build) 2014-08-17 04:26:28 +02:00
iru 0bc51a90b0 Fix acme crash: Get D in a new window with D being an existing directory 2014-08-16 18:50:42 -03:00
cinap_lenrek a5bce84600 nusb/kb: delete code for keyboard boot protocol handling, just use hid parser
unify the keyboard and mouse readers into one using the hid
report parser for both. remove the keyboard protocol handling,
as it is now handled by hid parser and all we get is a sequence
of keycodes in Hiddev.k[] which we diff for up/down and translate
to pc scancodes.
2014-08-16 23:34:28 +02:00
aiju 74a276d076 spred: command window improvements 2014-08-14 10:42:39 +02:00
cinap_lenrek a67d18ccf1 import: make aan (-p flag) work in ``backwards mode'' (-B)
in backwards mode, the roles of the aan filters need to be
reversed. add "-n address" option to import to override the
announce address for the aan server part (default tcp!*!0).
2014-08-14 00:11:14 +02:00
cinap_lenrek d8d26c7001 nusb/ptp: do maxpkt reads to avoid babble error with usb 2.0 devices (thanks mischief!)
mischief got babble error with his mobile phone as we used to
read at max 64 bytes for the data response phase. his device
has 512 byte packet size.

thans to mischief for the patience.
2014-08-13 01:10:59 +02:00
mischief 53619de428 aux/8prefix: fix usage 2014-08-12 10:33:47 -07:00
mischief a0b7cabe3a secstore: read server from $secstore environment variable
this allows setting the secstore server with secstore=tcp!example.com!secstore or secstore='$secstore' to read from ndb.
2014-08-10 18:05:57 -07:00
cinap_lenrek 427e925eea cwfs: add optional uid argument to allow command, unify permission override code
the allow command now takes an optional uid argument for the user
to be granted temporary god status on the fileserver for maintenance.

this was kenji okomotos idea, so thanks :)

remove wstatallow and writeallow flags. instead, we have global:

int allowed;

that contains the uid of the currently allowed user id or -1
if permission checking is globally disabled for the fileserver.
when zero, normal permission checking takes place.

added int isallowed(File*) function that returns non-zero when the
context is the console, or the allowed user. this is also used internally
by iaccess(), so all the extra code of in the callers of iaccess()
is gone now.

dont conflate allowed user with noauth flag and auto-allow on ream.
the installer already knows about noauth and allow flags so theres no
problem with bootstraping.
2014-08-11 22:36:59 +02:00
cinap_lenrek 30d4d8984b 5a: MOVM.IA.W.S ..., [R15] is exception return and needs to be allowed (thanks aiju) 2014-08-09 18:23:14 +02:00
cinap_lenrek 760063ab57 cwfs: fix 32bit multiplication overflows for allocation sizes (thanks kenji okomoto) 2014-08-09 17:37:02 +02:00
cinap_lenrek 3472f91129 5a: reject MOVM instruction with .S and .W bits both set (aijus idea) 2014-08-09 22:47:46 +02:00
cinap_lenrek 0ceeee4c8b ndb/dns: fix nil dereference crash with convM2DNS() returning reqmsg.qd == nil 2014-08-08 02:06:03 +02:00
cinap_lenrek bc306a5a63 8c, 6c: generate enam.c file, just like 5c 2014-08-07 21:35:52 +02:00
cinap_lenrek d304dc8119 5a, 5l: add LDREX/STREX/CLREX instructions 2014-08-07 20:22:00 +02:00
cinap_lenrek 7c1ae2ead3 samterm: fix ctrl-b crash when cmd window resized (thanks revex)
for reference:

On IRC revex reported that samterm crashes on Ctrl-b if the command window has
been resized. I was able to reproduce:

http://plan9.stanleylieber.com/sam/bugs/ctrl-b.png

; acid 831213
/proc/831213/text:amd64 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/amd64
acid: lstk()
abort()+0x0 /sys/src/libc/9sys/abort.c:6
panic1(s=0x400448)+0x27 /sys/src/cmd/samterm/main.c:692
panic()+0x19 /sys/src/cmd/samterm/main.c:684
lldelete()+0x71 /sys/src/cmd/samterm/flayer.c:221
flupfront(l=0x40eac0)+0x18 /sys/src/cmd/samterm/flayer.c:139
	v=0x20062900000001
current(nw=0x40eac0)+0x49 /sys/src/cmd/samterm/main.c:156
type(l=0x40eac0,res=0x15300000001)+0x37c /sys/src/cmd/samterm/main.c:658
	t=0x40eaa8
	buf=0x419ec0
	p=0x41dd48
	a=0x0
	backspacing=0x200000000
	c=0x41dd4800000002
	cursor=0x0
	a0=0x0
threadmain(argv=0x7ffffeffefa0)+0x21c /sys/src/cmd/samterm/main.c:75
	r=0xb0000001b1
	got=0xfefefefe00000002
	chord=0x0
	nwhich=0x43c310
	scr=0x200000000
	t=0xfefefefefefefefe
	w=0x43c310fefefefe
mainlauncher()+0x18 /sys/src/libthread/main.c:59
launcheramd64(arg=0x4194a0,f=0x221673)+0x10 /sys/src/libthread/amd64.c:11
0xfefefefefefefefe ?file?:0
acid:
2014-08-04 09:33:23 +02:00
cinap_lenrek 15b5a980d7 iostats: properly distribute exit status and give usefull error messages 2014-08-03 17:09:28 +02:00
cinap_lenrek 718f3358bb iostats: remove unused fcallfmt, dont leak our mount pipe end into exportfs proc 2014-08-03 16:28:07 +02:00
cinap_lenrek d63734eb53 iostats: bring back standard filedescriptor spying 2014-08-03 16:02:47 +02:00
cinap_lenrek 5302e88796 exportfs: simplify freefile() code
remove impossible checks, rewrite as while loop.
2014-08-02 19:22:10 +02:00
cinap_lenrek b185d2fe5c exportfs: remove getsbuf() nil check, can't happen 2014-08-02 19:04:33 +02:00
cinap_lenrek 686cf0b0f3 iostats: isolate fs from interrupt notes
interrupt notes go to the child process, not the filesystem
and filter process.
2014-08-02 18:45:19 +02:00
cinap_lenrek 4f45a40334 iostats: cannot spy on fd 0,1,2 as /fd is per process 2014-08-02 15:47:24 +02:00
cinap_lenrek 73d35f9c7d exportfs: cleanup 2014-08-02 15:07:29 +02:00
cinap_lenrek 7ae4e473da ftpfs: dont convert names to latin when string is valid utf-8 2014-08-02 14:37:16 +02:00
cinap_lenrek 7cc757c3c0 python: disable symlink and readlink compile options, ape has no reasonable way emulating it 2014-08-02 14:28:19 +02:00
cinap_lenrek dc501ae1e3 iostats: dont prefix /bin to argv[0] when already absolute or relative path 2014-08-02 03:06:09 +02:00
cinap_lenrek 4e42b9996f iostats: cleanup, remove bogus Maxrpc constant 2014-08-02 02:41:57 +02:00
cinap_lenrek 23aaa0c59c iostats: reimplement iostats as a 9p filter instead of duplicating exportfs
old iostats failed to work when builidng the kernel due to old bugs
that where already fixed in exportfs. instead of backporting the fixes,
reimplement iostats as a filter that sits between exportfs and the
process mount. from users perspective, theres no difference.

the result is much smaller and can handle everything that exportfs
can like /srv.
2014-08-02 02:30:19 +02:00
cinap_lenrek 1b70ab5979 exportfs: use argv0 instead of hardcoding "/bin/exportfs" in openmount(), dont use 0 for nil 2014-08-01 16:57:39 +02:00
aiju 709e78b9f9 spred: scrolling and other bugfixes 2014-07-31 11:36:24 +02:00
aiju 712fd30652 added sprite editor spred 2014-07-30 15:57:14 +02:00
cinap_lenrek a2f7d03d4e rc: fix slow Xqdol(), avoid recursion in conclist(), estrdup(), avoid copying
Xqdol() used to take quadratic time because of strcat(),
the code isnt really needed as list2str() aready does the
same thing in linear time without the strcat().

add estrdup() which uses emalloc() so allocation error are
catched.

move strdups() of name from callers into newvar().

avoid recursion of conclist(), and avoid copying of word
strings by providing Newword() function which doesnt copy
the word string.
2014-07-23 15:28:37 +02:00
cinap_lenrek 6273bad12d ratrace: make multithreaded ratraces less confusing (for mischief) 2014-07-22 21:54:26 +02:00
cinap_lenrek e4436ec0bb page: fix deadlock with addpage (thanks BurnZeZ for the stacktraces)
addpage() should not be called with the display locked as it
calls showpage1() which sleeps when there are too many
processes active.

the bug was triggered by plumbing to trigger the addpage().
2014-07-15 20:45:00 +02:00
cinap_lenrek cc001c31a7 tftpfs: make sure path is null terminated 2014-07-13 01:17:48 +02:00
cinap_lenrek 4b7b1218bf ftpd: dont skip unmountnet() and return proper error string from dialdata() 2014-07-13 01:03:17 +02:00
cinap_lenrek e14eaacce6 tftpd: fix error string packet overflow in nak(), fix syslog reporting 2014-07-13 01:00:02 +02:00
cinap_lenrek 6bfff754a8 abaco: fix double free race of p->status string (thanks BurnZeZ for the proc snap) 2014-07-09 23:55:54 +02:00
cinap_lenrek 8677db333a nusb/serial: implement flushes
handle reads and writes with 9pqueue(2) so they can
be flushed and wont hang the filesystem. this also
lets us get rid of the timeouts.

ftdi is still full of braindamage that should be
rewritten, but i dont have a device to test.
2014-07-05 08:17:37 +02:00
cinap_lenrek 502247bf92 nusb/serial: more cleanup 2014-07-05 06:01:03 +02:00
cinap_lenrek 336e605a11 support for huawei e220 g3 modem, cleanup nusb/serial 2014-07-05 23:19:13 +02:00
cinap_lenrek 4ad63a4c56 nusb: fix spelling, sorry 2014-06-28 19:55:14 +02:00
cinap_lenrek 7d9339f75e merge 2014-06-28 18:11:04 +02:00
cinap_lenrek 4275c49e72 nusb: implement aijus stable uniqueue device names
instead of naming devices by ther dynamically assigned device address,
we hash device uniqueue fields from the device descriptor and produce
a 5 digit hex string that will identify the device across machines.

when there is a collision (less than 1% chance with 100 devices),
usbd will append the device address to the name to make it uniqueue
for this machine.

the hname is passed to drivers in the devid argument, which now has
the form addr:hname, where the colon and hname can be omited (for backwards
compatibility).

when the new behaviour isnt desired, nousbhname= environment variable
can be defined giving the old behaviour.
2014-06-28 18:09:43 +02:00
cinap_lenrek d8c75e45de iostats: more procs 2014-06-28 17:53:57 +02:00
mischief 9d30b0f32d merge 2014-06-27 23:51:14 -07:00
mischief 5aee1a997f unzip: fix usage 2014-06-27 23:50:42 -07:00
cinap_lenrek ec572a53a9 ptp: fix alignment assumptions for amd64 2014-06-28 01:36:37 +02:00
mischief a1dad87446 upas/fs: disable imap mail fetch pipeline due to race
pipeline = 1 with a dovecot imap server causes FETCH and OK responses
get interleaved so some message bodies accidentally get merged together.
disabling it will make fetching mail over imap slower, but it works.
2014-06-25 22:06:29 -07:00
cinap_lenrek 4f95d75098 ed: dont pass string constants to mktemp() 2014-06-22 01:48:02 +02:00
cinap_lenrek fa09758a73 samterm: use 4K stacks for amd64 (thanks burnzez)
we got a stack overflow on the hostproc on amd64 overflowing
by arround 200 byte. so just use 4K stacks for everything.
2014-06-11 19:31:14 +02:00
mischief 906cc83c35 mkpaqfs: english 2014-06-09 05:05:59 -07:00
cinap_lenrek 01b5ac1402 iostats: add -C flag to enable mount cache 2014-06-08 18:54:36 +02:00
cinap_lenrek 3d12f4f408 iostats: dont sysfatal on 9p read error due to program termination
the note mechanism is racy and can lead to the fs terminating
iostats because it gets "i/o on hugup channel" (namespace closed).
2014-06-08 18:27:39 +02:00
ftrvxmtrx 2739c6514a file: djvu 2014-06-07 23:16:34 +02:00
cinap_lenrek 524720a58d file: detect NES and SEGA rom files, fix newline 2014-06-06 01:29:14 +02:00
cinap_lenrek 863a459691 webfs: explicitely unmount old /mnt/web (thanks BurnZeZ)
webfs forks the namespace to isolate itself from its mount
point which has the side effect that it captures the mount
of previous instances of webfs mounted on /mnt/web.

explicitely unmount the mountpoint in our namespace copy
to drop the reference.
2014-06-04 17:45:08 +02:00
cinap_lenrek 93d0474f77 nusb/usbd: cleanup 2014-06-03 21:40:30 +02:00
cinap_lenrek 5ab9f9c621 nusb/usbd: serialize /dev/usbevent processing
when there are multiple readers of /dev/usbevent, we have to
serialize the processing to make sure that only one driver
is opening the devices control endpoint at a time.

to do this, we assume the device is busy after reading the
event file until the next read or clunk on the same fid.

to mark a device busy, we set the dev->aux pointer to the
fid processing a event. And the Event structure takes a
reference to the device producing the event.

the problem arised from cdc ethernet and nusb/serial sharing
the same device class, and we need to run the particular driver
to figure out if the device can be used. doing this concurrently
fails because devusb allows only one open per endpoint.
2014-06-03 07:21:48 +02:00
Aram Hăvărneanu bf0d5c8abb 6a, 6c, 6l: fix copy propagation
Without an explicit signal for a truncation, copy propagation will
sometimes propagate a 32-bit truncation and end up overwriting uses of
the original 64-bit value.

This was independently discovered and fixed in Go. See:
	http://golang.org/issue/1315
	https://codereview.appspot.com/6002043/

Thanks Charles Forsyth for tips and advice.
2014-05-30 12:28:01 +02:00
cinap_lenrek 17d0dea87c we look for strings.c, it is broken, this strings.c will make us go. 2014-05-30 04:05:18 +02:00
cinap_lenrek 20883bd7de cpu: remove duplicate environment and chdir($home) code (thanks qrstuv)
newns() (called by auth_chuid()) already prepares the
environment variables and puts us in a sane working
directory (as specified by the namespace file).
2014-05-24 02:09:52 +02:00
cinap_lenrek e7b94ba052 syscall: add missing _nsec() declaration 2014-05-20 05:21:22 +02:00
cinap_lenrek c7be3ba9e6 init: dont interpret environment var contents as fmtstring, cleanup 2014-05-19 06:58:53 +02:00
cinap_lenrek 7ae98ac5a6 ip/torrent: use "torrent" as default user agent 2014-05-19 04:56:07 +02:00
cinap_lenrek 1055b951f3 ip/torrent: fix usage, add -A option to set user-agent
trackers do like the new default Mozilla/5.0 (compatible)
user agent. so force useragent to hjdicks and give option
to override it in case trackers get even more clever in
the future.
2014-05-19 23:23:08 +02:00
cinap_lenrek c994152a90 ipconfig: fix dhcp watch
in dhcpwatch, the sleep time "secs" could become
zero potentially freezing the lease time.

give up when in Sinit state in dhcpquery() as this
is a terminal state.
2014-05-18 19:20:31 +02:00
ftrvxmtrx 704bd2b513 samterm: fix esc, change ctrl+b behaviour to a more useful one (thanks cinap) 2014-05-12 14:19:22 +02:00
ftrvxmtrx e993ea3e30 samterm: clean up key defines. use ctrl+b as in rio 2014-05-12 12:58:24 +02:00
cinap_lenrek 679b092ee0 htmlfmt: use uhtml for character set conversion 2014-05-12 02:38:53 +02:00
cinap_lenrek edca217bb9 tcs: handle surrogate pairs 2014-05-11 00:54:59 +02:00
cinap_lenrek 7388792a12 tcs: prevent accidents with runes beyond 16-bit 2014-05-11 22:29:47 +02:00
cinap_lenrek 14cd6df332 tcs: fix inplace 16 bit unicode conversion
inplace conversions do not work anymore as
Rune is not unsigned short anymore.
2014-05-10 17:28:17 +02:00
cinap_lenrek 807af1d847 webfs: use mozilla compatible user agent as default
sites like google return the wrong characterset when
they do not recognize the user-agent. so setting default
user agent to something thats likely to pass these
idiotic browser tests.
2014-05-09 18:22:51 +02:00
cinap_lenrek 144c4ab223 abaco: need more stack on amd64 2014-05-09 17:16:34 +02:00
cinap_lenrek 87fd5240f0 remove old copies of kernels l.s from cmd/?a 2014-05-08 18:48:51 +02:00
cinap_lenrek 47d131c088 abaco: remove strange line 2014-05-08 18:41:30 +02:00
ftrvxmtrx 7ea0732c55 tail: fix follow for empty files (thanks cinap_lenrek) 2014-05-08 14:29:44 +02:00
ftrvxmtrx 1c835e370f tail: seek to EOF to check if seekable. fixes tail on /proc files 2014-05-08 12:33:24 +02:00
cinap_lenrek f4f2ff6038 hgfs: avoid revlogupdate() calls when reading root (thanks burnzez)
we do not need to check for revlog updates on every
(directory) read when reading the root. only do it
when reading from the start.
2014-05-08 22:20:26 +02:00
ftrvxmtrx 428cc541f8 sed: remove unused ecmp function 2014-05-07 14:43:11 +02:00
cinap_lenrek 3426459ab5 cc: fix spurious warning on comparsion with scope redeclared variable (thanks aiju)
> warning: a.c:9 useless or misleading comparison: UINT < 0

the error can be observed by compiling the following code
with warnings enabled:

#include <u.h>
#include <libc.h>

uint r;

void
main(int argc, char *argv[])
{
	int r;

	if(r < 0){
		exits(0);
	}
}

the offending code in the compiler is:

-	if(l->op == ONAME && l->sym->type){
-		lt = l->sym->type;
-		if(lt->etype == TARRAY)
-			lt = lt->link;
-	}

compiler handles scope by overwritin and reverting
symbols while parsing. in the ccom phase, the nodes symbol
(n->sym) is not in the right scope and we wrongly think r
is uint instead of int.

it is not clear to me what this code tried to accomplish in
the first place nor could anyone answer me this question.

the risk is small as this change doesnt affect the compiled
program, only the warning, so removing the offending code.
2014-05-06 21:36:28 +02:00
cinap_lenrek ff7d68e41a gs: fix /undefined in --setcolor-- errors on amd64 2014-05-05 00:49:26 +02:00
cinap_lenrek 826f4c0daf gs: remove PStorage data type from ttf interpreter
i dont see that pointers are stored in PStorage at all,
so just use PLong directly avoding all this confusion.
2014-05-04 00:17:27 +02:00
cinap_lenrek 9cc9d6113c gs: fix truetype interpreter for amd64 2014-05-04 23:31:59 +02:00
ftrvxmtrx d2c3185bfa fix threadsetname usage in few places 2014-05-03 13:07:52 +02:00
ftrvxmtrx 306bee92e1 uniq: use Bsize for buffers 2014-05-03 10:48:13 +02:00
cinap_lenrek 4c639475ce cwfs: fix 1GB memsize limitation
the malloc pool allocator is limited in its allocation
size. as almost all data structures in cwfs are never
freed, use brk() in ialloc() instead of mallocalign().
this means memory returned by ialloc() cannot be freed!

to make sure we do not call free by accident, remove
the #define malloc(n) ialloc(n, 0) macro and use ialloc()
directly as in the original code to show the intend
of permanent allocations.
2014-05-03 00:51:45 +02:00
ftrvxmtrx 72e4d850a4 wc: simplify and avoid buffer overflow on long filenames 2014-05-03 23:38:17 +02:00
cinap_lenrek bd3e9e4b7c 1l, 2l, 7l, kl, vl: add missing setmalloctag() dummy in compat.c 2014-05-02 05:17:40 +02:00
ftrvxmtrx e610c573d7 samterm: free() after getenv() 2014-05-02 03:47:18 +02:00
cinap_lenrek 391198888a 8c, 6c: fix peephole bug for eleminating CMPL $0,R after shift
the shift instructions does not change the zero flag
when the shift count is 0, so we cannot remove the
compare instruction in this case.

this fixes oggdec under 386.
2014-04-28 22:53:50 +02:00
ftrvxmtrx 7b8f4b25be btc mkfile: mkdir -p 2014-04-28 22:39:12 +02:00
ftrvxmtrx 6a905b4560 tr: fix 4-byte runes fix (thanks rsc) 2014-04-26 14:26:40 +02:00
cinap_lenrek 0753d7852d revert previous change, i was confused. 2014-04-24 22:02:47 +02:00
cinap_lenrek 634b40fe27 nusb: use ep->addr instead of ep->id in unstall() library function
this is not a bug, but using ep->addr makes the intend more clear.
2014-04-24 22:00:31 +02:00
ftrvxmtrx 70d7f4c32a nusb/rndis: avoid allocation on each transmission
The slack space for outgoing packets set to 44+16 bytes.
2014-04-23 21:20:11 +02:00
cinap_lenrek 41908149de nusb: resolve endpoint id conflict with different input and output types
ftrvxmtrx repots devices that use the endpoint number for
input and output of different types like:

 nusb/ether:             parsedesc endpoint 5[7]  07 05 81 03 08 00 09	# ep1 in intr
 nusb/ether:             parsedesc endpoint 5[7]  07 05 82 02 00 02 00
 nusb/ether:             parsedesc endpoint 5[7]  07 05 01 02 00 02 00	# ep1 out bulk

the previous change tried to work arround this but had the
concequence that only the lastly defined endpoint was
usable.

this change addresses the issue by allowing up to 32 endpoints
per device (16 output + 16 input endpoints) in devusb. the
hci driver will ignore the 4th bit and will only use the
lower 4 bits as endpoint address when talking to the usb
device.

when we encounter a conflict, we map the input endpoint
to the upper id range 16..31 and the output endpoint
to id 0..15 so two distinct endpoints are created.
2014-04-23 20:03:01 +02:00
ftrvxmtrx 2ef8c9ed41 nusb: workaround for endpoints with same index but different types
nusb code assumes endpoint numbers are unique.  It's true in general
case, but it becomes false once the direction bit is ignored.  The
commit adds a check so that two endpoints of different types are not
merged into one with Eboth direction.  It does overwrite endpoint
though, so it shouldn't be considered as a full fix.
2014-04-23 23:45:00 +02:00
ftrvxmtrx 99c0abc76d nusb/ether: add RNDIS support (tested on Nexus 5) 2014-04-22 23:34:52 +02:00
cinap_lenrek b94c766fef nusb: dont include <bio.h>, we'r not using it (thanks erik) 2014-04-19 16:18:39 +02:00
cinap_lenrek 8d0e4cf37b wpa support for tcp boot, remove duplicate secstore code from factotum
to run aux/wpa at boot, we need factotum to be running. tho
factotum was started only after the network was configured.

what we do now is start factotum early, not fetching keys
from secstore. once network is available and the auth server
is known, we fetch keys from secstore using auth/secstore in
bootrc.

to pass the authserver for p9 authentication to factotum, we
write it in /net/ndb and the special _authdial() in factotum
will picks it up.

as we are using auth/secstore binary in any case, we remove
the duplicated secstore code from factotum and make it just
exec auth/secstore to fetch the keys on startup (unless -n
or -S is specified).
2014-04-18 20:55:41 +02:00
cinap_lenrek 6a7ba3d24a secstore: fix wrong "readnvram %r" error status 2014-04-18 20:41:43 +02:00
ftrvxmtrx 9204ed8910 nusb/kb: fix trackpoint on thinkpad usb keyboard
The trackpoint has no subclass, but it's still a pointer device.
Also close the device while we are here.
2014-04-18 16:43:43 +02:00
cinap_lenrek d9ea4a71b9 secstore: fix gfile/pfile/rfile array sizes
need to have one more entry for terminating nil
2014-04-17 18:57:58 +02:00
cinap_lenrek 75079ab18c vga: add support nVidia 7600GS (and possibly 7950) (from kenji okamoto) 2014-04-15 09:40:41 +02:00
cinap_lenrek 7058640179 webfs: do not unescape escape 2014-04-03 09:44:48 +02:00
cinap_lenrek 8515f4ecb7 eqn: fix parallel build (thanks eekee)
dont just mv y.tab.c, this can cause y.tab.c and y.tab.h to
be accidently regenerated breaking parallel build.
2014-04-03 23:20:48 +02:00
cinap_lenrek 50e2c9b4d4 sam, acme: fix character classes quoting for 21-bit runes
quote handling was broken with 21-bit runes. nextrec()
returned quoted rune as long rune | (Runemax+1) to escape
it.

with 16-bit runes, storing that long into 16-bit Rune
would automatically remove the escaping, but with 21-bit
runes, Rune is uint32 so the escaping would remain. we
now use (Runemask+1) instead, and mask the escaping off
explicitely when storing back to Rune.
2014-04-01 06:04:00 +02:00
cinap_lenrek 0c1dd57544 grep: fix tab2, use int instead of Rune to be compatible to 16bit rune system 2014-03-30 18:11:51 +02:00
cinap_lenrek 4d0a446123 grep: fix wrong rlcass splitting (thanks erik and kenji)
add 0xffff to tab1 as range 0xffff-0x10ffff has 4 byte utf-8 sequence.
use Runemax (0x10ffff) instead of Runemask (0x1fffff) to denote
the last valid rune for inverted [^] match as Runemask is out of the
valid rune space.
2014-03-30 04:29:04 +02:00
cinap_lenrek cde97a4d5f 6c, 8c: optimize away CMPL/CMPQ reg, $0 instruction in peephole pass
when the previous instruction sets the zero flag,
we can remove the CMPL/CMPQ instruction.
this removes compares for zero/non zero tests only.
it only looks at the previous non-nop instruction
to see if it sets our compare value register.
2014-03-29 19:44:04 +01:00
BurnZeZ 91bed257fa ramfs: fix srvname; postmountsrv() already prepends /srv/ 2014-03-26 16:48:40 -04:00
cinap_lenrek 1641d9908b audio/oggdec: wait for pcmconv child process to exit
we have to wait for the pcmconv process to exit before
exiting yourselfs because otherwise pcmconv could
keep /dev/audio open and prevent further reopens for
a short period of time.
2014-03-26 18:39:58 +01:00
cinap_lenrek ffb120199a auth/login: find authdom instead of using hardcoded cs.bell-labs.com (thanks erik) 2014-03-23 18:10:04 +01:00
cinap_lenrek 393dfd1ced 8c, 6c: fix mulgen botch error for handling multiplication by zero constant 2014-03-21 19:05:17 +01:00
cinap_lenrek 1c2fc52081 ramfs: replace with new lib9p based implementation
old ramfs had a limit on the number of files it could serve
and file size was limited to maximum allocaiton size.

the new implementation uses multiple memory chunks to back file data
in a private compactable memory pool to overcome these limits.
files can be sparse. file metadata is maintained by 9pfile data
structures of lib9p.
2014-03-14 21:15:16 +01:00
cinap_lenrek ff677a1cb4 cpu: make -p work with explicit service in dialstring (same as import) 2014-03-14 03:54:08 +01:00
cinap_lenrek 8fb212515d import: make import -p work with explicit service in dialstring (thanks mischief)
mischief → ; import -p tcp!9.offblast.org!17007 / /n/9
mischief → -> import: can't mount /: EOF receiving fversion reply
mischief → on the console
mischief → bmo Mar 13 18:55:30 dialing tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 reconnected to tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 connected from 199.191.58.44
mischief → bmo Mar 13 18:55:34 exiting...bmo Mar 13 18:55:30 dialing tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 reconnected to tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 connected from 199.191.58.44
mischief → bmo Mar 13 18:55:34 exiting...
mischief → aan is dialing the *exportfs* port because i explicitly specified it
2014-03-14 03:48:26 +01:00
cinap_lenrek eed4871674 exportfs: avoid closing netfd in filter()
netfd is initially zero (stdin), when filter() closes fd0,
fd0 is free to be reused. this causes problems with openmount()
that assumes sfd being >2.

instead, we dup the our pipe end over netfd, and close the pipe.
2014-03-11 07:03:15 +01:00
cinap_lenrek 760b3d0667 5e: remove newline from suicide string 2014-03-10 23:20:01 +01:00
cinap_lenrek 3aeca15d3c 5e: trap unaligned memory access 2014-03-10 23:16:47 +01:00
aiju 26a8accad2 nusb: added joy 2014-03-09 18:03:07 +01:00
cinap_lenrek f05af31f36 5e: fix amd64 2014-03-08 21:07:57 +01:00
stanley lieber 0c005b5105 mothra: handle blank lines inside <pre> tags 2014-03-07 11:44:05 -05:00
cinap_lenrek f88d0c372d nusb: fix loaddevstr() (thanks erik quanstro and richard miller)
loaddevstr() should request 256 bytes, as per standard and
respect the length embedded in the string.
2014-03-06 22:53:20 +01:00
mischief 077a4dbe48 cpu: remove unused connection directory buffer 2014-03-04 07:46:16 -08:00
cinap_lenrek f7ab9fb52a pcmconv: revert previous change, fix dither clipping
previous change had forgot how dithering works... m(

we *really* add a random signal when *reducing* the number
of bits. just make sure we do not overflow like in
mixin().
2014-03-03 14:45:14 +01:00
cinap_lenrek 7fc7802358 pcmconv: fix dither clipping
the check in dither() was inverted. we should only
add noise when the output bit count is greater
than input bit count (samples shifted up) to
fill the lower zero bits produced by the shift.
2014-03-03 09:00:59 +01:00
cinap_lenrek 2750062701 cc: correct out-of-bounds references in funct.c (thanks charles forsyth) 2014-03-02 21:08:48 +01:00
cinap_lenrek c4fec93ab9 python: add buffer length check in sock_recvfrom_into() 2014-02-25 18:51:03 +01:00
cinap_lenrek 0181117b5f fork filter procs with RFREND in various programs 2014-02-21 05:32:20 +01:00
cinap_lenrek fef5c8e4ca aux/listen: rfork with RFREND
child processes handling the connection should be all
independent of each another and not share rendezvous
group. the rendezvous group sharing caused a bug in
exportfs when we switched from using pid to memory
address as rendezvous tag.
2014-02-21 05:29:43 +01:00
cinap_lenrek 40d71baf7f exportfs: bring back the changes, bug was due to rendezvous group being shared by listen
exportfs used pid of slave proc as rendezvous tag. when we
changed it to use Proc* memory address, there where tag
collisions because listen didnt fork the rendezvous group (bug!).

for now, just do rfork(RFREND) in main just in case.

will fix aux/listen in a follow up changeset.

--
cinap
2014-02-21 05:23:21 +01:00
cinap_lenrek 1281b234e8 exportfs: reverting previous changes
getting strange tag mismatches on some machines. needs
to be debugged. until then, reverting the change.
2014-02-21 01:02:32 +01:00
cinap_lenrek 9c40e15ba8 exportfs: fix flush races, proc sweeping 2014-02-18 22:15:06 +01:00
cinap_lenrek 152c9d525b aux/cpuid: hack for amd64 2014-02-17 19:50:02 +01:00
aap cd27c0cca2 xd: changed -s option to switch to little-endian units 2014-02-16 21:32:14 +01:00
cinap_lenrek ae41f49f09 mothra: remove unused local variables from pl_nextc() 2014-02-16 19:40:50 +01:00
cinap_lenrek 218e1b4b3e mothra: fix unicode rendering for plaintext
we did the utf-8 to unicode conversion in pl_nextc(),
but the plaintext handler uses pl_readc() which only
translates newlines but otherwise returns bytes.

move unicode conversion in pl_readc() fixes it.
2014-02-16 18:50:30 +01:00
cinap_lenrek e42981dfcf factotum/authsrv: fix padding for mschap on amd64, use constants for structure sizes 2014-02-15 19:57:13 +01:00
cinap_lenrek 14770ad188 page: fix compiler warning 2014-02-14 15:01:14 +01:00
cinap_lenrek 82cec6f585 socksd: close inside udp server one we get a connection (udprelay) 2014-02-14 14:57:05 +01:00
cinap_lenrek 81ea3f24fa cifsd: fix compiler warning 2014-02-14 14:21:07 +01:00
cinap_lenrek fc78640118 nusb/ether: fix pointer truncation 2014-02-14 14:18:09 +01:00
cinap_lenrek dd4a487b0e webfs: fix compiler warning 2014-02-14 14:14:17 +01:00
cinap_lenrek 80deec0a7b ip/torrent: remove unneeded assignment 2014-02-14 14:12:02 +01:00
cinap_lenrek 872f83cebe ramfs: remove mainmem pool limit when called with -u flag 2014-02-10 04:04:51 +01:00
cinap_lenrek e37ff43eb6 acid: remove objchar, prefering foobar.$objtype.acid
acid already sets up objtype for us.
2014-02-10 01:53:26 +01:00
cinap_lenrek 37de63aec3 cc: emit right acid format for address
we could use 'A' here but then it would require the new acid.
2014-02-10 23:10:47 +01:00
cinap_lenrek de356dd855 acid: update acid libraries for amd64 2014-02-10 23:07:37 +01:00
cinap_lenrek 16acf605e2 acid: make 'a' and 'A' format to have the same size as mach->szaddr
to make it easier to write portable acid code, we
introduce 'A' format in the same meaning as in db(1):

A    Print the value of dot in hexadecimal.  Dot is
     unaffected.

both 'a' (symbolic) and 'A' will both have 64 or 32 bit
size depending on the mach, so pointer array indexing
works the same.
2014-02-09 22:43:09 +01:00
cinap_lenrek 9d8f5a1466 acid: fix memory corruption due to gc
we cannot call gc() in execute() because it will gc
anonyous intermediate results which happens when we
construct a list and the elements are calculated by
calling a function thru ocall() which calls execute().

also, the _thiscmd symbol; which is used to keep
a reference to a statement so it wont get garbage
collected; does not work as yyparse() is recursive
(include statements).

we add execrec() function which *only* gets called from
yyparse() when evaluating a statement. it will
keep a stack on the _thiscmd symbol handling the yyparse()
recursion.

we also only call gc() in execrec() before calling
execute(). so execute() will never gc() while evaluating
a statement which prevents the intermediate results
from getting collected.
2014-02-09 01:37:05 +01:00
cinap_lenrek 7af85b9e74 jpg: center image in screen
when using the jpg(1) programs interactively, draw the
image in the center of it. this avoids wasting space
with always on borders on small windows and looks better
when used in fullscreen.
2014-02-08 02:33:29 +01:00
cinap_lenrek 9c99675c1c aux/vga: fix format string error with 6c 2014-02-08 00:29:06 +01:00
cinap_lenrek 88cc09a580 cwfs: limit memsize() to 1GB until pool can handle huge allocations 2014-02-07 23:33:34 +01:00
cinap_lenrek f029ea1694 have to use NULL instead of nil for ape programs... 2014-02-05 19:52:09 +01:00
cinap_lenrek c76243e7e5 fix wrong type for terminating nil argument for execl()
we have to use (void*)0 instead of (int)0 otherwise the
upper bits are uninitialized on amd64.
2014-02-05 19:25:24 +01:00
mischief 492958f08e libpanel: remove pointless pointer casts 2014-02-04 00:16:36 -08:00
cinap_lenrek 8c4a02a29b merge 2014-02-05 08:58:53 +01:00
cinap_lenrek 9f99edda55 mothra: better handling of malformed search regex 2014-02-05 08:43:31 +01:00
mischief ffcac11a5a libpanel: fix pointer casts and format strings 2014-02-04 23:34:19 -08:00
cinap_lenrek 0b1c655160 mothra: dont panic on invalid regular expression in searchbox 2014-02-05 08:25:01 +01:00
cinap_lenrek b7be695d5c hjfs: fix wrong channel size for syncb (fixes amd64 crash) 2014-02-04 01:58:17 +01:00
cinap_lenrek 88505bff06 realemu: cleanup opidiv
no need for switch here, just calculate the values. also fixes
6l warning about uninitialized min/max (compiler assumes none
of the case statements could match).
2014-02-03 22:55:45 +01:00
mischief ddd51650d8 acid: fix memory leak in fundefs (from 9atom) 2014-02-02 03:17:48 -08:00
cinap_lenrek 03d26f8087 cwfs: use pragma pack for on disk structures for amd64 2014-02-01 20:26:36 +01:00
mischief 4092bdbb2e realemu: actually mark 0xE0000 writeable 2014-02-01 12:56:59 -08:00
mischief 1fe36bf849 realemu: implement IDIV, mark 0xE0000 writeable, fix DIV overfow trap 2014-02-01 12:27:07 -08:00
mischief 08bb4afb52 acid: use correct print flags and casts for shorts in fmt 2014-02-01 12:14:30 -08:00
mischief abb4bad701 ip/torrent: print tracker errors/warnings in debug mode and allow setting peerid 2014-02-01 12:04:30 -08:00
cinap_lenrek cc24222672 fixes for new setmalloctag() prototype 2014-02-01 10:29:14 +01:00
cinap_lenrek 8006695405 gs: amd64 support 2014-02-01 10:28:33 +01:00
cinap_lenrek 2dbdfe8ac7 python: amd64 support 2014-02-01 10:27:57 +01:00
cinap_lenrek 010af9ba12 6l: fix warning, setmalloctag declaration, missing header type cases 2014-02-01 09:52:06 +01:00
cinap_lenrek 6a83facfb3 rio: properly handle initial wrap arround in wlook() 2014-01-11 10:46:07 +01:00
cinap_lenrek 7c503e6f49 rio: implement "look" (thanks lf94) 2014-01-11 10:14:35 +01:00
cinap_lenrek fc88896fc1 mixfs: make mixbuffer addition atomic
serialize mixing with spinlock to make the addition
on the mixbuffer samples atomic.
2014-01-10 14:51:29 +01:00
mischief a872d5241e winwatch: this is not about sanity. rows might be negative 2014-01-08 21:32:27 -08:00
mischief 8319457a10 winwatch: prevent divide by zero if the window height is too small 2014-01-08 20:52:40 -08:00
cinap_lenrek ce2487c3cc mothra: remove version 2014-01-07 02:57:39 +01:00
cinap_lenrek f912e01854 rio: make scrollwheel handling consistent with sam
scrollwheel now works proportional to y mouse position.
special case is when shift is hold down. then scrollwheel
will work like before and scroll one line up or down.
2014-01-05 02:37:42 +01:00
stanley lieber 02d22e158d mothra: mouse scrollwheel behave the same as in sam 2013-12-31 00:52:52 -05:00
cinap_lenrek 8cef1794d6 mothra: add regular expression text search (thanks mischief, sl)
this works differently from mischiefs original patch. instead of
overloading the address bar, we popup our own enter box. the
function can be invoked from the menu or by hitting ^F.
2013-12-28 21:48:53 +01:00
cinap_lenrek 59d8c24f58 page: fix page bookmarks for epub files 2013-12-28 06:49:51 +01:00
cinap_lenrek 7d9ae4883d audio/mixfs: implement Tstat to obtain buffer size, better underrun handling 2013-12-27 20:39:56 +01:00
cinap_lenrek b9bec46b98 add audio/mixfs to allow simultanious playback streams over a single /dev/audio 2013-12-26 21:04:25 +01:00
cinap_lenrek 1059da0066 page: scrollwheel, better backwards scrolling, fix blit bug when page was translated offscreen 2013-12-23 15:38:52 +01:00
cinap_lenrek 48d2f14f80 page: implement bookmarks (thanks trav_ for starting it)
add new functions pageaddr() that returns a string describing
the page to be loaded. it is in the form of:

/path/to/file!pagename!subpage!....

one can jump to such a page by calling trywalk(name, addr)
where name and addr get concatinated with ! to form a page
address and then the currently loaded pages are walked up
to the nearest page which is then returned. (or nil when
not found). the remaining address will be set in the global
pagewalk variable.

once pages get loaded (asynchronously), pagewalk1() gets
called again on addpage() and continues the walking up to the
last page.

new program flag -j <addr> was added to jump to a page on
startup.

page address (without filename) can also be supplied in
plumb message with the "addr" attribute.
2013-12-21 18:04:14 +01:00
cinap_lenrek 56300f72e8 rio: dont consider shell characters as part of the filename for auto completion
rio looks backwards in the line for the beginning of a filename
that needs to be completed with ^F. this change makes the
characters: =, ^, ( and { stoppers, so filename completion
will work in all these cases:

foobar=/foo/ba^F; for(i in (fo^F ba^F)){/bin/baz^F

this means completion will not work for prefixes having these
special characters in them.

thanks to burnzez for bringing it up.
2013-12-19 18:12:16 +01:00
cinap_lenrek 35484945e2 exportfs: get rid of limits, cleanup
get rid of the service buffer limit. keep service buffers
on a global freelist protected by lock.

dont fatal when we hit the process limit. instead, just
abort the rpc with an error.

handle rendezvous() interrupts.
2013-12-15 07:49:53 +01:00
cinap_lenrek 3c8db40def factotum: add ntlmv2 (mschap2) client auth for cifs 2013-12-11 05:48:48 +01:00
cinap_lenrek 193e55b88c cifs: fix compiler warning 2013-12-08 08:38:44 +01:00
cinap_lenrek 007520e3fe handle NIL user domain, and Z(4) at end of nt blob for ntlmv2
the nt blob ends with 4 zero bytes, this is not the same as
the EOL av-pair terminator!

this makes ntlmv2 work with windows xp with LmCompatibityLevel = 3
2013-12-08 08:34:31 +01:00
cinap_lenrek c940e98630 experimental ntlmv2 server authenticaion support for cifsd
extending factotums and the auth servers mschap implementation
to handle variable length NT response for NTLMv2.

fix some minor bugs.

only tested with cifs so far.
2013-12-08 02:22:12 +01:00
cinap_lenrek e2da074d28 gif: remove warning when animated gif is rendered to bitmap 2013-12-07 00:53:01 +01:00
cinap_lenrek 66cc2fa960 mothra: remove debug code, dont create $home/lib/mothra/mothra.err file 2013-12-07 00:51:19 +01:00
cinap_lenrek f6887b0a3c telnet: simplify previous change by moving the notkbd check into consctlcmd() 2013-12-05 22:43:44 +01:00
cinap_lenrek 5c000bbe63 cpu: add -n flag for the remote site to allow "none" authentification method (inspired from sources cpu-noauth patch) 2013-12-05 22:39:43 +01:00
cinap_lenrek 919863dab3 telnet: disable changing raw mode when a pipe was being used (from sources telnet-notkbd patch)
This patch corrects a minor problem with telnet when using
the notkbd option (-n).
2013-12-05 22:05:57 +01:00
cinap_lenrek ad3ba8838d ndb/dns: check bad name length in convM2DNS.c:^gname() 2013-11-28 23:47:49 +01:00
cinap_lenrek b77eda8fc7 u9fs: fix misuse of Fcall.afid in p9any authentication module. (from sources patch/u9fs-afid)
U9fs(4) misuses Fcall.afid in its p9any authentication module.

The afid field of Fcall structure is only valid with Tauth or Tattach.
Tread, Twrite, Tclunk should use rx->fid instead.  It's been lucky so
far to get the job done because rx->afid survives from previous
Tauth/Tattach.  The issue pops up when several authentications happen
concurrently.

Test case:
	u9fs = 'host with u9fs on tcp!*!564'
	9fs $u9fs; for(i in 1 2 3 4 5 6 7 8){ 9fs $u9fs & }; wait
Should:
	no errors
Should not:
	mount failed: authentication failed
2013-11-28 23:06:03 +01:00
cinap_lenrek da6a10c417 ndb/dns: do dnresolve() loopcheck only on hosts that we havnt already tried
we might get a unreachable nameserver ip from a parent
nameserver. if the remaining set of nameservers does not
loop, we should try to resolve them.

so skip the loopcheck for nameservers already tried.
2013-11-26 22:31:23 +01:00
cinap_lenrek 707698ce10 abaco: make validurl() accept internationalized domain names
validurl() is just used to check if the string is a full
absolute url with a protocol scheme. we do not have to
match the host part *exactly*, only if there is *something*
in the hostpart.
2013-11-25 23:04:06 +01:00
cinap_lenrek 1561f0c4ea webfs: preserve unicode hostname, only convert to ascii when sending over the wire
we'd like to keep Url.host in unicode for factotum key
lookup. only when we send the url in a request, we have
to convert it to ascii.
2013-11-24 21:28:48 +01:00
cinap_lenrek f2bd1de5bd webfs: support for internationalized domain name urls 2013-11-24 11:56:33 +01:00
cinap_lenrek 3720b5ab9c ndb/dns: add support for internationalized domain names 2013-11-24 11:55:26 +01:00
cinap_lenrek 94fd92cb69 kbdfs: fix ctlr+alt+del with new escape pages 2013-11-24 09:07:28 +01:00
cinap_lenrek c2319f37b4 ndb/dns: ignore refused (5) error replies 2013-11-23 04:46:14 +01:00
cinap_lenrek 2f9ae0f8ac removing (outdated) drawterm
drawterm is much better maintained by russ cox,
so removing this outdated copy.

for a more recent version, go to:

http://swtch.com/drawterm/
2013-11-23 01:05:33 +01:00
cinap_lenrek ea5797c073 kbdfs: add esc1+shift and esc1+ctrl pages (see sources kbmap-uk-weird patch)
Add pages for esc1+shift and esc1+ctrl - some UK USB keyboards (Dell) and it seems some
German ones: https://groups.google.com/forum/#!topic/comp.os.plan9/ycok6NTCWCg seem to
generate an esc1 + code scancode combination for the pipe/backslash key. Seems like
overkill to add two whole pages for just two keys, but there again RAM is cheap these days.

Probably should take the changes across to omap/kbd.c (and by extension bcm/kbd.c)
but the changes are trivial.
2013-11-23 00:50:15 +01:00
cinap_lenrek 91c7e0b127 acme: fix arrow key oddity (thanks mark van atten and erik)
from 9atom/acmearrowfun patch:

	reported by mark van atten

		In Plan 9 acme, if you type

		{}

		then go back and type text between the brackets

		{Curiouser and curiouser!}

		the right arrow is blocked when you want to go over the closing
		bracket to continue typing to its right. (If you first go to the left,
		and then back to the right, it works.)

		Same for the other brackets: [ ], ( ), < >.

	noted that brackets are not necessary.  same behavior with any
	character.

	fix is to textcommit before moving.
2013-11-22 19:19:37 +01:00
stanley lieber 66fea232bc rio -b: make lighttitlecol darker 2013-11-20 18:40:51 -05:00
cinap_lenrek 2cc152f9e1 ndb/dns: filter dns answers avoiding cache poisoning
only cache what we asked for or need to resolve the
query. filter out everything else.
2013-11-20 22:35:52 +01:00
cinap_lenrek 9155b30f6d ndb/dns: another attempt...
we have to fail the whole query that got no cached
nameservers and nameservers are looping, not just omit
the looping nameserver. issuequery() will refresh
nameserver info for the domain when recursing up.
2013-11-17 06:55:39 +01:00
cinap_lenrek c45386588b ndb/dns: detect query loops
never try to resolve a nameserver address when that nameserver
is in the set of nameservers already being queried.

this situation can happen when the Ta and Taaaa RR's expire, but
the Tns records are still in the cache so there is no usable
nameserver but they still refer to each another.
2013-11-16 04:42:09 +01:00
cinap_lenrek 5f87d8dcc8 ndb/dns: various changes
stop absolute/relative dual use of RR.ttl. now RR.ttl is
*always* the *relative* ttl value. we derive absolute
timeout in RR.expire.

remove unused lookuptime field in DN. replace refs and
keep with mark field in DN. we do not care about the
number of references. only *iff* it is referenced, so
use a single bit for that (bit 0). for keep, we use
bit 1.

remove dolock parameter in dnagenever(), it is not
needed. we always need to lock.

mark local dns servers and domains as never to be aged.

the keeper bit is *just* a cache optimization, preventing
the domain and the domains it points to from being flushed.
it should not be used as a write protect bit in rrattach()
for preventing spoofing as it will prevent updates of say,
cname domains.

remove "removing spam ..." message. these are usualy just
hints, so normal. still, remove the hint as we currently
do no check if the nameserver has authority over the
cname domain.

remove "mydnsquery: trying to send to myself (%s); bzzzt"
message. this can happen when myaddr() fails for other
reasons. myaddr() will print error for us anyway.
2013-11-15 02:00:47 +01:00
cinap_lenrek 2ce68c5aa1 ndb/dns: case sensitive ndb attributes, Domlen consistency, dblookup() inplace lower case conversion, cleanups
ndb keys are strictly case sensitive, so consitently
use strcmp() when comparing attribute keys.

dblookup() used to lower case convert its name argument
inplace to match domain/sys name in ndb. better to do
the convesion in its own buffer and only read from the
name argument.

always use cistrcmp() when comparing DN.name.

the Domlen constant denotes the size of the buffer including
the null terminator. consistently use it as such.

have to hold dnlock in freearea() before reading list
head pointer.
2013-11-13 18:44:45 +01:00
cinap_lenrek 18e515511f acidleak: show free blocks as free (leak -b) 2013-11-08 17:42:15 +01:00
cinap_lenrek a60001871e mp3dec: fix volume for mp3dec
the libmad samples need to be scaled properly. the
previous assumption was that it is 32 bits, but it
really is MAD_F_FRACTBITS + sign bit and rest used
for overflow.

thanks eekee!
2013-11-06 22:18:36 +01:00
cinap_lenrek 118cf5e36a rio: eleminate temporary allocations before frinsert() and in namecomplete()
frinsert() shouldnt modify the runes passed and the
buffer isnt going to be modified my us during the call
so removing the temporary copies.

namecomplete() makes utf-8 copies of the rune strings so
theres no need to copy the runes.
2013-11-05 08:00:26 +01:00
cinap_lenrek c5a70cc23d rio: do backspace \b processing inplace avoiding buffer allocation 2013-11-03 04:03:38 +01:00
cinap_lenrek 9619a621ac rio: cleanup and error handling 2013-11-03 00:34:35 +01:00
cinap_lenrek bcad0cd4e6 rio: huge simplification of flush handling
xfidflush() now uses a simpler way to flush another xfid.

when we can send to Xfid.c channel, we know that the
xfid is completed. so all xfidflush() needs todo is to
do an alt sending to both Xfid.c and Xfid.flushc.

once the send to Xfid.c succeeds, we know the xfid is gone
and we can respond to the flush request.

theres no need to keep track of flush state anymore. so
Xfid.active and Xfid.flushing can be removed.

note, that it is ok to respond normally to a currently
flushed request.
2013-11-02 17:54:42 +01:00
cinap_lenrek 837918ee5e rio: add sanity check in xfidallocthread() 2013-11-01 21:28:03 +01:00