At work, I recently encountered #261107 on our distantly Debian-derived server and workstation distros. It really annoyed me because installing the mysql-server package fell over in a screaming heap when it went to create the mysql user.
I'd seen a bug filed internally, relating to this particular use case, and initially I thought, based on the output, that it was the MySQL package's pre-install script not quoting the string "MySQL Server", but upon further investigation with strace, it turned out to be adduser's internal call to chfn that was failing, all because of the lack of a controlling terminal.
Anyway, a colleague fixed the problem, and pointed me to the abovementioned bug, and this is what strikes me as so strange: the bug has been open for approaching 3 years. I can't reproduce this bug with a stock sarge or etch install, yet I can reproduce it on an Ubuntu Dapper-derived system at will, by calling chfn -f with /dev/null redirected to stdin.
If this bug was biting with any sort of regularity, there'd be people rioting, because their adduser calls would be falling over, left, right and centre.
Yet it was obviously reproducible for the bug submitter, and I can reproduce it at work. There's more to it than the lack of a controlling terminal.
The plot, it be thick.
Mystery solved. Apparently if you specify terminal restrictions in /etc/security/access.conf (even explicitly restricting it to "ALL"), pam_access gets all bitter and twisted if there's no controlling terminal for the thing being authorized. Wicked.