Small bug: duplicate domainnames sometimes possible through the API

Wunk

Verified User
Joined
Sep 25, 2003
Messages
111
When using the API, it's possible to create a second account with a duplicate domain in directadmin..

This seriously screws stuff up, since if you delete the duplicate entry, it'll leave the correct httpd config alone, but it WILL delete all mailboxes and settings for that domain..

It could use a check on this..
 
You might notify DirectAdmin of this (email) since they might not read every post in these forums.

In the mean time you implement the checks in your script by collecting a list of all domains on the server and then checking the new domain against those. Although it will be time consuming and slow down your script, it is the best workaround without writing your own API functions.
 
Last edited:
Hello,

Can you provide a bit more info? Are you using CMD_API_DOMAIN?action=create etc.. ? I'm staring at the code which does do the check.. I'll be testing it out shortly. Note that it always uses the named.conf file (usually in /etc/named.conf) to see if a domain exists, so if the dns zone is removed, then DA will think it isn't there.

[edit]
Just tested it out manually with IE, I got:
Code:
error=1&text=Cannot Create Domain&details=Domain already exists
John
 
Hm, I'll get back to you about it on how to duplicate it. An ex-employee programmed our API interface, so I'll have to dive into the code, I'll keep you posted..
 
Back
Top