ruby error when running vim-addon-manager in a non-login shell

Bug #1513446 reported by Geoff Williams
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vim-addon-manager (Ubuntu)
New
Undecided
Unassigned

Bug Description

Overview
=======
When running /usr/bin/vim-addon-manager in a non-login shell, users receive a ruby error and are unable to use the program

Expected Result
=============
vim-addon-manager should be able to run normally within a non-login shell and perform requested alterations

Actual Result
===========
Users receive the following error message from ruby:
/usr/bin/vim-addon-manager:202:in `getpwnam': no implicit conversion of nil into String (TypeError)
 from /usr/bin/vim-addon-manager:202:in `parse_cmdline'
 from /usr/bin/vim-addon-manager:252:in `<main>'

Steps to reproduce
===============
I was able to reproduce the error with the following ruby script:

test.rb:
#!/usr/bin/env ruby
require "open3"
Open3.popen3("/usr/bin/vim-addon-manager install puppet") do | stdin, stdout, stderr, wait_thr|
    puts "stdout: " + stdout.read
    puts "sderr: " + stderr.read
end

When I executed it with:
env -i ruby test.rb

Why this is a problem
=================
I would like to be able to be able to run the vim-addon-manager command from within puppet using an exec resource, so the vim-addon-manager command must be able to run in a clean environment without a login shell. The same conditions probably apply if you wanted to run the script from other systems such as chef, cron, etc.

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: vim-addon-manager 0.5.4
ProcVersionSignature: Ubuntu 4.2.0-16.19-generic 4.2.3
Uname: Linux 4.2.0-16-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.19.1-0ubuntu4
Architecture: amd64
CurrentDesktop: XFCE
Date: Thu Nov 5 22:13:38 2015
EcryptfsInUse: Yes
InstallationDate: Installed on 2014-09-23 (407 days ago)
InstallationMedia: Xubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2)
PackageArchitecture: all
SourcePackage: vim-addon-manager
UpgradeStatus: Upgraded to wily on 2015-10-24 (12 days ago)

Revision history for this message
Geoff Williams (geoff-geoffwilliams) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Fix above issue by switching to getpwuid as recommended at https://github.com/applicationsonline/librarian/pull/174" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.