Commit graph

3929 commits

Author SHA1 Message Date
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
cinap_lenrek bedffdd8c3 devenv: prevent non-hostowner from creating or removing variables in '#ec', cleanup 2014-08-13 23:09:47 +02:00
cinap_lenrek 55bf3d6399 ip: fix missed unlocks and waserror handlers
ipifcunbind() could error out from ipifcremlifc() and Medium.unbind()
*after* decrementing ifc->conv->inuse! move the decrement after
calling these functions.

make ipifcremlifc() never raise error but return error string.
the only places where it could error is when it calls into
medium functions like Medium.remroute() and Medium.remmulti().
Ignore these errors as they could happen when the ethernet driver
crashed (think imported ethernet device or usb ethernet
in userspace), so we will be able to unbind.

add waserror() handlers as neccesary to deal with errors from
Medium.addmulti(), Medium.areg() and arpenter() to properly
unlock the data structures.
2014-08-12 21:35:31 +02:00
mischief 53619de428 aux/8prefix: fix usage 2014-08-12 10:33:47 -07:00
mischief b0d7ade423 secstore(1): clarify how the server is dialed and add new $secstore environment variable 2014-08-10 20:38:59 -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
stanley lieber e17025174a fortunes: it´s easy but you are complicated 2014-08-10 19:04:20 -04:00
stanley lieber 443b046bff fs(8): correct spelling 2014-08-10 19:00:55 -04: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 daa15d1edb kernel: more nil vs 0 cleanup in chan.c 2014-08-08 17:02:10 +02:00
cinap_lenrek ee6409366e kernel: use nil for pointers instead of 0, zero channel umc and dirrock in newchan() 2014-08-08 16:44:41 +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 45333cdc92 devmnt: fix potential race with mntflushfree(), remove mntstats, 0 vs nil cleanup
when mountmux() completes a request for another process, enforce odering
of the loads and stores to the request prior to writing q->done = 1
so mntflushfree() sees q->done != 0 only when the request has actually
completed. otherwise, the q->done = 1 store could have been reordered
before the load from q->z, reading from already freed request and causing
spurious wakeups.

removing unused mntstats callback.

use nil for pointers instead of 0.
2014-08-08 23:28:47 +02:00
cinap_lenrek bc306a5a63 8c, 6c: generate enam.c file, just like 5c 2014-08-07 21:35:52 +02:00
cinap_lenrek 0a101736b8 pc, pc64: make pc kaddr() check reject -KZERO address (thanks aiju) 2014-08-07 21:11:11 +02:00
cinap_lenrek d304dc8119 5a, 5l: add LDREX/STREX/CLREX instructions 2014-08-07 20:22:00 +02:00
cinap_lenrek ca4f815cfc pc64: fix wrong Ureg* argument on note handler (thanks _sl!)
_sl reported crash:

stats 593: suicide: sys: trap: fault write addr=0xffffffff8258d1b0 pc=0x204cc7

; acid 593
/proc/593/text:amd64 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/amd64
acid: lstk()
notejmp(ret=0x1,j=0x40ac90)+0x13 /sys/src/libc/amd64/notejmp.c:10
alarmed(a=0xffffffff8258d1b0,s=0x7ffffeffea58)+0x3f /sys/src/cmd/stats.c:718
notifier+0x3e /sys/src/libc/port/atnotify.c:15
acid:

note how a in alarmed is a kernel address!

the first Ureg* argument is passed to the note handler in the
RARG (BX) register, which was not loaded when returning to
userspace from syscall() thru forkret(). fix by returning thru
noteret() from syscall().
2014-08-07 19:55:25 +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
ftrvxmtrx d14b6a0bf9 usps: yet another update 2014-08-01 20:44:58 +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
cinap_lenrek 98d518cc8c fstype: fix kfs detection (thanks kenji okomoto) 2014-07-30 20:34:45 +02:00
stanley lieber a39ce6a934 fortunes: From: urielc@cantv.net 2014-07-30 12:11:58 -04:00
stanley lieber e7a3cd0fd0 spred(1): fix troff 2014-07-30 12:09:35 -04:00
aiju 712fd30652 added sprite editor spred 2014-07-30 15:57:14 +02:00
stanley lieber 555a05018b fstype(1): document hjfs 2014-07-29 22:32:16 -04: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
mischief 2bdd2663db ratrace(1): uses syscall not syscalltrace file 2014-07-22 23:40:53 -07:00
stanley lieber e42d8492c6 fortunes: I wanted to do something that didn't involve arguing online about trivia. -- jwz 2014-07-22 18:41:36 -04:00
stanley lieber de8752e45e sega(1): add man page for games/md (and potential future sega emulators) 2014-07-22 18:29:33 -04:00
stanley lieber 0d909ae6ab nintendo(1): document snes 2014-07-22 17:44:46 -04:00
stanley lieber 33592e9d7c games/md: add -2 -3 -a and trailing newline to usage 2014-07-22 17:38:44 -04:00
stanley lieber 69eb0cd713 games/snes: add -a -h -m -T to usage 2014-07-22 17:00:32 -04:00
cinap_lenrek 6273bad12d ratrace: make multithreaded ratraces less confusing (for mischief) 2014-07-22 21:54:26 +02:00