<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/4464" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2003-05-25T14:28:41-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/4464</id>

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-05-25T14:28:41-04:00</updated>

		<published>2003-05-25T14:28:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20639#p20639</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20639#p20639"/>
		<title type="html"><![CDATA[problem with suid + environment variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20639#p20639"><![CDATA[
I now solved the problem with a little code-hacking and without suid.<br><br>-&gt; <a href="http://forum.egghelp.org/viewtopic.php?t=1266" class="postlink">http://forum.egghelp.org/viewtopic.php?t=1266</a><br><div class="codebox"><p>Code: </p><pre><code>diff -burN eggdrop1.6.9/src/chroot.h eggdrop1.6.9+chroot/src/chroot.h--- eggdrop1.6.9/src/chroot.hWed Dec 31 18:00:00 1969+++ eggdrop1.6.9+chroot/src/chroot.hFri Mar 15 17:29:23 2002@@ -0,0 +1,11 @@++/* Change these to the proper uid/gid */+uid_t   uid  = 568;+gid_t   gid  = 568;++/* Change this to where the chroot is */+char    *dir = "/chroot";++/* Change this to the directory the bot will run outta */+char    *eggdir = "/chroot/eggdrop";+diff -burN eggdrop1.6.9/src/main.c eggdrop1.6.9+chroot/src/main.c--- eggdrop1.6.9/src/main.cTue Jan 15 21:24:17 2002+++ eggdrop1.6.9+chroot/src/main.cFri Mar 15 17:30:35 2002@@ -51,6 +51,7 @@ #include "modules.h" #include "tandem.h" #include "bg.h"+#include "chroot.h"  #ifdef CYGWIN_HACKS #include &lt;windows.h&gt;@@ -692,6 +693,15 @@   FILE *f;   struct sigaction sv;   struct chanset_t *chan;++  if (chdir(eggdir))+    fatal("ERROR: cannot chdir.", 0);+  else if(chroot(dir))+    fatal ("ERROR: chroot failed.", 0);+  else if(setgid(gid))   +    fatal ("ERROR: setgid failed.", 0);+  else if (setuid(uid))+    fatal ("ERROR: setuid failed.", 0);  #ifdef DEBUG_MEM   /* Make sure it can write core, if you make debug. Else it's pretty</code></pre></div>(woks in 1.6.15 as well) recompiling and now it's back on track in its own little chroot <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br><br>Levi<p>Statistics: Posted by Guest — Sun May 25, 2003 2:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-05-25T10:01:11-04:00</updated>

		<published>2003-05-25T10:01:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20629#p20629</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20629#p20629"/>
		<title type="html"><![CDATA[problem with suid + environment variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20629#p20629"><![CDATA[
Are your sure the path in the ENV variable is available within the chroot-jail?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sun May 25, 2003 10:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-05-24T21:48:39-04:00</updated>

		<published>2003-05-24T21:48:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20604#p20604</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20604#p20604"/>
		<title type="html"><![CDATA[problem with suid + environment variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20604#p20604"><![CDATA[
I want to run my eggdrop in a chroot-jail. For this reason I have set the suid-flag and start it from root. <br><br>But now it doesn't recognize the LD_LIBRARY_PATH variable anymore (it IS set for both user) and therefore doesn't find the tcl-library ( error while loading shared libraries: libtcl8.4.so: cannot open shared object file: No such file or directory ).<br><br>Starting it without suid works, but as user I can't execute chroot and as root I can't start eggdrop <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":-?" title="Confused"><br><br>How do I pass this environment variable to a suid'd file or let it find on another way (simply copying it into the eggdrop diretory doesn't work also)<br><br><br>Levi<p>Statistics: Posted by Guest — Sat May 24, 2003 9:48 pm</p><hr />
]]></content>
	</entry>
	</feed>
