Subject: RE: [hackers-il] summoning a daemon

From: Chen Shapira <[email-masked]>
Date: Tue, 28 Nov 2000 09:11:49 +0200

There was a suggestion a while back to make a signature with a diffrent
fortune every mail by having a daemon writing a fortune to file everytime
you try reading the file.

> -----Original Message-----
> From: mulix [mailto:[email-masked]]
> Sent: Tuesday, November 28, 2000 1:12 AM
> To: [email-masked]
> Subject: [hackers-il] summoning a daemon
> 
> 
> hi,
> 
> in january i will give to haifux (haifa's linux club) a 
> lecture on writing
> daemons.
> 
> i'd like the lecture to be based upon my experiences writing a daemon.
> the lecture will detail the design process and the 
> implementation issues
> specific to a daemon.
> 
> unfortunately, i don't have a good idea for a daemon. so, what is that
> little background utility you always wanted and never found 
> on freshmeat?
> what will make a "cool" (for any definition of "cool") 
> daemon? any ideas
> will be welcome.
> 
> haifux members will thank you, too, since a good idea will 
> spare them the
> joys of listening about the
> free-disk-space-watching-sould've-been-a-cron-job daemon i 
> will default
> to...
> 
> thanks in advance,
> -- 
> mulix
> 
> linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead
> 
> 
> -------------------------- eGroups Sponsor 
> -------------------------~-~>
> eGroups eLerts
> It's Easy. It's Fun. Best of All, it's Free!
> http://click.egroups.com/1/9698/4/_/_/_/975366727/
> --------------------------------------------------------------
> -------_->
> 
> To unsubscribe from this group, send an email to:
> [email-masked]
> 
> 
>

---

From: Moshe Zadka <[email-masked]>
Date: Tue, 28 Nov 2000 09:30:12 +0200 (IST)

> you try reading the file.

Or, if you want to actually advance the state of software, write something
like inetd which works with SSL. Or something like inetd which works by
"stealth authorization": for connecting to a port X you need to first
connect to port f(X) and f'(X) (and so on...) from the some IP. This
is *not* security by obscurity: this is solid good old fashioned
cryptography, if f,f' etc. also have a second parameter key...

This means you'll be able to have a simple client which requests a key
and connects to the specified ports, and then you can run (say) IE
and connect to the code. 

You can have variants on the idea if you also want to stop replay
attacks, but I think I've blubbered enough for now.
--
Moshe Zadka <[email-masked]> -- 95855124
http://advogato.org/person/moshez

---

From: Omer Zak <[email-masked]>
Date: Tue, 28 Nov 2000 10:49:06 +0200 (EET)

How about a daemon, which accepts from an user a request for a privileged
operation (from a restricted set of operations allowed to that user), and
executes the operation as root?

The user's requests will typically consist of keywords, perhaps without
arguments (such as 'poweroff' for shutdown -h now, or 'reboot' for
shutdown -r now, or 'isdnup'/'isdndown' for connecting/disconnecting an
ISDN line).

                                             --- Omer
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html

---

From: "Nadav Har'El" <[email-masked]>
Date: Tue, 28 Nov 2000 14:52:42 +0200

> you try reading the file.

This makes sense as an example, but as a real-world tool it is much more
convenient to ask your mailer to run a program for you rather than messing
around with such a daemon (on a multi-user system where you're not the
administrator, it's not easy to get this daemon to automatically rerun
on reboot - although tricks like putting it in the crontab and/or .profile
can help).

For example in mutt (my favorite mailer), you put a "signature" variable
like
	set signature="~/bin/muttsig|"

where the final "|" tells mutt that this is a program to run, not a normal
file. I bet that other mailers have similar options, but possibly not all
of them do.

If anyone is interested in my muttsig program (which generates the signatures
as below), here it is (please don't use the layout as-is - it's like using
somebody else's signature ;)).

#!/usr/bin/zsh
typeset -R40 date
date=$(print -P "%D{%A}, %D{%b %e %Y}, $(taarich)")

FOL=$HOME/lib/signatures.fol
integer n l
n=${$(wc -l $FOL)##$FOL}
l=RANDOM%n+1

fol=(`sed -n ${l}p $FOL`)
# format $fol for 2 40-character lines.
line1=
line2=
n=0
for i in $fol
do
	if ((n))
	then
		# add to second line
		line2="$line2 $i"
	else
		# TODO: if line1 is empty, we don't need a space here
		if ((${#line1}))
		then
			concat="$line1 $i"
		else
			concat="$i"
		fi
		if ((${#concat}>40)) then
			n=1
			line2="$i"
		else
			line1="$concat"
		fi
	fi
done

print -r "Nadav Har'El                        | $date"
print -r "[email-masked]             |-----------------------------------------"
print -r "Phone: +972-53-245868, ICQ 13349191 |$line1"
print -r "http://nadav.harel.org.il           |$line2"

-- 
Nadav Har'El                        |      Tuesday, Nov 28 2000, 1 Kislev 5761
[email-masked]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |Despite the cost of living, have you
http://nadav.harel.org.il           |noticed how it remains so popular?