From d529707547ae73fdd19221a43fdd0f7438e21b92 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 19 Dec 2025 16:44:15 +0100 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- common.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 common.h (limited to 'common.h') diff --git a/common.h b/common.h new file mode 100644 index 0000000..600f009 --- /dev/null +++ b/common.h @@ -0,0 +1,47 @@ +/* See LICENSE file for copyright and license details. */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "arg.h" + +#ifndef RETRY_SLEEP +# define RETRY_SLEEP 1 +#endif + +#define EXIT_ERROR 125 +#define EXIT_EXEC 126 +#define EXIT_NOENT 127 + + +#if defined(__GNUC__) +# define NORETURN __attribute__((__noreturn__)) +#else +# define NORETURN +#endif + + +extern char *command_str; + +NORETURN void usage(void); +void parse_cmdline(int argc, char **argv); +char *get_user_and_host(const char *prefix, const char *suffix); +int check_passphrase(const char *passphrase, void (*block_callback)(void)); +void start_gasroot_setuid(char **argv); +void wipe_(void *textptr); + +static inline void +wipe(char *text) +{ + wipe_(&text); +} -- cgit v1.2.3-70-g09d2