Hi Larry,
There are several coding techniques I use to ensure the code is secure.
1) non-trusting functions. All functions don't trust anything they're given, even if they're internal function calls. This means, that even if invalid strings make it past the intial filters, internally, they'll get stopped.
2) Don't run as root. DirectAdmin runs as the "nobody" user for 98% of the time. Only when it needs root access does it ever get it. If it only needs "diradmin" access, then it will only have that access permission to open the writing of a file... once open, the permissions are dropped back down, even before the writing has commenced.
3) Variable length memory/strings. All data in DA is worked with using variable length buffers, so overruns can't happen. If you give too much info, then the filters will either say, "hey, you gave too much", or else DA will just make a buffer big enough for the data.
4) No local memory buffers. Undestanding how program stacks work in memory, local buffers are bad if they're overrun because they'll be overwriting the programs code in memory, allowing unwanted code execution. We use memory that is not local and is all requested from the systems "heap".. meaning "not where code lives". Any overruns would be done in "storage" which never gets executed.
5) no backdoors. The only way into DA is through the front door (port 2222). We have no special access to your machines and cannot help you if (for example) you lose your passwords.
6) security over functionality. As you may have seen with some aspects, DA can be restrictive. For example, you may want to use certain characters for filenames, passwords, etc. We always start out with the most strict ruleset first, and then very slowly add flexibiliy as needed.
All put together.. should any single point fail, there are others to catch it. Many layers of security is the best strategy.
John