[ale] C question

Jim Lynch ale_nospam at fayettedigital.com
Fri May 23 05:44:26 EDT 2014


Let me try that again.
On 05/23/2014 05:43 AM, Jim Lynch wrote:
> Untested, but should work.
> On 05/22/2014 10:56 PM, Robert L. Harris wrote:
>>
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <sys/types.h>
>> #include <unistd.h>
>>
>>
>> int main(int argc, char **argv)
>> {
>>
>>   char Target[5] = argv[1];
>>   printf("%s\n", argv[1]);
>>   printf("%s\n", Target);
>>
>>   setuid( 662705787 );
>>   char Command[255]="/home/user/bin/Test.sh %s", Target;
> char cmd[255];

^^^^^^^^^^^ forgot to dimension it.
> sprintf(cmd,"ssh user at serverB -C /home/user/bin/Test.sh %s", Target);
> system(cmd);
>>
>>   system( "ssh user at serverB -C %s", Command );
>>
>>   return 0;
>> }
>>
>



More information about the Ale mailing list