Displaying 1 result from an estimated 1 matches for "cmdpipe".
Did you mean:
cadpipe
2002 Nov 25
0
Linux and Samba Code
...B/Windows password...\n");
if ( ! change(SMBPASSWD, name, newpw, mystderr)) exit(1);
if (isatty(0)) fprintf(mystderr, "\tSuccessfully changed SMB/Windows
password.\n");
exit(0);
}
int change(char *program, char *user, char *pwd, FILE *mystderr) {
char cmd[STRLEN]; FILE *cmdpipe; int status; /* open a pipe to and
then feed the password program, slowly */
strncpy(cmd, program, STRLEN);
strncat(cmd, " ", STRLEN + 1);
strncat(cmd, user, STRLEN + strlen(cmd));
if ((cmdpipe=popen(cmd, "w"))== NULL) {
fprintf(mystderr, "Failed to open p...