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

DBI refuses to allow me to provide my password as a blessed object with string overloading #41

Closed
demerphq opened this issue Dec 5, 2016 · 4 comments

Comments

@demerphq
Copy link
Contributor

demerphq commented Dec 5, 2016

This means that it is difficult to secure the password against things that dump the stack.

What I want to do is have my secrets like passwords stored in a blessed object which enforces a whitelist of modules which are allowed to inspect the contents.

Unfortunately this is impossible with the existing check to ensure that the password is not a reference.

IMO either the check should be changed to allow blessed references, OR, outright removed. I dont see why DBI should check for references, if it gets a ref then the connect will fail, and MAYBE then additional diagnostics that the password was a ref would be useful, but preventing me from using standard perl overloading to represent my password goes against basic perl expectations.

FWIW, this criticism applies generally and not just to the password argument. DBI should not be naively insisting that the arguments are pure strings. It should work fine if we pass in overloaded blessed objects.

FWIW2: I tried hard to use a tie for this, but tie assignment does not "pass along" the tiedness, it just passes along the value, so what i want to do is not possible that way.

I pushed a PR for this BTW: "remove block that prevents a reference $password argument #40"

@demerphq
Copy link
Contributor Author

I updated the PR for this ticket.

@timbunce
Copy link
Member

Closing this as PR #40 was merged in June. Thanks @demerphq!

@frioux
Copy link

frioux commented Sep 29, 2017

@timbunce I think you meant to close this but didn't?

@timbunce
Copy link
Member

Ah. Quite right. Thanks @frioux!

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

3 participants