arundeep singh wrote:
> i want to do it something like X Server of linux in
> user space access the harware system without having
> root permissions. there is something like setuid bit
> kind of thing. but even after reading some books i
> can't figure out how to use it in my case. if u could
> take time check a extremely small code written bye me
> then i can send that too.
If all you want is a unpriviged user to run a program with
root permissions.(Warning: Security implications)
Then change ownership to root and set the setuid bit of the program
on root shell as
#chown root.root <yourprogram>
#chmod 4755 <yourprogram>
And your program should start with setting owner's ID while running the
program to initially start the userland functions.
/*hello.c */
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
void main(){
setreuid(-1,getuid());
printf("Hello");
sleep(5000);
}
man setreuid
You can use setreuid to interchange between the Effective UID and Real UID.
Hope I didn't get it wrong, my Unix C programming is gotten rusty now.
-Tarun
_______________________________________________
ilugd mailinglist -- [EMAIL PROTECTED]
http://frodo.hserus.net/mailman/listinfo/ilugd
Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi
http://www.mail-archive.com/[EMAIL PROTECTED]/