lsphp and umask

#1
Hi there!

Unfortunately i need to use the following umask for our sites:

0007

Files created by php should be using this umask.
I tried to write a php wrapper-script but it didn't work .

Code:
#!/bin/sh

umask 0007
exec /usr/local/lsws/fcgi-bin/lsphp5-bin
I even tried to but the umask into the init.d script of lshttpd, but it didn't work either.

Thank you for your help!

Alex
 

mistwang

LiteSpeed Staff
#2
I think it should follow the system wide configuration, suEXEC should pull that from system configuration, changing lshttpd umask does not matter, I believe.
 
#3
Hi!

Tried to change umask in /etc/login.defs and /etc/profile but it didn't work.
I made a "strace -f /etc/init.d/lsws start 2> /tmp/strace.log" and
found that the pid 1089 sets the umask to 022 but i can't find an open call where the process reads the umask information.

Please let me know how i can set the umask because this really important
for our project in which we would like to use LiteSpeed Enterprise.

Thank you for your help.

Alex

Code:
[pid  1089] close(3)                    = 0
[pid  1089] open("/lib/libdl.so.2", O_RDONLY) = 3
[pid  1089] read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\332\305\0004\0\0\0"..., 512) = 512
[pid  1089] fstat64(3, {st_mode=S_IFREG|0755, st_size=16428, ...}) = 0
[pid  1089] mmap2(0xc5d000, 12408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xc5d000
[pid  1089] mmap2(0xc5f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xc5f000
[pid  1089] close(3)                    = 0
[pid  1089] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x484000
[pid  1089] set_thread_area({entry_number:-1 -> 6, base_addr:0x4848d0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_pr
esent:0, useable:1}) = 0
[pid  1089] mprotect(0xc5f000, 4096, PROT_READ) = 0
[pid  1089] mprotect(0xd2b000, 4096, PROT_READ) = 0
[pid  1089] mprotect(0xc55000, 8192, PROT_READ) = 0
[pid  1089] mprotect(0xd02000, 4096, PROT_READ) = 0
[pid  1089] mprotect(0xb12000, 4096, PROT_READ) = 0
[pid  1089] munmap(0x22e000, 24477)     = 0
[pid  1089] brk(0)                      = 0x8389000
[pid  1089] brk(0x83aa000)              = 0x83aa000
[pid  1089] time(NULL)                  = 1205845791
[pid  1089] brk(0x83cb000)              = 0x83cb000
[pid  1089] umask(022)                  = 022
[pid  1089] time(NULL)                  = 1205845791
[pid  1089] rt_sigaction(SIGTERM, {0x8074e94, [], SA_RESTART}, {SIG_DFL}, 8) = 0
[pid  1089] rt_sigaction(SIGHUP, {0x8074ec4, [], SA_RESTART}, {SIG_DFL}, 8) = 0
[pid  1089] rt_sigaction(SIGPIPE, {0x8074ea8, [], SA_RESTART}, {SIG_DFL}, 8) = 0
 
#5
What is process 1089? lshttpd? or lsphp? or lscgid?
What is the default umask in your system now when you login as a normal user?
Code:
# cat strace.log | grep umask
[pid 32494] umask(022)                  = 07

# cat ps-output.txt | grep 32494
root     32494  0.0  0.1   4172  1664 pts/2    T+   22:13 0:00   ./lshttpd
When i set the umask in /etc/login.defs and /etc/bashrc to 007 the root and
the normal users have the the 007 umask but LiteSpeed uses 022.
The files created by php also get the 022 umask.
 

mistwang

LiteSpeed Staff
#6
Please try the latest 3.3.9 build, change the version number in the download link to get it.
lshttpd will restore the default umask before starting PHP processes now.
 
Top