Hello
salut,
i am under linux/android and i want to configure network card without
passing to root
when i tape this commande:
<<ifconfig eth0 up>>
i foud this result:
SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCSIFNTMASK: Permission denied
and as you know that under android, sudo is not found in th ephone
samsung spica
i found the source code of the commande su.c and i modify it like:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
int main(int argc, char **argv)
{
int ii=0, i=0;
char **exec_args;
exec_args = (char **)malloc((argc + 1)*sizeof(char *));
for (ii=0;ii<argc;ii++)
{printf(" argv[ %d ]= %s \n",ii,argv[ii]);}
exec_args[argc] = NULL;
exec_args[0] = "sh";
if(argc < 2) {
printf("argc < 2 \n");
}
if(setgid(0) ||setuid(0)){// root.root
fprintf(stderr,"su: permission denied ; setgid(0): %d setuid(0): %d
dont gid: %d et uid: %d \n",setgid(0),setuid(0),0,0);
return 1;
}
printf("commancer l'execv \n");
for (i = 1; i < argc; i++)
{
exec_args[i] = argv[i];
}
execv("/system/bin/sh", exec_args);
printf("commancer l'execlp \n");
execlp("/system/bin/sh", "sh", NULL);
fprintf(stderr, "su: exec failed\n");
return 1;
}
and i compiled it and i copied it under /data/data...
and i changed its privilege with chmod 755 /data/data/..../su
and when i execute
<< /data/data/../su -c /system/bin/ifconfig eth0 up >>
my executable su stop in execv("/system/bin/sh", exec_args);
wath's the probleme???? i dont understand why .??
thnks in advance
--
You received this message because you are subscribed to the Google Groups
"Android Security Discussions" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/android-security-discuss?hl=en.