Commit Graph

12 Commits

Author SHA1 Message Date
Leah Neukirchen
07ee45cf31 mgenmid: fix pledge, needs dns
Found by lhynes.
2020-09-07 16:01:26 +02:00
Tim Kuijsten
4763032430 pledge(2) all programs
All programs except mshow have a very tight set of promises. mshow
has a broad set of promises and might be a good future candidate
to further restrict using unveil(2).

This patch is based on commit 0300a112 by Alex Holst (dated
2017-12-07), which was proposed in GH PR #79.

* pledged mpick, mflow and mdate so that now all programs are pledged
* removed some unneeded promises and added some missing promises
* move err.h include and OpenBSD ifdef into a new xpledge.h
* cleaned up code aligning and whitespace

Closes: #179 [via git-merge-pr]
2020-09-06 16:34:56 +02:00
Leah Neukirchen
5280abfa10 mgenmid: do not use raw timestamp
We one-time-pad the timestamp with a random key instead.
This will provide enough entropy to be unique, but not leak the system date.
Even with a bad RNG state it should guarantee uniqueness, however.
2018-12-25 19:31:34 +01:00
Leah Neukirchen
5f45b7d533 use appropriate integer types
Mainly found with clang -Wconversion -Wshorten-64-to-32.
2017-10-06 13:15:28 +02:00
Leah Neukirchen
66d0eff12f style 2017-08-31 17:30:17 +02:00
Leah Neukirchen
6f99ef55a8 mgenmid: printb36: fix off-by-one
Closes #73.
2017-08-21 19:40:00 +02:00
leovilok
1f097f28e0 mgenmid: fix fallback random generation on 32bit
lrand48 returns a long int, which is 32bits wide on 32bits systems

Closes: #28 [via git-merge-pr]
2017-04-22 13:55:32 +02:00
Leah Neukirchen
6b9f742d7d mgenmid: use gettimeofday instead of clock_gettime
Fixes #17.

Nanosecond precision wasn't needed, and many legacy operating systems
don't support this POSIX.1-2001 function.

We now use plain microseconds for the timestamp, which uses the range of
the 64-bit number better as well.  This will result in a Year 294247 problem.
2017-03-26 19:03:16 +02:00
Leah Neukirchen
2b4e3aa66d clean up whitespace 2017-01-26 20:27:26 +01:00
Ivy Foster
ca8cef1660 Add $MBLAZE environment variable to set profile location
As a side benefit, all callers of blaze822_home_file need only pass
the filename, so the base directory is set in only one place.
2016-09-01 18:50:20 -05:00
Christian Neukirchen
41474c2e68 rename .santoku to .mblaze 2016-08-01 19:36:23 +02:00
Christian Neukirchen
78fec302cb add mgenmid 2016-08-01 17:21:39 +02:00