Overview
Comment: | fix bug caused by unintuitive behavior of strncmp |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
a49d93061d54212f2e4e3f1e9845e07f |
User & Date: | lexi on 2019-09-06 01:02:13 |
Other Links: | manifest | tags |
Context
2019-10-17
| ||
20:03 | reorganize dumbass directory structure check-in: c29fe4718a user: lexi tags: trunk | |
2019-09-06
| ||
01:02 | fix bug caused by unintuitive behavior of strncmp check-in: a49d93061d user: lexi tags: trunk | |
2019-08-18
| ||
05:12 | add ability to disable key-save mechanism check-in: eb56f79816 user: lexi tags: trunk | |
Changes
Modified kpw.d/kpw.c from [6b73e83d39] to [bd775cdba4].
4
5
6
7
8
9
10
11
12
13
14
15
16
17
...
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
|
* © AGPLv3
* $ cc -O4 kpw.c -okpw [-D_CLIPBOARD]
* - D_CLIPBOARD enables kpw to automatically
* copy passwords to the clipboard. it does
* this by attempting to execute a sequence
* of binaries, and then writing the password
* to STDIN of the binary that succeeds.
* ? generates passwords
* → kpw is unlikely to be portable to non-POSIX
* systems, but should run fine on Linux as well
* as BSDs with getrandom() support.
* → kpw has the following dependencies:
* - libsodium
* ! for getrandom() to work with the version of
................................................................................
ptbuf [ptlen];
struct dbrecord rec;
bad d;
if((d = dbnext(db, &rec, ctlen,
pub, priv, ctbuf, ptbuf)) != ok) return d;
if(strncmp(target, rec.acct.ptr, rec.acct.len) == 0) {
/* found a matching record; determine
* what to do to the fucker */
alert(a_debug, "found target record");
found = true;
if (op == delpw) continue;
password pwbuf;
|
>
>
>
>
>
|
|
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
|
* © AGPLv3 * $ cc -O4 kpw.c -okpw [-D_CLIPBOARD] * - D_CLIPBOARD enables kpw to automatically * copy passwords to the clipboard. it does * this by attempting to execute a sequence * of binaries, and then writing the password * to STDIN of the binary that succeeds. * - D_SAVEKEY enables kpw to store the database * key in persistent memory between invocations, * leading to quicker decryption and access * times. only available on systems with SYSV * shared memory. * ? generates passwords * → kpw is unlikely to be portable to non-POSIX * systems, but should run fine on Linux as well * as BSDs with getrandom() support. * → kpw has the following dependencies: * - libsodium * ! for getrandom() to work with the version of ................................................................................ ptbuf [ptlen]; struct dbrecord rec; bad d; if((d = dbnext(db, &rec, ctlen, pub, priv, ctbuf, ptbuf)) != ok) return d; if(strlen(target) == rec.acct.len && strncmp(target, rec.acct.ptr, rec.acct.len) == 0) { /* found a matching record; determine * what to do to the fucker */ alert(a_debug, "found target record"); found = true; if (op == delpw) continue; password pwbuf; |
Modified makerules from [053afc7a8f] to [a224223f8c].
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
post = $(if $(debug),, && strip $@) cc-post = $(post) sc-post = $(post) mc-post = $(post) os = $(shell uname -o) ifeq ($(os),Android) l-shmem = -landroid-shmem endif %: %.c $(cc) $< -o$@ $(cc-post) %: %.ml $(mc) $< -o $@ $(mc-post) %: %.scm |
< < < < |
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
post = $(if $(debug),, && strip $@) cc-post = $(post) sc-post = $(post) mc-post = $(post) os = $(shell uname -o) %: %.c $(cc) $< -o$@ $(cc-post) %: %.ml $(mc) $< -o $@ $(mc-post) %: %.scm |