aboutsummaryrefslogtreecommitdiff
path: root/src/util_rt.c
diff options
context:
space:
mode:
authorDavid Timber <mieabby@gmail.com>2021-10-30 11:21:00 +0800
committerDavid Timber <mieabby@gmail.com>2021-10-30 11:21:00 +0800
commit6493fa5c7f616520eed25c2357914afe80c9eb56 (patch)
tree1c603ac9b4e15a727e9b88d720c2ef855dc61022 /src/util_rt.c
parenta932a46545c16fb0e42ccc5a4c43b7d67d152545 (diff)
Code documentation and bug fixes ...
* Add convenience function prne_sfree_str() * Use prne_sfree_str() to scrub off sensitive data * Making the brute force login vector optional BNE param cred_dict can be null * Use O_EXCL when creating temporary files * Fix bug where bne_cb_uptime() returns the up time of the child process, not the parent
Diffstat (limited to 'src/util_rt.c')
-rw-r--r--src/util_rt.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util_rt.c b/src/util_rt.c
index 8fce86b..95f117f 100644
--- a/src/util_rt.c
+++ b/src/util_rt.c
@@ -151,6 +151,19 @@ char *prne_redup_str (char *old, const char *str) {
return ret;
}
+void prne_sfree_str (char *s) {
+ char *p;
+
+ if (s == NULL) {
+ return;
+ }
+
+ for (p = s; *p != 0; p += 1) {
+ *p = 0;
+ }
+ prne_free(s);
+}
+
void prne_free (void *ptr) {
free(ptr);
}