Shawn Walker wrote:
> I guess I was trying for the "ask for permission not for forgiveness"
> approach :)

AKA Look before you Leap - which is actually quite anti Python style as 
it happens.

>>> In other words, if you want to ensure that a user has the privileges
>>> equivalent to a "Software Installation Profile" how do you go about
>>> doing that?
>> Why do you want to do that at all ?  What is the real problem you think
>> needs solving here ?
> 
> I was trying to figure out a good way to determine if the user had the
> necessary privileges to install software up front, and if they didn't
> inform them of what they could do to get them.

But just because they didn't have the profile you looked for doesn't 
mean it will fail when you try it.

> Telling a user "You do not have the necessary privileges to perform
> software installation" isn't the same as "You do not have the Software
> Installation Profile enabled for your account or your user has
> insufficient privileges."

But having the "Software Installation Profile" isn't the only way the 
user could have the ability to do this.  It just happens to be the 
currently shipped RBAC profile which includes the necessary commands.

> I was looking for a confident way to ensure "up-front" that a user has
> the necessary privileges without relying on the (incorrect)
> sledgehammer approach of requiring root.

There isn't one and not even checking for uid=0 is correct.

-- 
Darren J Moffat
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to