[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 用户家目录的访问权限问题



Qingning Huo <qingningh@lanware.co.uk> writes:

> [Sorry for the English reply]

Not at all. :-) 

> The key question is whether the program is meant to be run by non-root
> users.  If the program should only be run by root, you do not have to
> do anything special.  If the program is designed to be used by non-root
> users, you have some choices: (a) make the program setuid to root, you
> should be very careful to manage the privilege of the program, which is
> not an easy task; or (b) you can write a small setuid-root program to
> bind the socket, and then drop priviledges and invoke the main program
> as a non-root user.

> For development, you can test/debug your program with a non-privileged
> port number.

I got it. setuid is a both dangerous and nice thing..

That helps a lot. Thanks ! 

-- 
William

((email . "william.xwl@gmail.com")
 (blog  . "http://matchsticker.mysmth.net";))



Reply to: