#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; | |
} |