I need to create an Apache authorization handler that could change incoming user's parameters to something like
"old_parameters&user=$login" because Apache's Basic Authorization's data is not passed to CGI application.
When the request is "GET", task is really easy:
$r->args(new_query_string($r->args()));
But when it comes to "POST" things get worse as the data is held in STDIN:
to get that data I just use
@stdin=<STDIN>;$stdin="@stdin";
so after changing
$stdin I need to get it back to standard input, so that CGI could get it.
I do have tried to close STDIN and open the new one, but that new one was different as CGI was seeing not it but the original one already emptied by me.
syswrite gives "Permission denied".
After using
fdopen(fileno(STDIN),'w') and trying to print something to STDIN nothing changes in this stream.
open LL,'>&STDIN' same as prevoius.
I've taken a look at "Bidirectional Communication with Yourself" from Perl Cook Book but when a child prints something to a pipe parent's STDIN stays empty.
I'm begging for help or even a tiny hint on how to make this work. I do believe in TIMTOWTDI, so any other ways are welcome.
P.S. All that would have been easier if only I could change the CGI application, but I can't.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.