+             * If called as suexec.fcgi ignore if there is no passwd
 +             * entry for specified UID. Also bail out if UID = 0.
 +             */
-+            if(!strcmp(base_pathname(prog),"suexec.fcgi")) {
++            if(!strcmp(base_pathname(argv[0]),"suexec.fcgi")) {
 +                tpw.pw_name = strdup(target_uname);
 +                tpw.pw_uid = atoi(target_uname);
 +                tpw.pw_dir = (char *)"/tmp";
 +     * name/group is different from the name/group of the cwd
 +     * or the program.
 +     */
-+    if(strcmp(base_pathname(prog),"suexec.fcgi")) {
++    if(strcmp(base_pathname(argv[0]),"suexec.fcgi")) {
 +        if ((uid != dir_info.st_uid) ||
 +            (gid != dir_info.st_gid) ||
 +            (uid != prg_info.st_uid) ||