Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Apr 2002 00:18:26 -0400
From:      "Roger Williams" <rogerw1962@hotmail.com>
To:        questions@freebsd.org
Subject:   freebsd and suexec
Message-ID:  <F197p69viM0jB06F2LP00005c9d@hotmail.com>

next in thread | raw e-mail | index | archive | help
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

<PATCH>
+++ suexec.c    Mon Sep  6 21:47:33 1999
@@ -75,6 +75,7 @@
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <login_cap.h>

#include <stdarg.h>

@@ -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);
     }

     /*

</PATCH>


<ERROR>
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

</ERROR>


_________________________________________________________________
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F197p69viM0jB06F2LP00005c9d>