Hi all
I need my program to be abled to add users but I couldn't find how to do it so I use execve(useradd....) but it doesn't add the user's password in the /etc/shadow file. Then I found in man the setpwent() function but I just can't untherstand how to use it. the compiler doesn't like the code...
So would someone give me a short exapmle how to use it?
Or may be a better way to add users...
thanks in advance
I need my program to be abled to add users but I couldn't find how to do it so I use execve(useradd....) but it doesn't add the user's password in the /etc/shadow file. Then I found in man the setpwent() function but I just can't untherstand how to use it. the compiler doesn't like the code...
So would someone give me a short exapmle how to use it?
Or may be a better way to add users...
thanks in advance