Skip to content

nohup creates world-readable output files #10021

@sylvestre

Description

@sylvestre

Component

nohup

Description

The uutils nohup creates nohup.out using default file creation permissions (i.e. 0666 & ~umask). With a common umask like 022, this results in 0644 (world-readable).

In contrast, GNU coreutils nohup is expected to create nohup.out as owner-only (typically 0600) when it has to create the file.

This matters on multi-user systems where jobs might log sensitive data. Other users can read the file when they shouldn't be able to.

Reproduction

# uutils nohup
umask 022
nohup sh -c 'echo secret_data' && sleep 1 && ls -l nohup.out
# -rw-r--r-- (0644)  # typical, depends on umask and directory permissions

# GNU nohup
umask 022
nohup sh -c 'echo secret_data' && sleep 1 && ls -l nohup.out
# -rw------- (0600)  # expected GNU behavior when creating nohup.out

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions