Commit graph

3140 commits

Author SHA1 Message Date
cinap_lenrek 71dbddef16 draw: fix drawing of replicated source image on memlayer with a clip rectangle
when a replicated source image with a clipr with clipr.min > Pt(0, 0),
drawclip() would properly translate the src->clipr on the dstr
but then clamp the source rectangle back on src->r.

while traversing down multiple layers, this would cause the translation to
be applied multiple times to the dst rectangle giving the wrong image result.

this change adds a new drawclipnorepl() function that avoids the clamping
of source and mask rectangles to src->r and mask->r. this is then used in
libmemlayer.

the final memimagedraw() call will call drawclip() which will do the final
claming.

a testcase is provided:

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

Image *blue;
Image *red;

void
main(int, char *argv[])
{
	Image *i;

	if(initdraw(nil, nil, argv[0]) < 0)
		sysfatal("initdraw: %r");
	i = allocimage(display, screen->r, screen->chan, 1, DWhite);

	red = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DRed);
	blue = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPaleblue);
	replclipr(red, 1, Rect(10, 10, 110, 110));
	replclipr(blue, 1, Rect(11, 11, 111, 111));

	/* draw on non-layer, works correctly */
	draw(i, i->r, red, nil, ZP);
	draw(i, i->r, blue, nil, ZP);
	draw(screen, screen->r, i, nil, i->r.min);
	flushimage(display, 1);

	/* draw on (screen) layer is too far to the right */
	draw(screen, screen->r, red, nil, ZP);
	draw(screen, screen->r, blue, nil, ZP);
	flushimage(display, 1);

	for(;;){
		sleep(1000);
	}
}
2013-12-09 03:35:01 +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 d7f90a9096 kernel: simplify pexit(), avoid making wait record for RFNOWAIT (parentless) procs
replaced the p->pid != 0 check with up->parentpid != 0 so
p->pid == up->parentpid is never true for p->pid == 0.

avoid allocating the wait records when up->parentpid == 0.
2013-12-07 08:25:26 +01:00
cinap_lenrek 7761128093 devproc: make sure /proc/n/wait waits for the right process children
theres a race when we wait for a process children and that
process exits before we sleep().
2013-12-07 07:17:32 +01:00
cinap_lenrek 4fd55abb8e kernel: fix pexit() Waitmsg memory leak.
when a process got forked with RFNOWAIT, its p->parent will still
point to the parent process, but its p->parentpid == 0.

this causes the "parent still alive" check in pexit to get confused
as it only checked p->pid == up->parentpid. this condition is *TRUE*
in the case of RFNOWAIT when the parent process is actually dead
(p->pid == 0) so we attached the wait structure to the dead parent
leaking the memory.
2013-12-07 05:38:31 +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
stanley lieber a989f89f3e etheriwl.c: add did 4232 for intel wifi link 5100 (thanks, hmr) 2013-12-06 09:43:52 -05:00
cinap_lenrek 6e1c833585 libthread: avoid calling thread waiting for fork/execed process to finish if we dont have to
we do not need to wait for fork/execed program to finish when
not collecting waitmsg. this reduces the number of rio
processes hanging arround for each window shell just waiting
for it to terminate and then dumping the waitmsg.
2013-12-06 05:03:35 +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
stanley lieber 82defc8152 theo: Don't like it? Then walk away. 2013-11-24 22:11:46 -05:00
cinap_lenrek 0ef4ecc7aa faces: use 9front icon for googlecode.com/plan9front 2013-11-25 23:22:05 +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 214d37ce83 faces: add 9front.org/unknown (thanks qrstuv) 2013-11-23 22:08:19 +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 98f47d5867 kernel: more kproc pexit() and sleep error handling 2013-11-22 22:56:34 +01:00
cinap_lenrek 55d31f2cab pc kernel: kproc error and exit
catch the error() that can be thrown by sleep() and tsleep()
in kprocs.

add missing pexit() calls.

always set the freemem argument to pexit() from kproc otherwise
the process gets added to the broken list.
2013-11-22 22:29:31 +01:00
cinap_lenrek df6b68092c kernel: kproc error and exit
catch the error() that can be thrown by sleep() and tsleep()
in kprocs.

add missing pexit() calls.

always set the freemem argument to pexit() from kproc otherwise
the process gets added to the broken list.
2013-11-22 22:28:20 +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
stanley lieber 51137ada1a fortunes: That's the process. 2013-11-20 18:38:49 -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 e2d8b8170d /lib/roa: fix blank line at the end 2013-11-12 22:36:46 +01:00
cinap_lenrek cfc705b866 kernel: handle memimageinit() error 2013-11-12 21:43:38 +01:00
cinap_lenrek d56a6fadc5 libmemdraw: change memimageinit() to return integer error (for kernel), minor cleanups 2013-11-12 21:42:05 +01:00
cinap_lenrek def87d6016 devsd: fix scsi emulation for disks bigger than 4 billion sectors (from erik quanstros 9atom)
for read capacity (10 (0x25) if we have more than
4 billion sectors, we must not return nsectors % (1<<32),
we must return 0xffffffff.
2013-11-12 20:00:15 +01:00
BurnZeZ 983413de75 libjson: don't perform chartorune in getch() when char is null terminator, and remove empty string check added last commit 2013-11-10 03:35:25 -05:00
BurnZeZ f0483642be libjson: check for empty string in jsonparse() 2013-11-10 20:11:46 -05:00
BurnZeZ aad22f753f sdide: add pci did for VIA VT6415 PATA IDE controller 2013-11-10 19:40:01 -05:00
stanley lieber b0f7b9d80e arch(3): english 2013-11-10 18:44:33 -05:00
cinap_lenrek 235e06c988 arch(3), aml(2): document /dev/acpitbls file 2013-11-10 21:26:11 +01:00
cinap_lenrek a76d0bf6c5 ndb/common: add ipv6 addresses of root name servers 2013-11-10 19:35:33 +01:00
cinap_lenrek eb060fbfb1 aml(2): tabelize by function, move hardware linkage on separate page 2013-11-10 18:58:00 +01:00