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

Report unique usernames for isc_info_user_names #8353

Closed
mrotteveel opened this issue Dec 17, 2024 · 2 comments · Fixed by #8355
Closed

Report unique usernames for isc_info_user_names #8353

mrotteveel opened this issue Dec 17, 2024 · 2 comments · Fixed by #8355

Comments

@mrotteveel
Copy link
Member

For administrators, isc_info_user_names reports the usernames of each connection. If multiple connections have the same username, then that name is repeated. Instead, it should report the unique usernames; this will reduce the amount of information transferred, reducing the chance of truncation.

Making this change should not break the API, as it makes no promises beyond reporting the usernames, though it might be good to ensure the username of the current connection remains the first as it is currently.

Specifically, to quote from the InterBase 6.0 API Guide:

Names of all the users currently attached to the database; for each such user, the result buffer contains an isc_info_user_names byte followed by a 1-byte length specifying the number of bytes in the user name, followed by the user name

@livius2
Copy link

livius2 commented Dec 19, 2024

If it currently reports the same username multiple times, I suppose it is the wrong way to create backward incompatibilities in isc_info_user_names provide new isc_info_user_unique_names

@mrotteveel
Copy link
Member Author

mrotteveel commented Dec 20, 2024

If it currently reports the same username multiple times, I suppose it is the wrong way to create backward incompatibilities in isc_info_user_names provide new isc_info_user_unique_names

No, it complies with the documented behaviour, which says it reports the names of the users; it doesn't say anything about uniqueness or not. In fact, I would argue that, based on the documentation, repeating usernames was a bug, as it explicitly says it returns the name for each user that is connected, not for each connection; that is if a user has multiple connections, that is still one user.

Also, for non-admin users it only reports the user of the current connection, and the same goes for ClassicServer connections as it reports about connections to the same database in the current user process, and in ClassicServer, there is only one connection per process, the current connection. So, there basically is no reliable way to use the multiplicity of users, so I can't see how anything would break from changing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment