diff options
author | Peter Powell <petpow@saberuk.com> | 2019-01-29 01:35:00 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-01-29 21:18:18 +0000 |
commit | 59ddf1a456265da6d2303373a40ecc34e62a9073 (patch) | |
tree | 136f89c1f315f1952f16114c6e5d4cab79d2fb97 /configure | |
parent | 202ba7d76d2d89b61f82978a782c6bc8529ee8d4 (diff) |
Improve setting the gid/uid which will own files.
- Consistently set the gid/uid for all directories and files.
- Replace the obnoxious warning about root on `make install` with
a friendlier warning whilst running configure.
- Always install the inspircd executable and modules.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -207,6 +207,20 @@ if (defined $opt_gid) { } else { @group = $opt_system ? getgrnam('irc') : getgrgid($config{GID} // getgid()); print_error "you need to specify a group to run as using '--gid [id|name]'!" unless @group; + unless ($group[2]) { + print_warning <<"EOW"; +You are building as the privileged $group[0] group and have not specified +an unprivileged group to run InspIRCd as. + +This is almost never what you should do. You should probably either create a new +unprivileged user/group to build and run as or pass the '--gid [id|name]' flag +to specify an unprivileged group to run as. +EOW + if (!prompt_bool $interactive, "Are you sure you want to build as the $group[0] group?", 0) { + say STDERR "If you are sure you want to build as the $group[0] group pass the --gid $group[2] flag." unless $interactive; + exit 1; + } + } } $config{GROUP} = $group[0]; $config{GID} = $group[2]; @@ -219,6 +233,20 @@ if (defined $opt_uid) { } else { @user = $opt_system ? getpwnam('irc') : getpwuid($config{UID} // getuid()); print_error "you need to specify a user to run as using '--uid [id|name]'!" unless @user; + unless ($user[2]) { + print_warning <<"EOW"; +You are building as the privileged $user[0] user and have not specified +an unprivileged user to run InspIRCd as. + +This is almost never what you should do. You should probably either create a new +unprivileged user/group to build and run as or pass the '--uid [id|name]' flag +to specify an unprivileged user to run as. +EOW + if (!prompt_bool $interactive, "Are you sure you want to build as the $user[0] user?", 0) { + say STDERR "If you are sure you want to build as the $user[0] user pass the --uid $user[2] flag." unless $interactive; + exit 1; + } + } } $config{USER} = $user[0]; $config{UID} = $user[2]; |