Re: Serious newb here with external exe questions...
- From: Mark Janssen <mpc.janssen@xxxxxxxxx>
- Date: Tue, 17 Mar 2009 06:02:53 -0700 (PDT)
On Mar 17, 1:52 pm, Mark Janssen <mpc.jans...@xxxxxxxxx> wrote:
On Mar 17, 11:39 am, Ralf Fassel <ralf...@xxxxxx> wrote:
* rfw...@xxxxxxxxx
| exec $rmtshare \\\\jack\\$newValue$=c:\\test\\profiles\\$newValue$ /GRANT everyone:full
Assuming that your newsreader inserted line breaks where there are none
in the code, the above statement gives the following on my windows:
% exec test_argc rmtshare \\\\jack\\$newValue$=c:\\test\\profiles\\$newValue$ /GRANT everyone:full
4
1/4 {rmtshare}
2/4 {\\jack\tdurden$=c:\test\profiles\tdurden$}
3/4 {/GRANT}
4/4 {everyone:full}
I'm calling test_argc which is a program to simply print the individual
arguments passed to it (see attached code). Seems ok to me. So the
next step at your side would either also use such a program to see what
is actually arriving at the exec'd side, or use TWAPI as someone else
suggested (if this is an option).
R'
/* test_argc.c -- print number of arguments excluding program name to stdout */
#include <stdio.h>
#include <string.h>
int
main(int argc, char *argv[]) {
printf("%d\n", argc-1);
for (int i =1; i < argc; i++) {
printf("%d/%d {%s}\n", i, argc-1, argv[i]);
}
printf("\n");
return argc-1;}
/* End of file */
Note that this debugging application gives rise to an additional layer
of command line parsing by the C library and it's not necessarily the
case that the ACL command line applications even use an argv array.
The windows CreateProcess API call takes the whole commandline as a
single string (and this should be reflected in [exec] behaviour on
windows IMO) To know exactly what was passed to createprocess, use
WinMain or add some debugging code to the call in the [exec]
implementation.
Regards,
Mark
Note that in this case this doesn't differ. The command line sent to
CreateProcess is:
rmtshare \\jack\tdurden$=c:\test\profiles\tdurden$ /GRANT
everyone:full
As returned by:
#include <windows.h>
int WinMain (
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow ) {
MessageBox (NULL, lpCmdLine,"Arguments",MB_OK);
return 0;
}
.
- Follow-Ups:
- Re: Serious newb here with external exe questions...
- From: rfwolf
- Re: Serious newb here with external exe questions...
- References:
- Serious newb here with external exe questions...
- From: rfwolf
- Re: Serious newb here with external exe questions...
- From: rfwolf
- Re: Serious newb here with external exe questions...
- From: Bryan Oakley
- Re: Serious newb here with external exe questions...
- From: rfwolf
- Re: Serious newb here with external exe questions...
- From: Andreas Leitgeb
- Re: Serious newb here with external exe questions...
- From: rfwolf
- Re: Serious newb here with external exe questions...
- From: Ralf Fassel
- Re: Serious newb here with external exe questions...
- From: Glenn Jackman
- Re: Serious newb here with external exe questions...
- From: rfwolf
- Re: Serious newb here with external exe questions...
- From: Ralf Fassel
- Re: Serious newb here with external exe questions...
- From: rfwolf
- Re: Serious newb here with external exe questions...
- From: Ralf Fassel
- Re: Serious newb here with external exe questions...
- From: rfwolf
- Re: Serious newb here with external exe questions...
- From: Ralf Fassel
- Re: Serious newb here with external exe questions...
- From: Mark Janssen
- Serious newb here with external exe questions...
- Prev by Date: Re: Serious newb here with external exe questions...
- Next by Date: Re: Serious newb here with external exe questions...
- Previous by thread: Re: Serious newb here with external exe questions...
- Next by thread: Re: Serious newb here with external exe questions...
- Index(es):
Relevant Pages
|