mirror of
https://github.com/systemd/systemd.git
synced 2025-03-11 20:58:27 +03:00
Remove string_free_erase
This commit is contained in:
parent
c7dd209526
commit
9ae4ef49cd
4
TODO
4
TODO
@ -90,8 +90,8 @@ Features:
|
|||||||
usefaultd() and make systemd-analyze check for it.
|
usefaultd() and make systemd-analyze check for it.
|
||||||
|
|
||||||
* paranoia: whenever we process passwords, call mlock() on the memory
|
* paranoia: whenever we process passwords, call mlock() on the memory
|
||||||
first. i.e. look for all places we use string_erase()/string_free_erase() and
|
first. i.e. look for all places we use string_erase()/free_and_erasep() and
|
||||||
augment them with mlock(). Also use MADV_DONTDUMP
|
augment them with mlock(). Also use MADV_DONTDUMP.
|
||||||
|
|
||||||
* Move RestrictAddressFamily= to the new cgroup create socket
|
* Move RestrictAddressFamily= to the new cgroup create socket
|
||||||
|
|
||||||
|
@ -1042,10 +1042,6 @@ char* string_erase(char *x) {
|
|||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *string_free_erase(char *s) {
|
|
||||||
return mfree(string_erase(s));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool string_is_safe(const char *p) {
|
bool string_is_safe(const char *p) {
|
||||||
const char *t;
|
const char *t;
|
||||||
|
|
||||||
|
@ -199,10 +199,6 @@ int free_and_strndup(char **p, const char *s, size_t l);
|
|||||||
|
|
||||||
char *string_erase(char *x);
|
char *string_erase(char *x);
|
||||||
|
|
||||||
char *string_free_erase(char *s);
|
|
||||||
DEFINE_TRIVIAL_CLEANUP_FUNC(char *, string_free_erase);
|
|
||||||
#define _cleanup_string_free_erase_ _cleanup_(string_free_erasep)
|
|
||||||
|
|
||||||
bool string_is_safe(const char *p) _pure_;
|
bool string_is_safe(const char *p) _pure_;
|
||||||
|
|
||||||
static inline size_t strlen_ptr(const char *s) {
|
static inline size_t strlen_ptr(const char *s) {
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "kbd-util.h"
|
#include "kbd-util.h"
|
||||||
#include "locale-util.h"
|
#include "locale-util.h"
|
||||||
#include "main-func.h"
|
#include "main-func.h"
|
||||||
|
#include "memory-util.h"
|
||||||
#include "mkdir.h"
|
#include "mkdir.h"
|
||||||
#include "os-util.h"
|
#include "os-util.h"
|
||||||
#include "parse-util.h"
|
#include "parse-util.h"
|
||||||
@ -68,7 +69,7 @@ STATIC_DESTRUCTOR_REGISTER(arg_locale_messages, freep);
|
|||||||
STATIC_DESTRUCTOR_REGISTER(arg_keymap, freep);
|
STATIC_DESTRUCTOR_REGISTER(arg_keymap, freep);
|
||||||
STATIC_DESTRUCTOR_REGISTER(arg_timezone, freep);
|
STATIC_DESTRUCTOR_REGISTER(arg_timezone, freep);
|
||||||
STATIC_DESTRUCTOR_REGISTER(arg_hostname, freep);
|
STATIC_DESTRUCTOR_REGISTER(arg_hostname, freep);
|
||||||
STATIC_DESTRUCTOR_REGISTER(arg_root_password, string_free_erasep);
|
STATIC_DESTRUCTOR_REGISTER(arg_root_password, erase_and_freep);
|
||||||
|
|
||||||
static bool press_any_key(void) {
|
static bool press_any_key(void) {
|
||||||
char k = 0;
|
char k = 0;
|
||||||
|
@ -47,7 +47,7 @@ static int run(int argc, char *argv[]) {
|
|||||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Wrong number of arguments.");
|
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Wrong number of arguments.");
|
||||||
|
|
||||||
if (streq(argv[1], "1")) {
|
if (streq(argv[1], "1")) {
|
||||||
_cleanup_string_free_erase_ char *line = NULL;
|
_cleanup_(erase_and_freep) char *line = NULL;
|
||||||
|
|
||||||
r = read_line(stdin, LONG_LINE_MAX, &line);
|
r = read_line(stdin, LONG_LINE_MAX, &line);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user