blob: 90c95d9451a22c6bcd6b438987b02bdb19c91439 [file] [log] [blame]
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
#include <termios.h>
#include <unistd.h>
#include <stdint.h>
#include <sys/ioctl.h>
#include <dlfcn.h>
int gsw_set_passwd(char *username, char *passwd)
{
int ret;
char cmd[256];
if((username == NULL) || (passwd ==NULL))
{
return -1;
}
sprintf(cmd, "echo \"%s:%s\"|chpasswd", username, passwd);
ret = system(cmd);
return ret;
}