Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This commit in my git HEAD clone on GitHub should fix that: http://github.com/omega8cc/hostmaster/commit/983a0ee8aeca7e079453a88543d...
Comments
Comment #1
omega8cc CreditAttribution: omega8cc commentedTo create broken site or duplicate simply use DOMAIN.COM instead of domain.com in the site create form. This commit is trying to add strtolower(trim(domain)) also for aliases. Maybe there is too many strtolower(trim(domain)) now, please review this if possible.
Comment #2
anarcat CreditAttribution: anarcat commentedIndeed, that's a bug. Not sure we need to fix it in all those places, but I don't think it would hurt and it would be safer. I think this is a critical bug, marking as such.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedTerrifyingly, I don't even have to change the capitalisation to duplicate a site node with the same name.
I can install '4.mig5-forge.net' and '4.mig5-forge.net' (identical) and get a duplicate entry error and a new site node + site install task.
Yikes. This definitely did not use to be the case.
Comment #4
adrian CreditAttribution: adrian commentedthis actually works fine for me on head, but this puzzles me :
The client bit is basically saying that the client can create the same site twice, as long as the site belongs to him ?
this code comes from pre-git days.
Comment #5
adrian CreditAttribution: adrian commentedconfirmed that was the error.
my test site was owned by a different client, but it was allowing you to create multiple copies of the site for the same client.
[master 842e252] Logic error allowing a client to create multiple copies of the same site. #949044
1 files changed, 0 insertions(+), 5 deletions(-)
it was also being done for aliases. there it was even stranger. the logic was allowing the user to create an alias for a site, that is the same value as the that for one of the other sites it owns, including the site proper. Meaning it was attempting to allow you to have the vhost loading to have a crapshoot about which alias was used, based on the alphabetical precedence of the parent site.
[master e90196d] incorrect logic for clients and aliases. same issue as #949044
1 files changed, 0 insertions(+), 5 deletions(-)
This seems to have come in with the old ports stuff - http://is.gd/gAeVX , which has since been changed significantly.
I believe the original intention was something along the lines of not allowing another site to create an alias or a new site running on a different port from yours.
ie: another client couldnt create clientsite.com:8080 on top of the existing site clientsite.com.
That's all irrelevant now, with the new port system.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedHoly cow!
Thanks for figuring all that out :)
Comment #8
anarcat CreditAttribution: anarcat commentedApplied the more ambitious patch:
http://gitorious.org/aegir/hostmaster/commit/983a0ee8aeca7e079453a88543d...
Comment #9
omega8cc CreditAttribution: omega8cc commentedI found even more missing strtolower(trim(domain)) allowing to still create duplicates or causing errors on tasks instead of denying the task to be queued:
Force lowercase also in the hosting_task_clone_form_validate()
http://drupalcode.org/sandbox/omega8cc/1074912.git/commit/1683056
Force lowercase also in the hosting_task_migrate_form_validate()
http://drupalcode.org/sandbox/omega8cc/1074912.git/commit/a176911
Force lowercase also in the hosting_site_drush_context_import()
http://drupalcode.org/sandbox/omega8cc/1074912.git/commit/b5cd953
Comment #10
anarcat CreditAttribution: anarcat commentedSome of those are weird for me:
Why assign the url back to the form values?! Why not just:
?
Comment #11
omega8cc CreditAttribution: omega8cc commentedOne of those patches may look weird, but it was for readability, and it did fixed the problem, I tested it, but maybe it should be changed.
Comment #12
anarcat CreditAttribution: anarcat commentedThe patches should be fixed - i think they shouldn't modify the $forms array, and the comment is wrong (the assignment doesn't turn into lowercase). I do not feel the resulting code is more readable, for me at least.
Comment #13
omega8cc CreditAttribution: omega8cc commentedOK, I will fix that asap.
Comment #14
omega8cc CreditAttribution: omega8cc commentedFixed - I hope!
Force lowercase comparison also in the clone and migrate forms:
http://drupalcode.org/sandbox/omega8cc/1074912.git/commit/7243837
Force lowercase also in the hosting_site_drush_context_import()
http://drupalcode.org/sandbox/omega8cc/1074912.git/commit/b5cd953
Comment #15
anarcat CreditAttribution: anarcat commentedimported both commits in stable and master branches. please don't include the "BOA" prefix or "(grace)" suffix in commit logs, as then i can't cherry-pick them directly...
Comment #17
omega8cc CreditAttribution: omega8cc commentedI just discovered that it is again possible to create broken site with CAPS in the domain name on Clone and/or Migrate. So my weird initial patches fixed this but I failed to test it again after I changed the patches later, as suggested.
Comment #18
omega8cc CreditAttribution: omega8cc commentedThe problem is that currently the domain name is converted to lowercase only in the front-end, while CAPS are still send as-is to the backend, which results with CAPS in the site directory name, in the drush alias etc. This ends with "successful" Clone task, but then immediately fails on Import/Verify, because of lower/CAPS mismatch between frontend and backend.
Comment #19
omega8cc CreditAttribution: omega8cc commentedFinally it is fixed properly:
Add strtolower(trim(domain)) also in function drush_hosting_migrate_pre_hosting_task()
http://drupalcode.org/sandbox/omega8cc/1074912.git/commit/51a5423c700f68...
Add strtolower(trim(domain)) also in function drush_hosting_clone_pre_hosting_task()
http://drupalcode.org/sandbox/omega8cc/1074912.git/commit/9ad2655681e22e...
Comment #20
anarcat CreditAttribution: anarcat commentedmerged in 2.x and 1.x