Project

General

Profile

Bug #1408 ยป suid.c

simple suid program - Alexei Guliaev, 2011-08-24 01:49 PM

 
1
#include <string.h>
2
#include <stdio.h>
3

    
4
int main ()
5
{
6
	FILE * pFile;
7
	char str[12]="Test string";
8
	pFile = fopen ("rootfile" , "w");
9
	if (pFile== NULL) {
10
  		printf("Error in opening a file rootfile\n");
11
  	}
12
	else {
13
	fprintf (pFile , "%s \n", str);
14
	fclose (pFile);
15
	printf("String was succesfully writen to rootfile\n");
16
	}
17
	return 0;
18
}
19

    
    (1-1/1)