mariusz has asked for the wisdom of the Perl Monks concerning the following question:
I have a problem. I use program where i can create simple addons. Main program have a white list of function and for example i dont have permission to use "open" function
I will try something like this:
(...) my @users = (); open(FH,"/usr/bin/who|"); while(<FH>) { push @users,$1 if (/^(\w+)/); } close(FH); if ( grep ( /$luser\b/, @users) ) { _take_actions(); } (...)
But my code doesnt work. Of course i try use "system", "backticks", "exec" but without success.
How i can make "overloading" those function and execute "who" command? This white list is very simple. Main program looking only name of restricted commands. In white list i have only:
readline pack sleep time unpack sortSorry for my english skills.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Overload "open" function
by tobyink (Canon) on Jul 25, 2012 at 15:21 UTC |