HIP-708 fixing require-administrative-privileges

================================================================================

Host Power Tools / HIP-708
User cannot run volume list, ugly message appears

Type:              Bug                               Status:        Open                       Assignee: Arnon Yaari
Priority:          Minor                             Resolution:    Unresolved                 Reporter: Leon Kull
Affects Version/s:                                   Fix Version/s: 1.1.2
Components:                                                                                    Created: 2013-08-20 16:59
Labels:                                                                                        Updated: 2013-09-01 11:35

Issue Links:

Sub-Tasks:

Description:
User DTMLLUAdminUser (it's admin account) cannot use HIP and get this message :
Please change to something more user-friendly.

{noformat}
C:\Users\DTMLLUAdminUser.HCK2012-2>
PS C:\Users\DTMLLUAdminUser> infinihost volume list
can't open file 'C:\PROGRA~1\INFINI~1\HOSTPO~1\bin\INFINI~1-script.py' [Errno 2] No such file or directory
{noformat}

Later :

{noformat}
C:\Users\DTMLLUAdminUser.HCK2012-2>infinihost system list
Serial   System Name                 Host Name                   System Version
20000    ibox517                     hck2012-2                   1.3.0

C:\Users\DTMLLUAdminUser.HCK2012-2>infinihost connectivity list
Port Model     State     WWN                 Remote WWNs
QLE2562        online    21000024ff366231    5742b0f0004e2031
                                             5742b0f0004e2022
                                             5742b0f0004e2012
QLE2562        online    21000024ff366230    5742b0f0004e2031
                                             5742b0f0004e2022
                                             5742b0f0004e2012

C:\Users\DTMLLUAdminUser.HCK2012-2>infinihost volume list
Caught an unhandled exception
Log file is located at C:\Users\DTMLLU~1.HCK\AppData\Local\Temp\infinihost.2013-
08-26.16-43-1.debug.log
{noformat}

Comments:
Guy Rozendorn added a comment - 2013-08-20 17:08
non-admin users cannot run infinihost volume list, but thats not the problem in this case -- it doesn't find the python files.
where are you running this from?

Guy Rozendorn added a comment - 2013-08-20 19:16
messed up user

Leon Kull added a comment - 2013-08-27 11:24
This may reveal a bug.
Currently the command "infinihost" spawns a separate CMD window on hck2012-1
I want to Reopen this ticket.

Arnon Yaari added a comment - 2013-08-29 18:08
We need to remove the manifest code that requires elevated privileges, and make ensure_root work for real Admin only

Guy Rozendorn added a comment - 2013-08-29 18:09
[http://www.davidmoore.info/2011/06/20/how-to-check-if-the-current-user-is-an-administrator-even-if-uac-is-on/]
[http://blogs.msdn.com/b/cjacks/archive/2006/10/09/how-to-determine-if-a-user-is-a-member-of-the-administrators-group-with-uac-enabled-on-windows-vista.aspx]

Arnon Yaari added a comment - 2013-08-29 18:18
I'm not sure TokenElevationType is the correct class to check, I think it should be TokenIntegrityLevel - the integrity level of the process must be high:
http://msdn.microsoft.com/en-us/library/bb625966.aspx
and we must change IsUserAnAdmin to use the lower-level function because it is deprecated:
http://www.cplusplus.com/forum/windows/86818/