blob: ef3fddab85db02bfd9d5c94d3d24eaee6c3aa419 [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>
#include "gsw_passwd.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;
}