You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@vcl.apache.org by Toks Adeshiyan <to...@linux.vnet.ibm.com> on 2009/08/04 21:52:09 UTC

small bug in _is_user_added()

I ran into a small bug last week where VCL reports that the admin user 
account has been added to a provisioned resource even though the user 
add command had actually failed.  This is based on the following 
/etc/passwd contents:

2009-07-27 
19:07:58|5762|2:2|reserved|utils.pm:run_ssh_command(6727)|executing SSH 
command on vcl-vm1: cat /etc/passwd
2009-07-27 19:07:58|5762|2:2|reserved|vcld:REAPER(770)|setting $? to 0, 
exit status: 0
2009-07-27 
19:07:58|5762|2:2|reserved|utils.pm:run_ssh_command(6808)|run_ssh_command 
output: root:x:0:0:root:/root:/bin/bash
|5762|2:2|reserved| bin:x:1:1:bin:/bin:/bin/bash
|5762|2:2|reserved| daemon:x:2:2:Daemon:/sbin:/bin/bash
|5762|2:2|reserved| lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash
|5762|2:2|reserved| mail:x:8:12:Mailer 
daemon:/var/spool/clientmqueue:/bin/false
|5762|2:2|reserved| games:x:12:100:Games account:/var/games:/bin/bash
|5762|2:2|reserved| wwwrun:x:30:8:WWW daemon 
apache:/var/lib/wwwrun:/bin/false
|5762|2:2|reserved| ftp:x:40:49:FTP account:/srv/ftp:/bin/bash
|5762|2:2|reserved| nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash
|5762|2:2|reserved| postfix:x:51:51:Postfix 
Daemon:/var/spool/postfix:/bin/false
|5762|2:2|reserved| ntp:x:74:101:NTP daemon:/var/lib/ntp:/bin/false
|5762|2:2|reserved| uuidd:x:100:102:User for uuidd:/var/run/uuidd:/bin/false
|5762|2:2|reserved| messagebus:x:101:103:User for 
D-Bus:/var/run/dbus:/bin/false
|5762|2:2|reserved| 
polkituser:x:102:104:PolicyKit:/var/run/PolicyKit:/bin/false
|5762|2:2|reserved| haldaemon:x:103:105:User for 
haldaemon:/var/run/hald:/bin/false
|5762|2:2|reserved| sshd:x:71:65:SSH daemon:/var/lib/sshd:/bin/false
|5762|2:2|reserved| suse-ncc:x:104:106:Novell Customer Center 
User:/var/lib/YaST2/suse-ncc-fakehome:/bin/bash
|5762|2:2|reserved| at:x:25:25:Batch jobs daemon:/var/spool/atjobs:/bin/bash
|5762|2:2|reserved| man:x:13:62:Manual pages viewer:/var/cache/man:/bin/bash
|5762|2:2|reserved| news:x:9:13:News system:/etc/news:/bin/bash
|5762|2:2|reserved| uucp:x:10:14:Unix-to-Unix CoPy 
system:/etc/uucp:/bin/bash
|5762|2:2|reserved| mysql:x:60:107:MySQL database 
admin:/var/lib/mysql:/bin/false
2009-07-27 19:07:58|5762|2:2|reserved|utils.pm:run_ssh_command(6811)|SSH 
command executed on vcl-vm1: cat /etc/passwd, returning (0, output)
2009-07-27 19:07:58|5762|2:2|reserved|utils.pm:add_user(3098)|added user 
account admin to vcl-vm1

VCL thinks that the user has been added because of the last line in the 
file (mysql user account) which matches the regexp in the _is_user_added 
subroutine in utils.pm.  Later, when VCL attempts to change the password 
of the non-existent admin user, it fails.  The regexp could be modified 
to look for the string "$user" at the beginning of each line instead.

Toks

Re: small bug in _is_user_added()

Posted by Aaron Peeler <aa...@ncsu.edu>.
ok thanks -

Added Jira issue VCL-197

We'll get this fix in soon.

Aaron

--On August 4, 2009 3:52:09 PM -0400 Toks Adeshiyan 
<to...@linux.vnet.ibm.com> wrote:

> I ran into a small bug last week where VCL reports that the admin user
> account has been added to a provisioned resource even though the user add
> command had actually failed.  This is based on the following /etc/passwd
> contents:
>
> 2009-07-27
> 19:07:58|5762|2:2|reserved|utils.pm:run_ssh_command(6727)|executing SSH
> command on vcl-vm1: cat /etc/passwd
> 2009-07-27 19:07:58|5762|2:2|reserved|vcld:REAPER(770)|setting $? to 0,
> exit status: 0
> 2009-07-27
> 19:07:58|5762|2:2|reserved|utils.pm:run_ssh_command(6808)|run_ssh_command
> output: root:x:0:0:root:/root:/bin/bash
>| 5762|2:2|reserved| bin:x:1:1:bin:/bin:/bin/bash
>| 5762|2:2|reserved| daemon:x:2:2:Daemon:/sbin:/bin/bash
>| 5762|2:2|reserved| lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash
>| 5762|2:2|reserved| mail:x:8:12:Mailer
>| daemon:/var/spool/clientmqueue:/bin/false 5762|2:2|reserved|
>| games:x:12:100:Games account:/var/games:/bin/bash 5762|2:2|reserved|
>| wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false
>| 5762|2:2|reserved| ftp:x:40:49:FTP account:/srv/ftp:/bin/bash
>| 5762|2:2|reserved| nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash
>| 5762|2:2|reserved| postfix:x:51:51:Postfix
>| Daemon:/var/spool/postfix:/bin/false 5762|2:2|reserved| ntp:x:74:101:NTP
>| daemon:/var/lib/ntp:/bin/false 5762|2:2|reserved| uuidd:x:100:102:User
>| for uuidd:/var/run/uuidd:/bin/false 5762|2:2|reserved|
>| messagebus:x:101:103:User for D-Bus:/var/run/dbus:/bin/false
>| 5762|2:2|reserved|
>| polkituser:x:102:104:PolicyKit:/var/run/PolicyKit:/bin/false
>| 5762|2:2|reserved| haldaemon:x:103:105:User for
>| haldaemon:/var/run/hald:/bin/false 5762|2:2|reserved| sshd:x:71:65:SSH
>| daemon:/var/lib/sshd:/bin/false 5762|2:2|reserved|
>| suse-ncc:x:104:106:Novell Customer Center
>| User:/var/lib/YaST2/suse-ncc-fakehome:/bin/bash 5762|2:2|reserved|
>| at:x:25:25:Batch jobs daemon:/var/spool/atjobs:/bin/bash
>| 5762|2:2|reserved| man:x:13:62:Manual pages
>| viewer:/var/cache/man:/bin/bash 5762|2:2|reserved| news:x:9:13:News
>| system:/etc/news:/bin/bash
>| 5762|2:2|reserved| uucp:x:10:14:Unix-to-Unix CoPy
>| system:/etc/uucp:/bin/bash 5762|2:2|reserved| mysql:x:60:107:MySQL
>| database admin:/var/lib/mysql:/bin/false
> 2009-07-27 19:07:58|5762|2:2|reserved|utils.pm:run_ssh_command(6811)|SSH
> command executed on vcl-vm1: cat /etc/passwd, returning (0, output)
> 2009-07-27 19:07:58|5762|2:2|reserved|utils.pm:add_user(3098)|added user
> account admin to vcl-vm1
>
> VCL thinks that the user has been added because of the last line in the
> file (mysql user account) which matches the regexp in the _is_user_added
> subroutine in utils.pm.  Later, when VCL attempts to change the password
> of the non-existent admin user, it fails.  The regexp could be modified
> to look for the string "$user" at the beginning of each line instead.
>
> Toks



Aaron Peeler
OIT Advanced Computing
College of Engineering-NCSU
919.513.4571
http://vcl.ncsu.edu