You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@vcl.apache.org by Andrew Brown <br...@gmail.com> on 2009/03/04 20:32:25 UTC

Re: utils.pm::check_connection()

>
> Problem 2)  When a reservation is made, VCL gives us a username, password,
>> and an IP to log in with.  We logon to the web portal with the 'admin'
>> username, but when VCL goes to determine if the user has logged in yet, it
>> checks for the user "administrator". Why are they different? How do we get
>> it to use the same username that was given to the user?
>>
>
> This is due to the bug I noted earlier.  If you make a Windows imaging
> reservation, the username is always Administrator.  If you make a Linux
> imaging reservation, the username is always the normal reservation login
> name (user.unityid).
>

We've made your suggested change, and verified that it works. Below is the
exact change we made.  Brian has just created issue VCL-101 for this, and
unless there are any objections, we'll commit this patch.

This still doesn't address the issue with netstat and the invalid regex, but
at least logged in users are detected now with the who command when imaging.
-Andrew

Index: reserved.pm
===================================================================
--- reserved.pm (revision 750099)
+++ reserved.pm (working copy)
@@ -417,12 +417,12 @@
                notify($ERRORS{'OK'}, 0, "checkuser flag is set to 1,
checking user connection");
                # Check for the normal user ID if this isn't an imaging
request
                # Check for "administrator" if this is an imaging request
-               if ($request_forimaging) {
-                       notify($ERRORS{'OK'}, 0, "forimaging flag is set to
1, checking for connection by administrator");
+               if ($request_forimaging && $image_os_name =~
/win|vmwarewin/) {
+                       notify($ERRORS{'OK'}, 0, "forimaging flag is set to
1 and imageosname is $image_os_name, checking for connection by
administrator");
                        $retval_conn = check_connection($nodename,
$computer_ip_address, $computer_type, $remote_ip, $time_limit,
$image_os_name, 0, $request_id, "administrator",$image_os_type);
                }
                else {
-                       notify($ERRORS{'OK'}, 0, "forimaging flag is set to
0, checking for connection by $user_unityid");
+                       notify($ERRORS{'OK'}, 0, "forimaging flag is set to
$request_forimaging and imageosname is $image_os_name, checking for
connection by $user_unityid");
                        $retval_conn = check_connection($nodename,
$computer_ip_address, $computer_type, $remote_ip, $time_limit,
$image_os_name, 0, $request_id, $user_unityid,$image_os_type);
                }
        } ## end else [ if (!$imagemeta_checkuser)

Re: utils.pm::check_connection()

Posted by Andy Kurth <an...@ncsu.edu>.
Looks OK to me.  I also just realized reserved.pm isn't using the DataStructure 
object, but the old $request_data->{} hash.  I'll work on this in the near future.

-Andy

Andrew Brown wrote:
> We've made your suggested change, and verified that it works. Below is the
> exact change we made.  Brian has just created issue VCL-101 for this, and
> unless there are any objections, we'll commit this patch.
> 
> This still doesn't address the issue with netstat and the invalid regex, but
> at least logged in users are detected now with the who command when imaging.
> -Andrew
> 
> Index: reserved.pm
> ===================================================================
> --- reserved.pm (revision 750099)
> +++ reserved.pm (working copy)
> @@ -417,12 +417,12 @@
>                 notify($ERRORS{'OK'}, 0, "checkuser flag is set to 1,
> checking user connection");
>                 # Check for the normal user ID if this isn't an imaging
> request
>                 # Check for "administrator" if this is an imaging request
> -               if ($request_forimaging) {
> -                       notify($ERRORS{'OK'}, 0, "forimaging flag is set to
> 1, checking for connection by administrator");
> +               if ($request_forimaging && $image_os_name =~
> /win|vmwarewin/) {
> +                       notify($ERRORS{'OK'}, 0, "forimaging flag is set to
> 1 and imageosname is $image_os_name, checking for connection by
> administrator");
>                         $retval_conn = check_connection($nodename,
> $computer_ip_address, $computer_type, $remote_ip, $time_limit,
> $image_os_name, 0, $request_id, "administrator",$image_os_type);
>                 }
>                 else {
> -                       notify($ERRORS{'OK'}, 0, "forimaging flag is set to
> 0, checking for connection by $user_unityid");
> +                       notify($ERRORS{'OK'}, 0, "forimaging flag is set to
> $request_forimaging and imageosname is $image_os_name, checking for
> connection by $user_unityid");
>                         $retval_conn = check_connection($nodename,
> $computer_ip_address, $computer_type, $remote_ip, $time_limit,
> $image_os_name, 0, $request_id, $user_unityid,$image_os_type);
>                 }
>         } ## end else [ if (!$imagemeta_checkuser)
> 

-- 
Andy Kurth
Virtual Computing Lab
Office of Information Technology
North Carolina State University
andy_kurth@ncsu.edu
919.513.4090