Bug #2117

k5login type fails if file not already present

Added by John Ireland almost 3 years ago. Updated almost 2 years ago.

Status:Rejected Start date:03/27/2009
Priority:Normal Due date:
Assignee:Luke Kanies % Done:

0%

Category:unknown
Target version:0.25.0
Affected Puppet version:0.24.4 Branch:
Keywords:
Votes: 0

Description

The k5login type is documented as supporting ‘ensurable’ but actually fails if the file doesn’t already exist, regardless of this setting. This appears to be due to an uncaught error condition when checking the file mode. The affected file is k5login.rb and the following patch appears to fix this issue:

—– k5login.rb.orig 2009-03-27 22:45:55.000000000 +0000 +++ k5login.rb 2009-03-27 22:45:39.000000000 +0000 @@ -72,5 +72,9 @@

     # Return the mode as an octal string, not as an integer
     def mode
  •      "%o" % (File.stat(@resource[:name]).mode & 007777)
    
  •      if File.exists?(@resource[:name])
    
  •          "%o" % (File.stat(@resource[:name]).mode & 007777)
    
  •      else
    
  •          "0000"
    
  •      end
     end
    

I am running version 0.24.4 as supplied in the Debian Lenny distribution.

History

Updated by Digant Kasundra almost 3 years ago

I can confirm that this is indeed a bug and I think the patch is sufficient.

Updated by James Turnbull almost 3 years ago

  • Category set to unknown
  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Luke Kanies
  • Target version set to 4

Updated by Luke Kanies almost 3 years ago

  • Status changed from Needs Decision to Accepted
  • Target version changed from 4 to 0.25.0

Updated by Luke Kanies almost 3 years ago

  • Status changed from Accepted to Needs More Information

I can’t reproduce this:

luke@phage $ ls -l /tmp/k5test
gls: cannot access /tmp/k5test: No such file or directory
luke@phage $ head -3 ~/bin/test.pp
#!/usr/bin/env puppet --verbose

k5login { "/tmp/k5test":  principals => [foo, bar], ensure => present, mode => 644 }
luke@phage $ test.pp
info: Loading facts in test
notice: //K5login[/tmp/k5test]/ensure: created
luke@phage $

Can I get a stack trace and a specific means of reproducing?

Updated by Luke Kanies almost 3 years ago

  • Status changed from Needs More Information to Rejected

Works for me, and no response from the original filer.

Also available in: Atom PDF