I am in the midst of trying to convert one of my system admin scripts to a web based format. This script does a very good job of resetting many user's passwords at once.
The problem that I am having is that (obviously) when the script is run from the command line it uses the rights of the person running it, but when running via CGI it uses whatever user account IIS is running on (right? I think that's right). Obviously, the IIS account does not have rights to reset passwords. So what I need to do is run the CGI script as one of our accounts which does have the rights.
Now, this server is protected at many other levels, and the only people that have access to it are people that could do this manually anyways. I do not admin the server, but I know that one of the environment variables on the machine is the password of the account that I need to run this script as ( something like $ENV{USERPASS} ).
I have messed around a bit attempting to use "su" to run the CGI script as the proper user, the problem is that I am not getting a proper response from "su" - I think this is because it launches itself in a new command prompt. In otherwords using something like
my $response=`su account command DOMAIN < filewithpassword` is simply not giving me a response. Completely blank.
Am I barking up the wrong tree here? Is there a simpler way to do this? Any suggestions?
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.