Click here to Skip to main content
15,887,683 members
Home / Discussions / C#
   

C#

 
GeneralAm I welcome! Pin
MorganSim6-Sep-08 12:55
MorganSim6-Sep-08 12:55 
GeneralRe: Am I welcome! Pin
Blue_Boy6-Sep-08 13:02
Blue_Boy6-Sep-08 13:02 
General[Message Deleted] Pin
MorganSim6-Sep-08 13:21
MorganSim6-Sep-08 13:21 
GeneralRe: Am I welcome! Pin
Blue_Boy6-Sep-08 13:41
Blue_Boy6-Sep-08 13:41 
GeneralRe: Am I welcome! Pin
MorganSim6-Sep-08 22:41
MorganSim6-Sep-08 22:41 
GeneralRe: Am I welcome! Pin
Blue_Boy6-Sep-08 22:46
Blue_Boy6-Sep-08 22:46 
QuestionRe: Multiple forms Pin
MorganSim6-Sep-08 23:25
MorganSim6-Sep-08 23:25 
QuestionRPC and permissions on new process Pin
erikkl20006-Sep-08 6:20
erikkl20006-Sep-08 6:20 
I have a client that make a RPC to a server, "singlecall", and after the proxy is created that client makes one call back to the object that is on the server.

When called the server object creates a new process and starts cmd.exe. It then makes a query to the local DNS server to check for availability for a node record in a zone. Basically I need to know if a node exists inside a zone.

In development this works great, and after working with this for over a week I am almost sure that I know the deal now. This has to be a security issue. I believe that the new process that is created on the server be the server object is running in to low of privileges to make a call to the DNS server.

I know the RPC is a success because I write line to the console window every time a request is made from the client. The second request from with-in the server object to the new process is the one that is not a success.

How do I set permissions from a situation like this?

Below is my server object. "The one that needs the permissions set"


---------------------------The instantiation is successful
public AFCCDnsManager()
{
Console.WriteLine("Request from client just came in");

}


------------This is the method that needs help. "Works great in development"

public bool CheckIfDomainZoneNodeHasRecords(string server, string zone, string node)
{
Process myProcess = null;
ProcessStartInfo myProcessStartInfo = null;
StreamReader myStreamReader = null;
string cmdFailed = string.Empty;
string dnsCmd = string.Empty;
string output = string.Empty;
try
{
cmdFailed = "DNS Server failed";
//string cmdCompleted = "command completed successfully";
//Command failed: DNS_ERROR_NAME_DOES_NOT_EXIST 9714
//cmd server cmd zone node
//dnscmd afcc-inc-ns1 /enumrecords AFCCINC.COM handlers
dnsCmd = string.Format("dnscmd {0} /enumrecords {1} {2}", server, zone, node);
output = string.Empty;

myProcess = new Process();
myProcessStartInfo =
new ProcessStartInfo("cmd.exe");
myProcessStartInfo.UseShellExecute = false;
myProcessStartInfo.CreateNoWindow = true;
myProcessStartInfo.RedirectStandardOutput = true;
myProcessStartInfo.RedirectStandardInput = true;
myProcessStartInfo.Arguments = dnsCmd;
myProcess.StartInfo = myProcessStartInfo;
myProcess.Start();

myStreamReader = myProcess.StandardOutput;

myProcess.StandardInput.WriteLine(dnsCmd);
char[] blockOfChars = new char[356];


myStreamReader.ReadBlock(blockOfChars, 0, 355);
myStreamReader.Close();
myProcess.Close();

output = new string(blockOfChars);

if (output.ToLower().Contains(cmdFailed.ToLower()))
{
return false;//0
}
else return true;

}
catch (Exception ex)
{
throw new ApplicationException(ex.Message);
}
finally
{
myProcess = null;
myProcessStartInfo = null;
//myStreamReader = null;
cmdFailed = string.Empty;
dnsCmd = string.Empty;
output = string.Empty;
}
}

Thank you for your help

Erik
AnswerRe: RPC and permissions on new process Pin
Manas Bhardwaj9-Sep-08 5:33
professionalManas Bhardwaj9-Sep-08 5:33 
GeneralRe: RPC and permissions on new process [modified] Pin
erikkl20009-Sep-08 5:43
erikkl20009-Sep-08 5:43 
QuestionFilling a textbox in form 1 by clicking a button in form 2 Pin
punkymt16-Sep-08 1:55
punkymt16-Sep-08 1:55 
AnswerRe: Filling a textbox in form 1 by clicking a button in form 2 Pin
#realJSOP6-Sep-08 2:03
mve#realJSOP6-Sep-08 2:03 
GeneralRe: Filling a textbox in form 1 by clicking a button in form 2 Pin
punkymt16-Sep-08 3:40
punkymt16-Sep-08 3:40 
QuestionHow Pin
Silvyster6-Sep-08 1:36
Silvyster6-Sep-08 1:36 
AnswerRe: How Pin
#realJSOP6-Sep-08 1:57
mve#realJSOP6-Sep-08 1:57 
AnswerRe: How Pin
Ed.Poore6-Sep-08 8:09
Ed.Poore6-Sep-08 8:09 
AnswerRe: How Pin
Mbah Dhaim6-Sep-08 8:16
Mbah Dhaim6-Sep-08 8:16 
GeneralRe: How Pin
#realJSOP6-Sep-08 9:10
mve#realJSOP6-Sep-08 9:10 
GeneralRe: How Pin
Mbah Dhaim6-Sep-08 9:28
Mbah Dhaim6-Sep-08 9:28 
GeneralRe: How Pin
#realJSOP6-Sep-08 10:36
mve#realJSOP6-Sep-08 10:36 
RantRe: How Pin
Mbah Dhaim6-Sep-08 11:25
Mbah Dhaim6-Sep-08 11:25 
GeneralRe: How Pin
Guffa6-Sep-08 12:43
Guffa6-Sep-08 12:43 
GeneralRe: How Pin
Blue_Boy6-Sep-08 13:07
Blue_Boy6-Sep-08 13:07 
GeneralRe: How Pin
#realJSOP7-Sep-08 2:01
mve#realJSOP7-Sep-08 2:01 
QuestionHow to convert one byte to string? Pin
nhatvhm6-Sep-08 0:44
nhatvhm6-Sep-08 0:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.