Commit graph

4596 commits

Author SHA1 Message Date
cinap_lenrek bab31af707 cwfs: fix wstat() failing to mark block dirty when noatime is set
code assumed the accessdir() call would always mark the block dirty, but
this is not the case when noatime flag is enabled. this was reported by
michael in bug:

"open/with_noatime_option_cwfs_doesnt_preserve_changes_in_file_permissionowner"

--
cinap
2015-10-09 19:22:53 +02:00
cinap_lenrek 9ec1a07af2 libsec: clarify the code by declaring constant for DirectoryString and handle conversion in mkstring() 2015-10-09 18:52:32 +02:00
cinap_lenrek 6bb63f7832 libsec: use the right string encoding for various x509 fields
C= has to be PrintableString, E= and DC= are IA5String, everything
else is DirectoryString which can be PrintableString or UTF8String.
2015-10-09 18:31:49 +02:00
cinap_lenrek 4040ea7a5e wifi: quote value of parsed ether options
introduce wificfg() function to convert ether->opt[] strings
to wifictl messages, which needs quoting for the value. so
etherX=type=iwl essid='something with spaces' works.
2015-10-09 05:10:47 +02:00
cinap_lenrek b29e414bc6 merge 2015-10-08 17:16:06 +02:00
cinap_lenrek 2598a9e312 cc: restore side(), but do not consider OINDEX as side effect free
from charles forsuth:

because the previous version thought OINDEX might have a side effect, it
stopped it building a tower of them.
probably the best thing is to limit that anyway, since each one consumes
2-3 registers, so towering them can
keep even more active, and the x86 hasn't got that many.

the quick hack is to return that case to the earlier state by treating
OINDEX as a side-effect in side().
it's not a bad thing to do in the OSTRUCT case, for similar reasons: it's
better to collapse the indexed pointer
into a direct register, instead of repeating the indexing operation through
the copying of the value.
OINDEX isn't a machine-independent operation, so it doesn't affect the uses
in ../cc
2015-10-08 17:14:07 +02:00
mischief 08e2333cc1 port: fix typo in devmnt mntproc name 2015-10-07 21:45:03 -07:00
cinap_lenrek 285d96be4d doom: fix bogus pointer arithmetic, do sfx initialization in two passes for linked sounds 2015-10-08 00:37:54 +02:00
cinap_lenrek fa1f9f7ca6 cc: back out side() change unil 8c is fixed
this change made 8c fail to build libvorbis and gs, until this
is fixed we can live with non-optimal code.
2015-10-07 13:35:36 +02:00
cinap_lenrek 7c7acbef31 qc: import changes from charles forsyth 2015-10-07 09:40:48 +02:00
cinap_lenrek 4a916ba86e kc: import various changes from charles forsyth 2015-10-06 06:55:05 +02:00
cinap_lenrek fe3430ea99 cc: include $builtin as keywoard in pickle() (from charles forsyth) 2015-10-06 06:47:55 +02:00
cinap_lenrek 37d2856f55 cc: getflag() fmt will be terminated at end of loop (from charles forsyth) 2015-10-06 06:38:37 +02:00
cinap_lenrek 651b2a32be cc: allow runes as macro names (from charles forsyth) 2015-10-06 06:34:30 +02:00
cinap_lenrek 2d59b15c39 5c/6c/8c/vc: import various changes from charles forsyth
- cover more cases that have no side effects
- ensure function has complex FNX
- pull operators out of OFUNC level
- rewrite OSTRUCT lhs to avoid all side-effects, use regalloc() instead of regret()
2015-10-06 06:20:01 +02:00
cinap_lenrek 99ddc5b097 cc: TUSHORT -> TRUNE for lstring constats for OUSED 2015-10-06 05:20:00 +02:00
cinap_lenrek b33f4c0301 9660srv: do not ignore upper 32 bits of offset when reading directory 2015-10-05 04:45:32 +02:00
cinap_lenrek 0e09795831 dossrv: handle file offsets > 2^31
maximum file size is 4GB-1 as the file length is stored in
a 32 bit long. make sure it doesnt overflow on write or
or truncate. interpret the file length as unsigned. pass
vlong to readfile()/writefile()/truncfile() so we can
handle overflows and not just ignore the upper bits.
2015-10-05 04:31:31 +02:00
cinap_lenrek ec51877698 6c: remove 6c/vlrt.c file 2015-10-04 22:12:16 +02:00
cinap_lenrek 36876b9522 8c: dont abort() when running out of registers. 2015-10-04 22:09:36 +02:00
cinap_lenrek a23d7cdb84 vc: fix mistake. 2015-10-04 21:22:17 +02:00
cinap_lenrek 1dd7f0893b ape: add missing _subv() function to 386/vlop.s 2015-10-04 20:16:41 +02:00
cinap_lenrek b556e87e08 vc: handle 64 bit mixedmode asop 2015-10-04 20:08:10 +02:00
cinap_lenrek 8e41723741 5c: handle 64 bit mixedmode asop 2015-10-04 20:07:34 +02:00
cinap_lenrek e6d64bab9d 8c: handle 64 bit mixedmode asop and type vlong <-> float/double type conversions 2015-10-04 20:06:59 +02:00
cinap_lenrek 107ca1b42d cc: handle 64 bit mixedmode asop and type vlong <-> float/double type conversions 2015-10-04 20:06:30 +02:00
cinap_lenrek bfd0cb0db4 cc/6c: fix return type of mixed asop expressions, preserve type for moves so fixed<->float conversions work correctly 2015-10-04 20:02:58 +02:00
cinap_lenrek 9e3ef5c777 ape: add machine specific code for spim 2015-10-04 19:50:24 +02:00
cinap_lenrek d2af6b40af libc: add _uv2d()/uv2f() and _vas*d() functions to vlrt.c
on 32 bit archs, implement 64 bit vasop with floatingpoint right hand side.
also added is uvlong->double conversion function.
2015-10-04 19:49:02 +02:00
cinap_lenrek 9124e491e5 merge 2015-10-03 12:19:31 +02:00
cinap_lenrek 74a557a167 8c: make cgen64() compile target first when it contains functoin call so final assignment wont trash the registers 2015-10-03 12:18:20 +02:00
mischief 20dc40d19b pc, pc64: add did for intel wildcat point audio controller 2015-09-29 18:44:30 -07:00
aiju fe06f8e571 add timepic(1) and qr(1) manpages 2015-09-29 20:49:52 +02:00
aiju a7b06e0fdd timepic: string support 2015-09-29 20:49:28 +02:00
cinap_lenrek cde69a7822 ape: set MB_CUR_MAX to 4 in stdlib.h for 21-bit runes (thanks erik quanstro)
> fix silly bug with ape/stdlib.h which caused ape/lib/regexp/regcomp.c
> to miscompile regular expressions with runes > 0xffff.
2015-09-29 15:17:21 +02:00
BurnZeZ 695f0e0694 aux/gpsfs: fix usage 2015-09-29 04:08:42 -04:00
BurnZeZ ed196fcb7e file: detect DICOM and XM audio headers 2015-09-28 03:42:26 -04:00
cinap_lenrek 8a784a3b9b devip: declare cleanarpent() static 2015-09-27 22:41:38 +02:00
cinap_lenrek 4449a34756 devip: various bugfixes and cleanups for arp code
- fix missing runlock(ifc) when ifcid != a->ifcid in rxmitsols() (thanks erik quanstro)
- don't leak packets when transfering blocks from arp entry hold list to droplist
- free rest of droplist when bwrite() errors in arpenter(), remove useless checks (ifc != nil)
- free arp entry hold list from cleanarpent()
- consistent use of nil for pointers
2015-09-27 22:17:02 +02:00
aiju 920783505c add timepic(1) 2015-09-27 13:50:18 +02:00
stanley lieber 4c841d0b46 fortunes: Please be respectful in this forum. 2015-09-26 19:10:40 -04:00
stanley lieber f9244d433a qer(8): correct man page example (thanks, kenji) 2015-09-26 19:07:05 -04:00
cinap_lenrek c124b9f8b2 merge 2015-09-26 11:46:31 +02:00
cinap_lenrek ffe4844da8 cwfs: various cleanups
- consistently refer to Dentry.name length with NAMELEN
- make sure whoname is null terminated
- remove useless nil check for whoname
2015-09-26 11:44:29 +02:00
cinap_lenrek 76e0968e35 cwfs: don't use sprint() to fill directory name
sprint() will replace invalid utf8 sequences with U+FFFD
which caused directory reads and stats to return the wrong
filename. just strcpy the name bytes.
2015-09-26 11:41:31 +02:00
mischief 8737864294 ape: add badrect object into ape libdraw 2015-09-25 16:44:25 -07:00
cinap_lenrek fc06f637cf libsec: cleanup newbytes()/newints()/newbits() and get rid of OFFSETOF() macro 2015-09-24 12:57:05 +02:00
cinap_lenrek 917da0089d cpp: handle 4 byte utf sequences (21-bit runes) 2015-09-24 12:23:17 +02:00
cinap_lenrek 8003c8b1e2 utf(6), rune(2): document 21-bit runes 2015-09-24 12:14:08 +02:00
cinap_lenrek bba6d26ca2 cpp: fix memory corruption due to input buffer relocation
the dynamic input buffer resize code (fillbuf()) is broken as
the calling code assumes that memory wont relocate. instead
of trying to work out all the cases where this happens, i'm
getting rid of fillbuf() and just read the whole file into
memory in setsource().

the bug could be reproduced with something as simple as:

@{for(i in `{seq 1 10000}){echo $i ', \'; }} | cpp
2015-09-24 05:13:03 +02:00
glenda 2b5ab91775 resize: add -n for nearest neighbour 2015-09-23 17:52:35 +02:00
cinap_lenrek fa95531388 merge 2015-09-23 17:35:16 +02:00
cinap_lenrek 6641548938 libsec: fix memory leaks in X509req() and X509gen() and return malloced pointer
X509req() and X509gen() used to leak memory, and had no way for
the caller to free the allocated certificate/certificate request
buffer returned. this is not critical as these functions are only
used in short lived rsa(2) helper programs. but i prefer to have
library routines not leak memory as one does not know in advance
where the code is going to be used.
2015-09-23 17:33:52 +02:00
cinap_lenrek 5639f9504b rsa2x509, rsa2csr: add newline in usage print 2015-09-23 17:05:48 +02:00
cinap_lenrek 9f50ee06f3 libsec: implement client certificate authentication for tls1.2
we used to negotiate tls1.1 for client cert authentication because the
signature generation was not implemented for tls1.2. this is now fixed
and tls1.2 can be negotiated with client certs.
2015-09-23 16:57:25 +02:00
glenda d6c35b3de8 add qr.c 2015-09-23 16:36:55 +02:00
cinap_lenrek ada54defbc libsec: handle missing signature case; can happen because some ciphers make it optional 2015-09-22 19:11:54 +02:00
cinap_lenrek 2c4d3dd510 libsec: make sure Elem is zero initialized so freevalfields() wont cause accidents 2015-09-22 18:39:48 +02:00
cinap_lenrek c3e1c158f6 libsec: implement dh parameter signature verification, stop lying about non-rsa ciphers, fix memory leaks in X509 code
actually verify the diffie hellman parameter signature, this
comes in two flavours. TLS1.2 uses X509 signature with a
single hash specified by the signature algorithm field in
the signature itself and pre TLS1.2 where md5+sha1 hashes
of the signed blob are pkcs1 padded and encrypted with the
rsa private key.

stop advertizing non-rsa cipher suits (DSS and ECDSA), as
we have not implmenented them.

fix some memory leaks in X509 code while we'r at it.
2015-09-22 18:10:52 +02:00
cinap_lenrek 8baa859319 libsec: fix memory leak in ecmul() 2015-09-22 18:04:06 +02:00
cinap_lenrek c878be04f9 scuzz: uncomment synccache command 2015-09-22 12:23:49 +02:00
cinap_lenrek 83d45ee502 mothra: <hr> drawing
<hr> is handled by drawing replicated bitmap across the with of
the page.
2015-09-22 11:49:07 +02:00
cinap_lenrek 95cfc30788 libdraw: remove unneeded check (thanks BurnZeZ) 2015-09-20 21:52:47 +02:00
cinap_lenrek 12f7fc7a08 devsd: handle SYNCHRONIZE CACHE scsi commands as nops in sdfakescsi() 2015-09-20 14:54:49 +02:00
cinap_lenrek fa769a8f9d sdmmc: handle fakescsi emulation 2015-09-20 14:53:44 +02:00
cinap_lenrek c7c58ef8bb devsd: remove unused timeout field from SDreq 2015-09-20 14:27:41 +02:00
cinap_lenrek d1315ade41 libdraw, screenrc: bind devdraw and devmouse in screenrc instead of handling it in libdraw
libdraw was attempting to bind '#i' and '#m' to /dev when it could not find
/dev/mouse or /dev/draw. a library shouldnt be that clever and do namespace
manipulations on behalf of the caller. so instead, we setup the graphics
environment in screenrc on boot time.
2015-09-20 12:25:01 +02:00
mischief 30a9d59070 pc, pc64: fix sdvirtio descriptor count when sending flush 2015-09-20 01:56:56 -07:00
stanley lieber f5174e6fdf ircrc: add -P option for server password (thanks, nick) 2015-09-19 14:03:22 -04:00
stanley lieber a90662c2e6 /sys/lib/dist/ndb/common: correct authdom=inri 2015-09-16 13:29:04 -04:00
cinap_lenrek cb083221d2 igfx: fix typos (thanks qwx) 2015-09-14 15:15:14 +02:00
cinap_lenrek 029c271825 libsec: save some space making weakCipher bitamp of type char[] instead of int[] 2015-09-14 09:46:40 +02:00
cinap_lenrek 9733434e6e libsec: add TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 and TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 cipher suits 2015-09-14 09:27:06 +02:00
cinap_lenrek be3ba38c45 libfis: fix wrong shift for lba40 (thanks geoff and charles)
---------- Forwarded message ----------
From: Charles Forsyth <charles.forsyth@gmail.com>
Date: 13 September 2015 at 12:38
Subject: fis bug
To: erik quanstrom <quanstro@quanstro.net>


geoff spotted something similar in sdiahci.c, but it's in libfis as well:

c[Flba24] = lba >> 24;
c[Flba32] = lba >> 32;
c[Flba40] = lba >> 48;

>> 48??  should be >> 40, especially with drive sizes getting up there.
2015-09-13 13:51:00 +02:00
cinap_lenrek 33a4a56c1c libsec: send sigature_algoritms extension for TLS1.2, order ciphers
TLS1.2 requires the client to send the list of supported
signature and hash algorithm pairs. some servers will simply
reject the client hello otherwise. note that we do not implement
any dh/ecdh param signature verification.

order the cipher list to strogest first. aes128 is actually more
secure than aes256.
2015-09-13 13:39:51 +02:00
cinap_lenrek 455b42743d libsec: handle TLS 1.2 changes in CertificateRequest message 2015-09-12 13:04:47 +02:00
cinap_lenrek c06e464ec4 cwfs: initialize /env/timezone on boot so dumps are in localtime
when /env/timezone file is missing (boot case), copy /adm/timezone/local
to /env/timezone so localtime() can correct timezone offset.
2015-09-12 03:58:46 +02:00
mischief c823f136df mkfile.proto: LIB should not be inherited during recursive mk 2015-09-09 18:59:40 -07:00
cinap_lenrek 20ea629b8a html2ms: bold table headings, remove wrong tag space handling 2015-09-08 19:55:55 +02:00
cinap_lenrek d79754b4c8 mothra: make text inside <td> bold 2015-09-08 19:23:23 +02:00
cinap_lenrek b143c1f411 tar: remove unneccesary { } 2015-09-08 18:30:38 +02:00
cinap_lenrek c7eae3fb72 tar: make z flag work, even when no file name was provided (thanks aiju)
tar used to infer compression type from the filenames extension, but when
no file name is given (stdin/stdout), the -z flag was ignored and no
compression filter applied. this changes tar to assume the default
gzip compression method when z is given and no file name is specified.
2015-09-08 18:27:48 +02:00
cinap_lenrek 4d4b825dea mothra: add missing initializations for plaintext html state 2015-09-07 00:13:40 +02:00
cinap_lenrek b55315c3fd libthread: get rid of tprivalloc()/tprivfree()/tprivdata() and _workerdata() (thanks qrstuv)
these functions where undocumented and unused. especially
tprivfree() was buggy missing a unlock() call. theres not
much point in supporting these functions as theres
threaddata() and procdata().
2015-09-06 23:25:14 +02:00
cinap_lenrek 7562da90e5 libc: remove privfree(), simplify privalloc() 2015-09-06 20:43:05 +02:00
cinap_lenrek 431cbe35f6 devqspi: fix qunlock error on stat() -> close() 2015-09-05 13:18:28 +02:00
cinap_lenrek fdfd856d1d zynq: clean cache unconditionally *before* dma, invalidate cache *after* dma for read case
processor might bring data speculatively into the cache,
before the dma completes.
2015-09-05 10:36:53 +02:00
cinap_lenrek 6fb9ae8f43 usbehci: clean cache unconditionally before handing a buffer to the hardware
even in the read case, we need to clean the cache
so the cpu will not flush out old changes while
the hardware updates the buffer.
2015-09-05 10:14:19 +02:00
cinap_lenrek 50850cf4b9 dist/mkfile: add target for the aijuboard *.zynq.img
this generates a disk image (to be written to usb or
sdmmc card) containing 9fat partition with kernel and
a hjfs filesystem partition with the 9front distribution.

this could be easily extended to generate raspberry pi
images as well, but i have no hardware to test.
2015-09-05 03:29:17 +02:00
cinap_lenrek ce38e57e97 merge 2015-09-05 00:37:32 +02:00
cinap_lenrek faf3f0df06 zynq: fix cache flush bug for emmc driver (have to invalidate cache *before* read) 2015-09-05 00:33:57 +02:00
stanley lieber 891ca82987 fortunes: Please be respectful in this forum. 2015-09-03 17:01:49 -04:00
cinap_lenrek b9eb7258bd html2ms: handle subscripts and superscripts 2015-09-03 21:24:00 +02:00
cinap_lenrek 72a5fbd8ea mothra: subscript and superscript support 2015-09-03 19:07:48 +02:00
cinap_lenrek c8dd01d5f6 auth/passwd: fix structure zeroing order 2015-09-02 11:41:41 +02:00
cinap_lenrek 7ed22aaeec libsec: add rfc5869 hmac-based key derivation function hkdf_x() 2015-09-02 11:30:17 +02:00
cinap_lenrek b749f36baa libsec: generalize pbkdf2_hmac_sha1() to pbkdf2_x() passing the hmac as an argument 2015-09-02 11:28:11 +02:00
cinap_lenrek 4c52aedfe9 libsec: declare aes_setupEnc static 2015-09-02 06:15:02 +02:00
cinap_lenrek 46926aa502 tcp: fix mtu on server sockets again (thans mycroftix)
for incoming connection, we used s->laddr to lookup the interface
for the incoming call, but this does not work when the announce
address is tcp!*!123, then s->laddr is all zeros "::". instead,
use the incoming destination address for interface mtu lookup.

thanks mycroftix for troubleshooting!
2015-09-02 01:50:55 +02:00
cinap_lenrek b5737e8726 libsec: add curve25519 diffie hellman 2015-09-01 21:38:20 +02:00
cinap_lenrek e3a64494e7 libsec: remove flawed aes() digest and hmac_aes() implementations (thanks aiju) 2015-09-01 21:35:43 +02:00
cinap_lenrek 2095bdbf45 libsec: work arround 8c running out of registers compiling curve25519.c 2015-08-28 16:31:44 +02:00
cinap_lenrek 0e51046942 libsec: add curve25519() from http://code.google.com/p/curve25519-donna/
this is a portable version of curve25519() by google.
2015-08-28 12:08:54 +02:00
cinap_lenrek d8a57c0ae3 merge 2015-08-28 08:42:35 +02:00
cinap_lenrek d52e35055d libauthsrv: fix _asgetresp() for passwd 2015-08-28 08:41:16 +02:00
glenda 2bc15fbabd mp.h: third time's a charm 2015-08-27 13:40:34 +00:00
glenda 82a922d9ed mp.h: oops 2015-08-27 13:35:13 +00:00
glenda d8a1f1a647 mp.h: define mpnrand 2015-08-27 13:34:02 +00:00
mischief 07b245943a libsec: add TLS_RSA_WITH_AES_128_CBC_SHA256 and TLS_RSA_WITH_AES_256_CBC_SHA256 ciphers 2015-08-27 01:53:48 -07:00
mischief 163a772124 devtls: add sha256 mac 2015-08-27 01:46:28 -07:00
cinap_lenrek 3bb0b9f4ea libsec: add q parameter to dh_new() for subgroup support, sanitize dh parameters 2015-08-26 05:59:42 +02:00
cinap_lenrek 844bbecadb libmp: simplify mpnrand(), as mpnew() cannot return nil 2015-08-26 05:44:26 +02:00
cinap_lenrek 8f2e408448 libmp: add mpnrand() function to generate uniform random number 0 ≤ x < n 2015-08-25 20:20:25 +02:00
mischief 2dec35524e tput: check sbrk return value 2015-08-25 03:06:36 -07:00
glenda c4fdc6bfdb fix fuckup 2015-08-25 09:35:10 +00:00
mischief 6b402b83cf import E script from bell labs 2015-08-25 02:07:46 -07:00
mischief dbe0a995f0 libc: import more endianness fixes (thanks cherry9)
from https://bitbucket.org/cherry9/plan9-loongson/
2015-08-25 01:58:41 -07:00
cinap_lenrek 59d16c3900 libsec: fix probably_prime() endless loop for n == 3 2015-08-23 23:49:31 +02:00
cinap_lenrek 54a91861df remove convkeys2 2015-08-22 00:21:11 +02:00
cinap_lenrek b83dd93e98 init: remove dependency to <authsrv.h> 2015-08-21 23:40:31 +02:00
cinap_lenrek d24610fe38 tapefs: remove dependency to <authsrv.h> 2015-08-21 23:38:56 +02:00
cinap_lenrek 5c941ec346 import(4): -o, -O flags gone 2015-08-21 23:29:10 +02:00
cinap_lenrek 69dd87eb63 remove srvold9p 2015-08-21 23:23:35 +02:00
cinap_lenrek 61e9d23eb2 cpu, import: remove old9p support 2015-08-21 23:22:59 +02:00
cinap_lenrek c6a9cbb071 cmd/auth: remove private /dev/random reading routines, use genrandom() 2015-08-21 22:46:26 +02:00
cinap_lenrek 809522e80f auth/changeuser: set the aes key in plan9 database, but not in securenet db 2015-08-21 20:36:19 +02:00
cinap_lenrek f6dbd3d993 keyfs: fix typo (thanks jpm) 2015-08-21 20:11:11 +02:00
cinap_lenrek c96efcfef3 kernel/boot: do not handle kfs boot 2015-08-21 19:53:43 +02:00
cinap_lenrek 77e279201d remove kfs and kfscmd 2015-08-21 19:52:57 +02:00
cinap_lenrek cb474632d3 remove kfs references from manual 2015-08-21 19:51:03 +02:00
cinap_lenrek 3db2012126 fshalt: remove kfs support 2015-08-21 19:40:29 +02:00
cinap_lenrek 985b2457cd mkfs(8): dont mention kfs 2015-08-21 19:35:56 +02:00
cinap_lenrek 46a7876d32 disk/mkfs: rmeove kfs support 2015-08-21 19:32:48 +02:00
cinap_lenrek 0ce50ebc57 cwfs: remove 9p1 support 2015-08-21 18:43:25 +02:00
cinap_lenrek 501774b096 authsrv: randomize aes key in mkkey(), not used yet. 2015-08-21 03:32:05 +02:00
cinap_lenrek c3487a4b49 authsrv: more aes key stuff 2015-08-21 03:16:50 +02:00
cinap_lenrek 63b18e7925 introduce AES key into nvram and keyfs 2015-08-21 02:43:31 +02:00
cinap_lenrek e48a5832b2 kfs: adjust to new libauthsrv 2015-08-20 20:56:00 +02:00
cinap_lenrek 167ea748f8 cwfs: adjust for new libauthsrv changes 2015-08-20 20:44:17 +02:00
cinap_lenrek 78c45541eb libauthsrv: add missing files (thanks mischief) 2015-08-20 15:47:49 +02:00
cinap_lenrek a40c4006d2 libsec: add pbkdf2_hmac_sha1() (from wpapsk factotum module) 2015-08-20 00:45:08 +02:00
cinap_lenrek 02cfcfeab4 libauthsrv: generalize ticket service, not hardcoding ticket format and DES encryption
this is in preparation for replacing DES ticket encryption with
something better. but first need to make the code stop making
assumptions.

the wire encoding of the Ticket might be variable length
with TICKETLEN just giving an upper bound. the details will be
handled by libauthsrv _asgetticket() and _asgetresp() funciotns.

the Authenticator and Passwordreq structures are encrypted
with the random ticket key. The encryption schmeme will depend
on the Ticket format used, so we pass the Ticket* structure
instead of the DES key.

introduce Authkey structure that will hold all the required
cryptographic keys instead of passing DES key.
2015-08-19 21:06:17 +02:00
mischief f785d4da07 aux/statusbar: use title as rio window title (thanks qrstuv) 2015-08-18 01:24:22 -07:00
cinap_lenrek 7c3bbc3168 libsec: TLS1.2 server support, make cipher list with most prefered first 2015-08-17 22:27:56 +02:00
cinap_lenrek 7d7650dffc libsec: TLS1.2 client support 2015-08-17 21:16:58 +02:00
cinap_lenrek 70a7ae9929 cc: improve (non-) side effect detection (thanks charle) 2015-08-17 02:07:27 +02:00
cinap_lenrek dd4c85cf3a games/doom: fix array offsets for respawn angle (thanks qu7uux)
mthing->angle is a signed short, and if ANG45 * mthing->angle/45 < 0, the
result of the right shift is sign extended.
afaik, an being 16bit in the dos version of doom, you'd endup with a
negative array offset, which would just access values from adjacent arrays
(finetangent[] for finecosine[], and finecosine[] for finesine[]), and it
would result in a misplaced teleport fog in some circumstances (fog is not
in front of the player on respawn, hence "silent teleport"). so, this fix is
bug incompatible, but this only affects live multiplay.
to test:
% hget http://doomedsda.us/dm/ahfx7_2.zip | unzip -sv
extracting AHFX7_2.TXT
extracting AHFX7_2.LMP
% mv AHFX7_2.LMP ahfx7_2.lmp
% games/doom -playdemo ahfx7_2
[...]
doom 10553: suicide: sys: trap: fault read addr=0x400429e10 pc=0x205b45
2015-08-16 22:12:11 +02:00
cinap_lenrek f369fa9d46 games/doom: fix gamma correction and key translation (thanks qu7uux)
KEY_F11 and KEY_F12 are not KEY_F1+11 and KEY_F1+12 as it is assumed in
runetokey(), which prevents these keystrokes from being used. rather than
change runetokey(), it seems better to just change the key definitions in
doomdef.h (the new values don't correspond to any other keys anyway).

F11 is the gamma correction key. to make gamma correction actually work,
i_video.c:I_SetPalette must also take into account usegamma (this was just
never ported). cf i_video.c:UploadNewPalette in source code release.

F12 is the spycam key. the spycam switches the renderview to a different player
during a coop game, or when watching a multiplayer demo. this feature only
changes the renderview; sounds, palette effects, status bar, etc. are still
from the first player's perspective.
2015-08-16 22:09:46 +02:00
cinap_lenrek f47f6af382 games/doom: fix idclev cheat in doom2 and final doom (thanks qu7uux)
a typo in st_stuff.c:ST_Responder prevents idclev (change level) cheat to work
in doom2 and final doom (gamemode == commercial): episode is set to 0, when
that's invalid, and ST_Responder just returns.
to test, while ingame type idclev, followed by:
. doom1: episode (1-3 or 1-4) then map number (1-9)
. doom2/final doom: map number (1-32)
incidentally, if the last digit typed is 1, the player's weapon will switch to
the fist, because of a different bug (basically kbdproc registering two events
when pressing a key, for 'c' and 'k' case).
2015-08-16 22:08:11 +02:00
cinap_lenrek 0d76dafaa0 games/doom: fix unterminated comment causing sound bugs (from qu7uux)
this bug was introduced in the plan9 port, and since i_sound.c compiles with
no warning, it was never noticed. in effect, the statement between the
unterminated comment and the next is ignored. channelids[] is used in addsfx()
to avoid re-adding certain sounds if they are already playing. one of those is
sfx_sawful, and because of this bug, it is added again each tic during which
the player fires the chainsaw, rather than reset every tic.
compare firing the chainsaw continuously with and without the patch (without
hitting an enemy).
2015-08-16 22:07:12 +02:00
cinap_lenrek 8c3acde2de devether: duplicate flags when copying blocks (thanks erik quanstro) 2015-08-16 20:08:36 +02:00
cinap_lenrek 988d326f32 vc: word align automatics
theres code that assumes one can dereference a char[] buffer on the stack
as a long (ghostscript gxblend.c), so make sure all automatics on the stack
are word aligned. this is not strictrly neccesary, but avoids some
trouble with unportable code.
2015-08-16 19:29:16 +02:00
cinap_lenrek 2fe2ffe813 gs: fix alignment bug in image_render_interpolate() 2015-08-16 18:20:22 +02:00
cinap_lenrek cf74c80e7b 6l: fix vlong byte order when running on big endian machine (thanks erik quanstro) 2015-08-16 13:41:14 +02:00
mischief 0b48d5fdbf libcontrol: fix label memory leak 2015-08-16 00:04:27 -07:00
cinap_lenrek f1efd09bbb mothra: fix crash 2015-08-16 03:19:05 +02:00
cinap_lenrek 344ddf5f55 rio(4): document "delete" wctl message (thanks mischief) 2015-08-16 02:54:23 +02:00
cinap_lenrek aa2b5bc0e7 libsec: fix mistake breaking tlsServer() (thanks sl) 2015-08-16 02:38:44 +02:00
cinap_lenrek 5e07e5840a cpu: cleanup ssl code, make sure -p works for any auth method 2015-08-16 01:47:10 +02:00
cinap_lenrek e9e53fe7b6 import(4): clarify -E and -e options 2015-08-15 21:36:18 +02:00
cinap_lenrek 0c36c79e9b libsec: TLS1.1 support (needs new devtls) 2015-08-15 17:51:55 +02:00
cinap_lenrek 74d1f67b05 devtls: TLS1.1 explicit iv support
using nrand() to fill the explicit iv, which isnt great but better
than no iv.
2015-08-15 17:50:44 +02:00
cinap_lenrek 76f21ca715 kernel: try freebroken() *before* killbig() (thanks aiju) 2015-08-14 14:45:19 +02:00
cinap_lenrek 592b8d5b35 hjfs: fix deadlocks
buffers which still have requests queued on them are not free!

we cannot chanedev() a buffer while it has still requests queued on it
and we canot just queue our request (having different address) on the
buffer while there are other requests before it, otherwise we would
create artificial block dependency that can cause deadlock.
2015-08-13 10:41:12 +02:00
cinap_lenrek 8c4bb53bdc hjfs: fix abort() in givebuf()
it is possible for another getbuf() on buffer b to come in
before undelayreq() calls givebuf() on a buffer again. then
givebuf() would find b already busy and abort().

instead, we now handle what getbuf() did in givebuf() and
consider the Buf* argument to givebuf() as a hint only for
the case when we have to actually flush/read a block from
disk.
2015-08-11 17:56:06 +02:00
cinap_lenrek f43df64325 libc: fix wunlock() libthread deadlock
when wunlock() was used by threads running within the same proc,
the wunlock() can deadlock as it keeps holding the RWLock.lock
spinlock while indirectly calling _threadrendezvous(). when
_threadrendezvous() switches to another thread in the same proc,
then that thread can hang at rlock()/wlock()/runlock() again
waiting for wunlock() to release the spinlock which will never
happen as lock() does not schedule threads.

wunlock() is changed to release the spinlock during rendezvous
wakeup of readers. note that this is a bit dangerous as more
readers might queue concurrently now which means that if
we cannot keep up with the wakeups, we might keep on waking
readers forever. that will be another patch for the future.
2015-08-10 23:13:41 +02:00
mischief bc895417f8 libc: fix spim endianness 2015-08-09 03:44:03 -07:00
cinap_lenrek 23742053f5 mount, srv: add -N flag to skip authentication and attach anonymously as "none" 2015-08-10 10:11:45 +02:00
stanley lieber b241dd1159 fortunes: If you want to do the work, I will review the results. 2015-08-09 00:36:10 -04:00
cinap_lenrek 4b926f4e69 lib9p: make reqqueueflush() use new threadint(), which will also cover channel operations
using "interrupt" ctl message directly doesnt work when the
process is doing libthread channel operations (threadrendezvous)
as it will just repeat a interrupted rendezvous(). threadint()
handles this for us.
2015-08-10 03:52:40 +02:00
cinap_lenrek c235046310 libthread: use "interrupt" proc ctl message instead of posting a note for threadint()
threadint() is called to interrupt channel operation or a system call.
the kernel provides a new "interrupt" procctl message to interrupt a
process commited to or being in a blocking syscall, which is similar,
but not the same. the main difference is that "interrupt" condition
is not cleared before the process actually attempts to block. also
can be cleared with "nointerrupt" ctl message. see proc(3)
2015-08-10 03:48:37 +02:00
cinap_lenrek a98f911a17 libthread: fix mistake, make "all" the default target again 2015-08-10 03:20:08 +02:00
cinap_lenrek 7a97fe132a acid -k: fix intrcount() for amd64 2015-08-09 22:43:53 +02:00
cinap_lenrek cd357a2b8c acid -k: fix procenv() to new data structure 2015-08-09 22:24:50 +02:00
cinap_lenrek 8c9e4efa17 zunq: remove unused variables from devqspi 2015-08-09 22:05:14 +02:00
cinap_lenrek 7ba3be82a7 kernel: move "setargs" field in Proc structure after "nargs" and "args" 2015-08-09 21:48:58 +02:00
cinap_lenrek b4f56f1f4e kernel: mount flag is int not ulong, reduce size of Mount struct by putting mflag field in what would be wasted as padding 2015-08-09 21:35:50 +02:00
cinap_lenrek 9f4eac5292 kernel: pgrpcpy(), simplify Mount structure
instead of ordering the source mount list, order the new destination
list which has the advantage that we do not need to wlock the source
namespace, so copying can be done in parallel and we do not need the
copy forward pointer in the Mount structure.

the Mhead back pointer in the Mount strcture was unused, removed.
2015-08-09 21:16:10 +02:00
cinap_lenrek 3af236b5e3 kernel: fix Mheadache
there was a race between cunmount() and walk() on Mhead.from as Mhead.from was
unconditionally freed when we cunmount(), but findmount might have already
returned the Mhead in walk(). we have to ensure that Mhead.from is not freed
before the Mhead itself (now done in putmhead() once the reference count of the
Mhead drops to zero).

the Mhead struct contained two unused locks, removing.

no need to hold Pgrp.ns lock in closegrp() as nobody can get to it (refcount
droped to zero).

avoid cclose() and freemount() while holding Mhead.lock or Pgrp.ns locks as
it might block on a hung up fileserver.

remove the debug prints...

cleanup: use nil for pointers, remove redundant nil checks before putmhead().
2015-08-09 18:19:47 +02:00
cinap_lenrek eaf42a2c78 rootstub: add spim 2015-08-08 09:20:48 +02:00
cinap_lenrek c8a7747659 cdproto: add spim 2015-08-08 08:56:08 +02:00
cinap_lenrek 1f8e6c916a python: fix build for objtype=$spim 2015-08-08 08:34:16 +02:00
cinap_lenrek 79213052a2 gs: fix build for objtype=spim 2015-08-08 08:31:49 +02:00
cinap_lenrek acc4d8b8aa libmp: fix build for objtype=spim 2015-08-08 08:25:36 +02:00
cinap_lenrek 4b6506cb57 ape: fix build for objtype=spim 2015-08-08 08:17:54 +02:00
cinap_lenrek ebe88f34cb fix library mkfiles for objtype=spim 2015-08-08 08:04:41 +02:00
mischief 23215e14d0 libmach: remove redundant check for big endian 2015-08-05 06:37:02 -07:00
mischief 8e78804fc0 libmach: remove useless error check from previous commit 2015-08-05 06:30:57 -07:00
mischief 7844dafe62 libmach: set correct endianness with little endian ELF32 mips binaries 2015-08-05 06:26:23 -07:00
cinap_lenrek 8ce456bd19 kernel: remove unused MAXCRYPT constant from portdat.h 2015-08-06 13:35:03 +02:00
cinap_lenrek a87b550183 vgaigfx: remove #define MB, theres a MB enum in portdat.h 2015-08-06 13:33:39 +02:00
cinap_lenrek 87d7a3c875 kernel: have to validate argv[] again when copying to the new stack
we have to validaddr() and vmemchr() all argv[] elements a second
time when we copy to the new stack to deal with the fact that another
process can come in and modify the memory of the process doing the
exec. so the argv[] strings could have changed and increased in
length. we just make sure the data being copied will fit into the
new stack and error when we would overflow.

also make sure to free the ESEG in case the copy pass errors.
2015-08-06 13:20:41 +02:00
cinap_lenrek 281729551f kernel: limit argv[] strings to the USTKSIZE to avoid overflow
argv[] strings get copied to the new processes stack segment, which
has a maximum size of USTKSIZE, so limit the size of the strings to
that and check early for overflow.
2015-08-06 11:51:23 +02:00
cinap_lenrek b09cd67860 kernel: validnamedup() the name argument for segattach()
this moves the name validation out of segattach() to syssegattach()
to make sure the segment name cannot be changed by the user while
segattach looks at it.
2015-08-06 11:48:51 +02:00
cinap_lenrek d275add1a8 kernel: fix indention in validname0() 2015-08-06 11:43:22 +02:00
cinap_lenrek 9585e9b7f8 kernel: limit syscallfmt user strings to 64K (as in validname) 2015-08-06 11:42:05 +02:00
cinap_lenrek 86eb8ea6bb kernel: change vmemchr() length argument to ulong and simplify 2015-08-06 10:15:07 +02:00
cinap_lenrek 8d196aeec7 kernel: use Etoolong[] constant instead of string literal in validname0() 2015-08-06 10:01:45 +02:00
cinap_lenrek 9110ae6eae kernel: make shargs() function static in sysproc.c 2015-08-06 09:09:57 +02:00
cinap_lenrek 2acb02f29b kernel: reject empty argv (argv[0] == nil) in sysexec()
when executing a script, we did advance argp0 unconditionally
to replace argv[0] with the script name. this fails when
argv[] is empty, then we'd advance argp0 past the nil terminator.

the alternative would be to *not* advance if *argp0 == nil, but that
would require another validaddr() check for a case that is unlikely
to have been anticipated in most programs being invoked as
libc's ARGBEGIN macro assumes argv[0] being non-nil as it also
unconditionally advances the argv pointer.

to keep us sane, we now reject an empty argv[]. on entry, we
verify that argv[] is valid for at least two elements:
- the program name argv[0], has to be non-nil
- the first potential nil terminator in argv[1]

when argv[0] == nil, we throw Ebadarg "bad arg in system call"
2015-08-06 08:47:38 +02:00
cinap_lenrek b89fcf2fe3 init: do not run $home/lib/profile when cd $home failed
avoiding follow up error messages, which is annoying and
quite common when running a terminal as "none" for testing.
2015-08-05 14:09:02 +02:00
cinap_lenrek 00eb2fa448 kfs: set permission of / to 0775 on ream
this allows members of the -1 group to create new directories in /
without having to fiddle with the fileserver console. this also
makes it consistent to hjfs and cwfs.
2015-08-05 13:13:40 +02:00
cinap_lenrek ad91dc7ffb cwfs: set permission of / to 0775 on ream
this allows members of the -1 group to create new directories in /
without having to fiddle with the fileserver console. this also
makes it consistent to hjfs.
2015-08-05 13:06:11 +02:00
cinap_lenrek 7304deaec1 pc, pc64: remove unused psaux driver, cleanup devkbd
the psaux driver is not used in any kernel configuration and theres
no userspace mouse daemon. i8042auxcmds() is wrong as access
to the user buffer can fault and we are holding an ilocks.

little cleanups in devkbd.
2015-08-05 10:44:03 +02:00
cinap_lenrek f7514acc95 devkbd: disable mosue/keyboard on shutdown, disable ps2 mouse on init, remove kbdenable()/kbdinit()
on vmware, loading a new kernel sometimes reboots when
wiggling the mouse. disabling keyboard and mouse on
shutdown fixes the issue.
make sure ps2 mouse is disabled on init, will get re-enabled
in i8042auxenable().
keyboard isnt special anymore, we can just use the devreset
entry point in the device to do the keyboard initialization,
so kbdinit()/kbdenable() are not needed anymore.
2015-08-05 09:22:07 +02:00
cinap_lenrek 145624eec2 kernel: remove unused qstate() function 2015-08-04 13:52:29 +02:00
cinap_lenrek dcb5f4212b devkbd: poll pc keyboard before blocking on kbd.q
the keyboard stops sending interrupts when its fifo gets full,
which can happen on boot when keys get mashed while interrupts
are still disabled. to work arround this, call the keyboard
interrupt handler when kbd.q is starved before blocking.
2015-08-04 13:43:35 +02:00
cinap_lenrek 1f0057c5fd python: use altzone 2015-08-04 02:03:38 +02:00
cinap_lenrek 63759d2efb ape: implement altzone for tzset() 2015-08-04 02:01:41 +02:00
cinap_lenrek 333812ca38 ape: fix mktime() again 2015-08-04 02:00:37 +02:00
cinap_lenrek 402741bc01 resample: simplify getint() 2015-08-03 18:30:02 +02:00
cinap_lenrek d457a43461 libc: make atoi() not parse c-style octal and hex numbers
interpreting octal breaks parsing of decimal numbers with
leading zeros. the manpage listed this in the BUGS section,
so we'r going to fix it as this just causes confusion as
most callers of atoi() do not expect it.
2015-08-03 18:10:53 +02:00
cinap_lenrek 2513946536 crop: use strtol() instead of atoi() 2015-08-03 17:29:30 +02:00
cinap_lenrek 953387d7ba bitsy: replace atoi() calls with strtol() when hex can be expcted 2015-08-03 17:08:33 +02:00
cinap_lenrek 2ef29e10f4 pc, pc64: replace atoi() calls with strtol() when hex can be expcte 2015-08-03 17:07:40 +02:00
cinap_lenrek 1b7e120c09 kernel: dont rely on atoi() parsing hex for netif/devbridge 2015-08-03 16:24:14 +02:00
cinap_lenrek 887ae1a17b webcookies: fix typo 2015-08-03 15:52:03 +02:00
cinap_lenrek 9cf59a2c63 9pcon: use strtol() to parse integers 2015-08-03 15:48:01 +02:00
cinap_lenrek 0915174850 libcontrol: use strtol() to parse integer arguments 2015-08-03 15:32:16 +02:00
cinap_lenrek 9289c4b796 libhttpd: use strtol to parse decimal character references in httpunesc() 2015-08-03 15:26:33 +02:00
cinap_lenrek 0d93e2fe70 snoopy: dont rely on atoi() being able to parse hex 2015-08-03 14:58:41 +02:00
cinap_lenrek 4b787e3205 bitsy/keyboard: do not rely on atoi() being able to parse hex 2015-08-03 14:52:07 +02:00
cinap_lenrek d7f4ef7bbc libauthsrv: readnvram() use vlong for nvroff, parse $nvlen/$nvoff with strtol() instead of atoi() 2015-08-03 14:45:23 +02:00
cinap_lenrek 8aee1c5060 webcookies: use strtol() to parse HH:MM:SS
atoi() currently interprets leading zeros as octal (BUG!),
so use strtol with explicit base 10 avoiding the issue.
2015-08-03 14:28:16 +02:00
cinap_lenrek fc77a2d3d3 aux/vga: dont rely on atoi() being able to parse hex 2015-08-03 14:24:29 +02:00
cinap_lenrek d5d6724805 devenv: simplify envremove(), cleanup 2015-08-03 22:08:10 +02:00
cinap_lenrek 37e4ce0ea7 devenv: avoid indirection, keep Evalue's allocated in an array
avoid the indirection for envlookup() by allocating Evalue structs
together in an array. remove unused link field in Evalue.
2015-08-02 21:39:33 +02:00
cinap_lenrek 29a53a52fd 1c,2c,7c,kc,vc: honor suppress condition for outstring() in swt.c 2015-08-02 14:52:54 +02:00
cinap_lenrek 1f3c43c017 pc, pc64: set *bootscreen= when framebuffer changes
add bootscreenconf(VGAscr *) function, that is called whenever
the framebuffer configuration is changed by devvga. that way, we
can pass the current setting of the framebuffer to the new
kernel when using /dev/reboot.
2015-08-02 07:32:49 +02:00
cinap_lenrek 27445c5768 kernel: cleanup qlock.c to use nil instead of 0 for pointers 2015-08-02 05:36:35 +02:00
cinap_lenrek dd96b1d965 mothra: show <source> tag within <video>/<audio> tags 2015-08-01 16:38:55 +02:00
cinap_lenrek 660f54b198 mothra: fix nil crash on missing name/src attributes for source/video/audio/embed/frame/iframe 2015-08-01 16:18:02 +02:00
cinap_lenrek 71c57070c6 mothra: enable compiler warnings and type checking, cleanup 2015-08-01 14:55:33 +02:00
cinap_lenrek fe5ede9792 mothra: fix double button hit
dolink() was hitting the button a second time!
2015-08-01 13:53:16 +02:00
cinap_lenrek b408b386e1 mothra: cleanup url handling 2015-08-01 13:06:24 +02:00
cinap_lenrek d6fb42f496 mothra: fix selurl() 2015-08-01 12:51:52 +02:00
cinap_lenrek 0140f20af4 jpg/ico: fix mkfile 2015-08-01 11:56:01 +02:00
cinap_lenrek 815c2ba22b mothra: support for inline images and <image> tag 2015-08-01 11:20:28 +02:00
cinap_lenrek f62a2efb7a webcookies: create lockfile with 0600 permission, always use create() with perm 0600 for rewriting jar 2015-08-01 03:18:44 +02:00
cinap_lenrek f42a7ade70 bio(2): Bterm() closes filedescriptor for Bfdopen() allocated buffer 2015-08-01 03:16:35 +02:00
cinap_lenrek 69daa9fd96 jpg/ico: support for embedded png icons 2015-07-31 12:58:58 +02:00
cinap_lenrek 18169e03de webcookies: fix implicit path cookie handling
parsecookie() used to inplace modify the request path
for implicit path (to get the directory from path) and
also did it wrong. now have a static copy and do not
remove the last slash.
2015-07-31 01:10:53 +02:00
cinap_lenrek 9d59fb28cf aux/vga: sandybridge support for igfx (unfinished)
as usual, the dude with the hardware vanished so i cannot
develop this further. setting mode worked the last time
but only when using vesa before, so some bits are still
missing. commiting this as it is so i dont have to start
from scratch once we have hardware again.
2015-07-31 23:03:45 +02:00
cinap_lenrek 34e2e047cc iostats: add -C to usage 2015-07-31 22:51:52 +02:00
cinap_lenrek ee86d3cb52 devmnt: fix mntcache()
make sure mntcache() wont cache data beyond what was read from
the block list.
2015-07-30 21:00:13 +02:00
cinap_lenrek b86a12149a games/doom: fix config file never being loaded or saved (thanks qu7uux)
basedefault[], the default path to the config file, is never set and remains
blank, unless -config %s is used (cd d_main.c). when games/doom attempts to
open the file, it silently fails and no config file is ever read or written.
this patch sets basedefault to a file in whatever directory a valid wad is
found in I_IdentifyWAD().
2015-07-30 20:30:47 +02:00
cinap_lenrek 25396d3ffd games/doom: display correct message on medkit pickup when health low (thanks qu7uux)
due to a typo in p_inter.c:P_TouchSpecialThing(), a message that is supposed
to show up when the player picks up a medikit while low on health (< 25), is
never displayed. the check for low health is done after the health is already
increased, so the condition is never true.
a cosmetic bug in all old doom executables that also seems interesting to fix.
to test: compare message displayed when picking up a medikit with and without
the patch
2015-07-30 20:02:23 +02:00
cinap_lenrek 5161442171 games/doom: fix ouchface not being shown when it should be (thanks qu7uux)
due to a typo in st_stuff.c:ST_updateFaceWidget(), doomguy mistakenly never
looks shocked when taking more than 20 damage, but rather when he gains more
than 20 health while being hit.
this is a cosmetic bug in all old versions of doom's executables, but it seems
appropriate to fix.
simple test: fire a rocket at a nearby wall, taking enough damage.
2015-07-30 20:00:43 +02:00
cinap_lenrek b579acef97 games/doom: add bug compatibility switches (thanks qu7uux)
these emulate bugs present in select versions of the released doom executables.
they are required to correctly play demos recorded with these but affect the
gameplay, so should be otherwise disabled.

-nobounce: lost souls don't bounce off floors and ceilings like intended due
to a misplaced check; this is fixed from ultimate doom on, but doom and doom2
are still affected.

-noztele: in final doom 1.9, things' altitude was erroneously not set to the
floor's height after teleporting. this was fixed in later versions of the
executables.

examples of desyncing demos:
(plutonia.wad, without -noztele) http://doomedsda.us/lmps/946/2/30pl2646.zip
(doom2.wad, without -nobounce) http://doomedsda.us/lmps/945/3/30nm2939.zip
2015-07-30 19:55:13 +02:00
cinap_lenrek f899b2fe3c games/doom: fix switch textures swapping in ultimate doom (thansk qu7uux)
gamemode is set according to the name of the main wad (cf. d_main.c), i.e.:
- doom1.wad: (shareware doom1, ep1 only) gamemode == shareware
- doom.wad: (registered doom1, ep1-3) gamemode == registered
- doomu.wad: (ultimate doom, ep1-4) gamemode == retail
- doom2.wad, plutonia.wad, tnt.wad: gamemode == commercial
most doom.wad's distributed online are, in fact, ultimate doom.
if your ultimate doom wad is correctly named doomu.wad, some switches in
episodes 2-4 won't swap their texture when toggled, because
p_switch.c:P_InitSwitchList() is only checking for registered doom1.

easy way to test: demo2 in either registered or ultimate doom: the player flips
a switch right at the beginning of the demo; if the main wad is called
doomu.wad, the switch won't change its texture.
% games/doom -playdemo demo2
if you rename the wad to doom.wad or alter d_main.c:IdentifyVersion, the switch
will swap its texture like it should.
2015-07-30 19:51:11 +02:00