Activate the passwd extop plugin and ipa-kpasswd daemon

This commit is contained in:
Simo Sorce
2007-08-15 18:30:15 -04:00
parent a8e489e065
commit 788149e2e5
4 changed files with 33 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
PREFIX ?= $(DESTDIR)/usr
SBIN = $(PREFIX)/sbin
INITDIR = $(DESTDIR)/etc/rc.d/init.d
LDFLAGS +=-lkrb5 -llber -lldap
CFLAGS ?= -Wall -Wshadow -O2
@@ -15,8 +16,10 @@ all: $(OBJS)
install:
-mkdir -p $(SBIN)
install -m 755 ipa_kpasswd $(SBIN)
-mkdir -p $(INITDIR)
install -m 755 ipa-kpasswd.init $(INITDIR)/ipa-kpasswd
clean:
rm -f *.o
rm -f ipa_kpasswd
rm -f *~
rm -f *~

View File

@@ -21,6 +21,7 @@
#include <ldap.h>
#include <sasl/sasl.h>
#define DEFAULT_KEYTAB "FILE:/var/kerberos/krb5kdc/kpasswd.keytab"
#define TMP_TEMPLATE "/tmp/kpasswd.XXXXXX"
#define KPASSWD_PORT 464
#define KPASSWD_TCP 1
@@ -108,7 +109,7 @@ int remove_blacklist(pid_t pid)
int debug = 1;
char *srv_pri_name = "kadmin/changepw";
char *keytab_name = "FILE:/var/kerberos/krb5kdc/kpasswd.keytab";
char *keytab_name = NULL;
static int get_krb5_ticket(char *tmp_file)
{
@@ -864,6 +865,16 @@ int main(int argc, char *argv[])
int tcp_s, udp_s;
int tru = 1;
int ret;
char *key;
key = getenv("KRB5_KTNAME");
if (!key) {
key = DEFAULT_KEYTAB;
}
keytab_name = strdup(key);
if (!keytab_name) {
fprintf(stderr, "Out of memory!\n");
}
tcp_s = socket(AF_INET, SOCK_STREAM, 0);
if (tcp_s == -1) {