Project

General

Profile

Actions

Bug #1959

closed

spawn-fcgi crashing with name instead of uid/gid for uid/gid field

Added by brad@comstyle.com over 15 years ago. Updated over 15 years ago.

Status:
Fixed
Priority:
High
Target version:

Description

Running spawn-fcgi and specifying the uid/gid as names instead of the uid/gid values for some reason spawn-fcgi has started crashing for one particular user. If I change the name to the uid/gid values spawn-fcgi executes properly and forks off the processes as expected. This used to work fine and I am not quite sure if 1.6.x introduced this over spawn-fcgi that came with lighttpd 1.4.22 or if could be something else going on. This works for a handful of other FastCGI apps with the identical configuration but different uid/gid combination's.

.e.g.

#USERID=5thscalecanada
#GROUPID=5thscalecanada
USERID=1009
GROUPID=1009

...

env - $E $SPAWNFCGI -a $FCGI_WEB_SERVER_ADDRS -c /var/www -p $FCGIPORT -f $FCGIPROGRAM -u $USERID -g $GROUPID -C $PHP_FCGI_CHILDREN

Compiling spawn-fcgi with debug symbols shows the following trace starting up spawn-fcgi with this userid/groupid.

  1. /var/www/fastcgi/startup/webmail.5thscale-startup.sh
    Segmentation fault (core dumped)
  2. gdb spawn-fcgi spawn-fcgi.core
    GNU gdb 6.3
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB. Type "show warranty" for details.
    This GDB was configured as "amd64-unknown-openbsd4.5"...
    Core was generated by `spawn-fcgi'.
    Program terminated with signal 11, Segmentation fault.
    Reading symbols from /usr/lib/libc.so.50.1...done.
    Loaded symbols for /usr/lib/libc.so.50.1
    Reading symbols from /usr/libexec/ld.so...done.
    Loaded symbols for /usr/libexec/ld.so
    #0 0x0000000000402248 in find_user_group (user=0x7f7ffffc268d "5thscalecanada", group=0x7f7ffffc269f "5thscalecanada", uid=0x7f7ffffc1f8c,
    gid=0x7f7ffffc1f84, username=0x7f7ffffc1f78) at spawn-fcgi.c:332
    332 if (username) username = my_pwd->pw_name;
    (gdb) bt full
    #0 0x0000000000402248 in find_user_group (user=0x7f7ffffc268d "5thscalecanada", group=0x7f7ffffc269f "5thscalecanada", uid=0x7f7ffffc1f8c,
    gid=0x7f7ffffc1f84, username=0x7f7ffffc1f78) at spawn-fcgi.c:332
    my_uid = 5
    my_gid = 0
    my_pwd = (struct passwd *) 0x0
    my_grp = (struct group *) 0x0
    #1 0x0000000000402a42 in main (argc=15, argv=0x7f7ffffc2180) at spawn-fcgi.c:523
    real_username = 0x0
    uid = 0
    sockuid = 244327664
    gid = 0
    sockgid = 4294967295
    fcgi_app = 0x7f7ffffc266f "/usr/local/bin/php-fastcgi"
    changeroot = 0x7f7ffffc265a "/var/www"
    username = 0x7f7ffffc268d "5thscalecanada"
    groupname = 0x7f7ffffc269f "5thscalecanada"
    unixsocket = 0x0
    pid_file = 0x0
    sockusername = 0x0
    sockgroupname = 0x0
    fcgi_dir = 0x0
    addr = 0x7f7ffffc264d "127.0.0.1"
    fcgi_app_argv = (char *
    ) 0x0
    port = 64003
    sockmode = -1
    child_count = 2
    fork_count = 1
    i_am_root = 1
    o = -1
    pid_fd = -1
    nofork = 0
    sockbeforechroot = 0
    un = {sun_len = 15 '\017', sun_family = 0 '\0',
    sun_path = "\000\000\000\000\000\000Q#\220\016\002\000\000\000\002\002\000\000\000\000\000\000(\220\213\n\002\000\000\000Ù+¡\003\002\000\000\000ªM\234\003\002\000\000\0000&üÿ\177\177\000\0008!üÿ\177\177\000\000\200!üÿ\177\177\000\000\017", '\0' <repeats 15 times>, "Z\201ÿÿ\177\177\000\000M,¡\003\002\000\000\000@,"}
    fcgi_fd = -1
Actions #1

Updated by stbuehler over 15 years ago

I guess i didn't try usernames starting with a digit...

Actions #2

Updated by stbuehler over 15 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r42.

Actions #3

Updated by stbuehler over 15 years ago

  • Target version set to 1.6.2
Actions

Also available in: Atom