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

Adding current system user to auth file token name #24

Merged
merged 1 commit into from
May 4, 2016

Conversation

Karsonito
Copy link
Contributor

Hello Dominique. Thank You for library. Very useful for me. I have a proposal to fix one problem.
In some cases php processes use same zabbix user to auth, but execute under different system users (shell, apache). So they will use the same auth file, but only the first will gain access. And the second process with different user will never use cached token. So token file should be unique for different system users.
Please aprove my change.
If I'm not mistaken it needs to rebuild new versions? What is sequence of actions to rebuild it for both 2.2 and 2.4 branches? Who should do it?

In some cases php processes use same zabbix user to auth, but execute under different system users (shell, apache). So they will use the same auth file, but only the first will gain access. And the second process with different user will never use cached token. So token file should be unique for different system users.
@Karsonito
Copy link
Contributor Author

One more improvement - add separator between zabbix user and system for univocacy:
$tokenCacheFile = $tokenCacheDir.'/.zabbixapi-token-'.md5($params['user'].'|'.posix_getuid());

@tgouverneur
Copy link

Faced that issue too, I was about to submit a pull request when saw this one, this definitely needs to be merged in ;-)

@domibarton
Copy link
Member

Sorry for the delay :(
Thanks @Karsonito for your PR, awesome work!

@domibarton domibarton merged commit 5329ead into confirm:master May 4, 2016
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

Successfully merging this pull request may close these issues.

3 participants