Tue 22 Feb 2005 06:06:14 PM UTC, original submission:
Suppose we have Cyrus-mail-users named equally, let's say,'help' in different domains, each such a user having it's own password:
(Cyrus with Virtual Domains)
>select user_name ||'@'|| domain_name as full_name, password from users_table where user_name='help';
full_name | password
---------------------------+-----------
-unavailable- | god
-unavailable- | love
-unavailable- | secret
Next, we change the password through the Web-Cyradm for help@domainA.org, with new password ='123pw456'.
Checking:
>select user_name ||'@'|| domain_name as full_name, password from users_table where user_name='help';
full_name | password
---------------------------+-----------
-unavailable- | 123pw456
-unavailable- | 123pw456
-unavailable- | 123pw456
Looking through sources I found the SQL statement used to change the passwords:
somewhere around line 16 in change_password.php:
$query = "select * from virtual where alias='$alias'";
....
$alias = $row['alias'];
....
line 46 of change_password.php:
$query = "update user_table set password='$new_password' where user_name='$username'";
So here it is - selecting user to change his password is done only by per username. Perhaps changing the logic to something like this must solve the problem:
$query = "update user_table set password='$new_password' where (user_name ||'@'|| domain_name) ='$alias'";
I mean that selecting the users for changing passwords can be done using not only username, but also his domain_name.
I've created a patch to have such a logic and it seem to work fine.
It could be a config option.
Cheers
|