1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

umask and CGI

Discussion in 'Plesk for Linux - 8.x and Older' started by Gorgon@, Jun 8, 2005.

  1. Gorgon@

    Gorgon@ Guest

    Hi folks,

    I'm having a strange issue with file creation permissions when a CGI script runs. This doesn't seem to be a Plesk issue in particular but I'm wondering if anyone else has seen something similar.

    The server is RHE v3, apache, etc. I confirmed from SW-Soft that their version of suexec is not compiled with a default umask. Thus, in theory, if you set the umask in the apache startup script, the apache sub-processes will adopt that umask.

    This seems to work most of the time. Especially when I run my test CGI script. But in some cases, the umask defaults to 077. Since the file is only readable by the owner, the apache process (running as user apache) cannot read files created by the CGI script.

    This can be a real pain. I have at least one customer running ShopSite which is a set of compiled programs. Thus I cannot edit them directly. I have a hack setup to fix the immediate problem. I've noticed this problem with other scripts too but those have been perl scripts and I've been able to modify them to set the umask internally.

    But the question is, why does the umask seem to be correct sometimes but not all of the time? I have restarted apache a few times to make sure it has the correct umask at start time.

    Since this is sort of off-topic for this forum, could anyone recommend a more appropriate forum?