SuperUser permission for the Driver??

James Cameron quozl at laptop.org
Wed Jun 25 07:46:13 EDT 2008


On Wed, Jun 25, 2008 at 11:31:00AM +0530, shivaprasad javali wrote:
> I am new to programming on Linux, I just searched for Setuid() and found that
> it sets the effective userid of my program to the userid I specify. So can I
> just call setuid() in my program when I need superuser privileges and have
> those privileges.

No, it is normally used the other way around.  Read the manual page
carefully, and test the effect yourself.

> To what part of my program are those privileges confined to?

Whatever you choose.  Once you are able to get past the initial hurdle,
of not getting EPERM from it, which you will get in the context of a
normal activity, ... setuid is used to restrict the privilege to the
areas of your program that should have it, keeping other areas of your
program from accidental use.

I do not think a normal activity should ever need it.  All such
privilege should be restricted to the base OS.  Can you not add what you
need to the OS build?

-- 
James Cameron    mailto:quozl at us.netrek.org     http://quozl.netrek.org/



More information about the Devel mailing list