diff options
Diffstat (limited to 'server/tools/tools_util.h')
-rw-r--r-- | server/tools/tools_util.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/tools/tools_util.h b/server/tools/tools_util.h index 7c66c119..0520731a 100644 --- a/server/tools/tools_util.h +++ b/server/tools/tools_util.h @@ -22,6 +22,16 @@ } \ } while(0) +#define CHECK_ROOT(val, prg_name) do { \ + val = getuid(); \ + if (val != 0) { \ + DEBUG(1, ("Running under %d, must be root\n", val)); \ + ERROR("%s must be run as root\n", prg_name); \ + val = EXIT_FAILURE; \ + goto fini; \ + } \ +} while(0) + enum id_domain { ID_IN_LOCAL = 0, ID_IN_LEGACY_LOCAL, @@ -50,4 +60,6 @@ enum id_domain find_domain_for_id(struct tools_ctx *ctx, uint32_t id, struct sss_domain_info **dom_ret); +int set_locale(void); + #endif /* __TOOLS_UTIL_H__ */ |