Auth as ceo/admin for zfsaddhomedir

pull/5/head
Michael Spang 15 years ago
parent c4e12ae227
commit ede20cf95e
  1. 6
      src/addhomedir.c

@ -11,6 +11,7 @@
#include "addhomedir.h"
#include "util.h"
#include "config.h"
#include "krb5.h"
int ceo_create_home(char *homedir, uid_t uid, gid_t gid, char *mode, char *acl) {
char uid_str[16], gid_str[16];
@ -21,10 +22,15 @@ int ceo_create_home(char *homedir, uid_t uid, gid_t gid, char *mode, char *acl)
snprintf(uid_str, sizeof(uid_str), "%ld", (long)uid);
snprintf(gid_str, sizeof(gid_str), "%ld", (long)uid);
if(!acl[0]) acl = NULL;
ceo_krb5_auth(admin_bind_userid, admin_bind_keytab);
if(spawnv("/usr/bin/ssh", zfs_argv)) {
errorpe("failed calling zfsaddhomedir for %s", homedir);
return -1;
}
ceo_krb5_deauth();
return 0;
}

Loading…
Cancel
Save