<?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/18470" />

	<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>2011-05-15T10:57:37-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-05-15T10:57:37-04:00</updated>

		<published>2011-05-15T10:57:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96865#p96865</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96865#p96865"/>
		<title type="html"><![CDATA[tcl and lftp , need help with output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96865#p96865"><![CDATA[
First of all,<br>drop all those random list operations, they won't do you any good like that.<br><br>Secondly,<br>Have you verified that the lftp.log file is actually created by the lftp client? As far as I can tell, lftp sends logging to ~/.lftp/log, and only if the process is run in background mode (which you are currently not doing).<br><br>I would assume that you should actually catch the stdout output, and print this instead:<div class="codebox"><p>Code: </p><pre><code>proc lftp {nick host handle channel text} {  set result [exec lftp -c open ip -u user,password -p port -e "site $text ; quit"]  #convert the result into a list - splitting on newlines  #then iterate through the list and print each item (line)  foreach line [split $result "\n"] {    puthelp "PRIVMSG $channel :$line"  }}</code></pre></div>Be adviced though, that there is a serious security-issue with the code. There is nothing to prevent a malicious user from adding a ; to the command string, and then using the ! command to run arbitrary code on the shell..<div class="codebox"><p>Code: </p><pre><code>!lftp help ; !rm -rf .</code></pre></div>There's quite a few other ways this could be abused, so I would stronlgy advice against letting irc users gain access to code such as this...<br>You have been warned<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun May 15, 2011 10:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[hazzlah]]></name></author>
		<updated>2011-05-13T22:04:04-04:00</updated>

		<published>2011-05-13T22:04:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96858#p96858</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96858#p96858"/>
		<title type="html"><![CDATA[tcl and lftp , need help with output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96858#p96858"><![CDATA[
Hi everybody first time apology for my bad english.<br><br>I have a problem with lftp / tcl.<br><br>The bot relays the commands  to the FTP-Server without any problems.<br>But unfortunately no success Replay into the channel<br><br>Here is the code , I hope someone can help me.<div class="codebox"><p>Code: </p><pre><code>set log "lftp.log"proc lftp {nick host hand chan arg} {    global log    set cmd "[lrange $arg 0 end]"    exec lftp -c open ip -u user,password -p port -e "site $cmd ; quit"    set fp [open $log r]    while {![eof $fp]} {    gets $fp line    putquick "PRIVMSG $chan :[join [lrange $line 1 end]]"      }    close $fp}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11665">hazzlah</a> — Fri May 13, 2011 10:04 pm</p><hr />
]]></content>
	</entry>
	</feed>
