Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

library hides relevant failure information #5

Open
lacostej opened this issue Jan 20, 2018 · 0 comments
Open

library hides relevant failure information #5

lacostej opened this issue Jan 20, 2018 · 0 comments

Comments

@lacostej
Copy link

We ran into a problem on Mac OSX Sierra where the library returned incoherent results: a structure with empty password:

2.3.3 :001 > module Security
2.3.3 :002?>     class InternetPassword < Password
2.3.3 :003?>     class << self
2.3.3 :004?>             def find(options)
2.3.3 :005?>                 output = `security 2>&1 find-internet-password -g #{flags_for_options(options)}`
2.3.3 :006?>                 puts "Status #{$?.exitstatus}"
2.3.3 :007?>                 puts "output #{output}"
2.3.3 :008?>                 password_from_output(output)
2.3.3 :009?>               end
2.3.3 :010?>       end
2.3.3 :011?>       end
2.3.3 :012?>   end
 => :find 
2.3.3 :013 > 
2.3.3 :014 >   puts Security::InternetPassword.find(server: '[email protected]').inspect
Status 36
output 
#<Security::InternetPassword:0x007f8c461d1dc8 @keychain=#<Security::Keychain:0x007f8c461d1d78 @filename=nil>, @attributes={}, @password=nil>
 => nil 
2.3.3 :015 > `security error 36`
 => "Error: 0x00000024 36 CSSM_ERRCODE_OBJECT_ACL_REQUIRED\n" 

The library should handle status codes to detect errors, not just output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant