Joachim Nilsson
55c49a0bf0
Sanitize job[:id] tuple read from UNIX socket using a regex
...
This is a really tight check for a single "job[:id]" tuple, not much
escapes it, Coverity should be a lot more happy about our addressing
CWE-20 with this one.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2020-01-07 02:51:15 +01:00
Joachim Nilsson
338c358a75
Defensive programming, check bounds of loop variable first
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2020-01-07 02:51:15 +01:00
Joachim Nilsson
6a1082a947
New helper function: echo(), like shell echo but for C
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2019-02-05 10:33:00 +01:00
Joachim Nilsson
ddf1bce642
Add screen_exit() fn to restore screen defaults in debug mode
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2018-01-23 09:31:44 +01:00
Joachim Nilsson
f11ebb0046
New function, strtobytes(), allows k/M/G ISO size modifiers
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2018-01-15 19:42:33 +01:00
Joachim Nilsson
b5e260b9e0
Minor refactor
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2018-01-15 18:30:41 +01:00
Joachim Nilsson
dc5b1a5980
Increase size of intermediate buffers
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2018-01-15 12:19:51 +01:00
Joachim Nilsson
f6fa576270
New functions: jiffies() and uptime(), implemented with sysinfo()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-12-31 18:28:29 +01:00
Joachim Nilsson
44007c86f2
initctl: Fix problem with start/stop using job ID
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-24 08:51:50 +01:00
Joachim Nilsson
6a2911223d
Fix screen_init() regression introduced in a6290da
...
A simple missing semicolon caused initscr() to not be called properly.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-19 12:26:45 +01:00
Joachim Nilsson
a6290da210
screen_init(): Verify that STDOUT is a TTY
...
Before we call screen_init(), which in turn calls libite:initscr(),
which in turn does a lot of tcgetattr() and termios to STDOUT to figure
out the size, we need to check that we're not backgrounded, or don't
actually have a TTY. Problem reported by @wkz
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-23 19:16:51 +02:00
Joachim Nilsson
14ee218443
Refactor, use libite (-lite) version of initscr()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-09 16:25:22 +02:00
Joachim Nilsson
0b43d0dc70
Refactor screen_init(), preparing for migration to libite
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-07 23:00:27 +02:00
Joachim Nilsson
be6f0de0df
Add util.c:screen_init() to probe screen size once per boot
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 20:58:43 +02:00
Joachim Nilsson
90793c71a2
util: Import screen_width() developed for the SMCRoute project
...
This patch introduces the screen_width() method from the SMCRoute
project. The code is hereby also available under MIT/X11.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 12:53:19 +02:00
Joachim Nilsson
fff68b7b06
Relocate source files to an src/ subdirectory
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:31:02 +01:00