From owner-freebsd-questions Thu Apr 11 21:18:32 2002 Delivered-To: freebsd-questions@freebsd.org Received: from hotmail.com (f197.law11.hotmail.com [64.4.17.197]) by hub.freebsd.org (Postfix) with ESMTP id 9E47F37B405 for ; Thu, 11 Apr 2002 21:18:26 -0700 (PDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 11 Apr 2002 21:18:26 -0700 Received: from 67.34.228.57 by lw11fd.law11.hotmail.msn.com with HTTP; Fri, 12 Apr 2002 04:18:26 GMT X-Originating-IP: [67.34.228.57] From: "Roger Williams" To: questions@freebsd.org Subject: freebsd and suexec Date: Fri, 12 Apr 2002 00:18:26 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 12 Apr 2002 04:18:26.0558 (UTC) FILETIME=[17BE39E0:01C1E1D9] Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello, Im trying to get suexec to work with "/etc/login.conf classes" limits and have applied many patches and everyone returns something similar to the error below. Im runing or trying to run apache 1.3.23, can anyone tell me what is going on or what I'm doing wrong? PLEASE!!!!!!!!!!!!! Thanks, Roger +++ suexec.c Mon Sep 6 21:47:33 1999 @@ -75,6 +75,7 @@ #include #include #include +#include #include @@ -250,6 +251,7 @@ char *cmd; /* command to be executed */ char cwd[AP_MAXPATH]; /* current working directory */ char dwd[AP_MAXPATH]; /* docroot working directory */ + login_cap_t *lc; /* user resource limits */ struct passwd *pw; /* password entry holder */ struct group *gr; /* group entry holder */ struct stat dir_info; /* directory info holder */ @@ -401,6 +403,19 @@ if ((gid == 0) || (gid < GID_MIN)) { log_err("cannot run as forbidden gid (%d/%s)\n", gid, cmd); exit(108); + } + + /* + * Apply user resource limits based on login class. + */ + if ((lc = login_getclassbyname(pw->pw_class, pw)) == NULL) { + log_err("failed to login_getclassbyname()\n"); + exit(109); + } + + if ((setusercontext(lc, pw, uid, LOGIN_SETRESOURCES)) != 0) { + log_err("failed to setusercontext()\n"); + exit(109); } /* gcc -c -I../os/unix -I../include -funsigned-char -DUSE_EXPAT -I../lib/exp at-lite -DNO_DL_NEEDED `../apaci` suexec.c gcc -funsigned-char -DUSE_EXPAT -I../lib/expat-lite -DNO_DL_NEEDED `../apaci` -o suexec -L../os/unix -L../ap suexec.o -lm -lap -los -lcrypt suexec.o: In function `main': suexec.o(.text+0x7b1): undefined reference to `login_getclassbyname' suexec.o(.text+0x7fd): undefined reference to `setusercontext' *** Error code 1 _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message