I am having a problems running smbclient as part of a cgi script.

The cgi script is running as setuid root.

When the script calls (with a pipe feeding stdin to smbpasswd):

"-a", "-s", username.c_str(), NULL);

the smbpasswd options to be printed instead of creating an account with
the given user. Running the same command seems to work from an
interactive session. Is there problems running smbpasswd noninteractivly?

I am running a Sarge Debian Linux installation (samba 3.0.10-1).

Any help in getting this problem sorted out would be much appreciated.