Philipp Hasenfratz: open(mail "|$mailprog -t...im -T modus

Beitrag lesen

Halihallo Alain

Ich habe es mir jetzt selber angesehen:

aus http://gunther.web66.com/FAQS/taintmode.html#system:
---
When you make a system call to an external program or use its sister command, exec, taint mode also stops this from happening if the PATH has not been adjusted. Again, since a string is being passed to the system call, Perl generally has trouble figuring out whether a relative or absolute path to a command has been passed. Being in "paranoid" mode, Perl stops the command from executing.

The way around this problem is to clear the PATH environment variable so that Perl can trust that the command passed as a system call is an absolute path to a command instead of being part of the search path.
---

Also die Zeilen oberhalb deines Extracts im zweiten Posting. Sobald $ENV{PATH} auf
irgendetwas gesetzt wird, ist die Verwendung nicht tainted. Die Eineindeutigkeit muss
also nicht gegeben sein, nur, dass der Programmierer _genau_ definiert, wo seine
ausführbaren Programme sind (ansonsten ist PATH von der Umgebung entnommen, in der Perl
gestartet wurde und _das_ ist tainted).

$ENV{PATH} = '';   ist einfach _noch_ sicherer, da dann die Adressierung der Programme
nur auf absoluter Basis geschehen kann und somit auch die Eineindeutigkeit des Programmes
sichergestellt ist.

Viele Grüsse

Philipp

--
RTFM! - Foren steigern das Aufkommen von Redundanz im Internet, danke für das lesen der Manuals.
Selbstbedienung! - Das SelfForum ist ein Gratis-Restaurant mit Selbstbedienung, Menüangebot steht in den </faq/> und dem </archiv/>.