Re: persistent data with Sun pam

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

You can Create a user. Look following code. It's not good,
but it works. Maybe you've to make some corrections.

Gero

----------------------------------------------------------------
#include <crypt.h>

int createuser(char *user, char *passwd)
{
	struct passwd* pwd;
	char str[150];
	char comment[]= "testuser";
	char skeldir[]= "/etc/skel";
	char shell[] = "/bin/bash";

	if ((pwd = getpwnam(user)) == NULL)
	{
		sprintf(str,"useradd -d /home/%s -s %s -c %s -m -k %s -p %s
%s", user, shell, comment, skeldir, \
			crypt(password,"az"), user);
		system(str);

		return 0;
	}
	
	return 0;
}



_______________________________________________

Pam-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/pam-list

[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux