Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netserver: do not chmod("/dev/null", 0644) when suppress_debug==1 #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jun 17, 2021

  1. netserver: do not chmod("/dev/null", 0644) when suppress_debug==1 (de…

    …fault).
    
    When running as root, chmod("/dev/null", 0644) will break most Unix-like
    systems as "/dev/null" can't be open for write by non-root users anymore.
    
    Before the fix:
    root@linux# strace -f -e chmod ./netserver
    Starting netserver with host 'IN(6)ADDR_ANY' port '12865' and family AF_UNSPEC
    strace: Process 976220 attached
    [pid 976219] +++ exited with 0 +++
    chmod("/dev/null", 0644)                = 0
    
    Fixes: 5380b1f ("netserver: use mkstemp to create/open debug file")
    chenshuo committed Jun 17, 2021
    Configuration menu
    Copy the full SHA
    fd9e294 View commit details
    Browse the repository at this point in the history