generators: drop umask calls

systemd already sets the umask (see e3b8d0637d). When
running under systemd, we don't need to set it. And when *not* running under
systemd, for example during development, there is no reason to override the user
config. Let's just drop those calls.

$ git grep -e 'umask\(' -l 'src/*generator*' |xargs perl -i -0pe 's|^[^\n]*umask\([^\n]+\n\n||gms'
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-11-21 10:12:00 +01:00
parent aa1f95d264
commit 053254e3cb
11 changed files with 0 additions and 22 deletions

View File

@ -24,8 +24,6 @@ int main(int argc, char *argv[]) {
log_setup_generator();
umask(0022);
if (argc > 1 && argc != 4) {
log_error("This program takes three or no arguments.");
return EXIT_FAILURE;

View File

@ -585,8 +585,6 @@ int main(int argc, char *argv[]) {
log_setup_generator();
umask(0022);
arg_disks = hashmap_new(&string_hash_ops);
if (!arg_disks) {
r = log_oom();

View File

@ -155,8 +155,6 @@ static int run(int argc, char *argv[]) {
log_setup_generator();
umask(0022);
r = proc_cmdline_parse(parse_proc_cmdline_item, NULL, PROC_CMDLINE_RD_STRICT | PROC_CMDLINE_STRIP_RD_PREFIX);
if (r < 0)
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");

View File

@ -882,8 +882,6 @@ static int run(int argc, char *argv[]) {
log_setup_generator();
umask(0022);
r = proc_cmdline_parse(parse_proc_cmdline_item, NULL, 0);
if (r < 0)
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");

View File

@ -123,8 +123,6 @@ int main(int argc, char *argv[]) {
log_setup_generator();
umask(0022);
if (detect_container() > 0) {
_cleanup_free_ char *container_ttys = NULL;

View File

@ -681,8 +681,6 @@ int main(int argc, char *argv[]) {
log_setup_generator();
umask(0022);
if (detect_container() > 0) {
log_debug("In a container, exiting.");
return EXIT_SUCCESS;

View File

@ -74,8 +74,6 @@ static int run(int argc, char *argv[]) {
log_setup_generator();
umask(0022);
if (argc > 1 && argc != 4) {
log_error("This program takes three or no arguments.");
return -EINVAL;

View File

@ -54,8 +54,6 @@ int main(int argc, char *argv[]) {
log_setup_generator();
umask(0022);
if (access(RC_LOCAL_SCRIPT_PATH_START, X_OK) >= 0) {
log_debug("Automatically adding rc-local.service.");

View File

@ -64,8 +64,6 @@ int main(int argc, char *argv[]) {
log_setup_generator();
umask(0022);
r = generate_symlink();
if (r > 0) {

View File

@ -934,8 +934,6 @@ static int run(int argc, char *argv[]) {
if (argc > 1)
arg_dest = argv[3];
umask(0022);
r = lookup_paths_init(&lp, UNIT_FILE_SYSTEM, LOOKUP_PATHS_EXCLUDE_GENERATED, NULL);
if (r < 0)
return log_error_errno(r, "Failed to find lookup paths: %m");

View File

@ -212,8 +212,6 @@ int main(int argc, char *argv[]) {
log_setup_generator();
umask(0022);
r = proc_cmdline_parse(parse_proc_cmdline_item, NULL, PROC_CMDLINE_STRIP_RD_PREFIX);
if (r < 0) {
log_warning_errno(r, "Failed to parse kernel command line: %m");