Actually do magic, tested this time
This commit is contained in:
parent
36e3ae8c9e
commit
34da813a37
|
@ -57,19 +57,6 @@ int addclub() {
|
|||
deny("user %s already exists", userid);
|
||||
|
||||
snprintf(homedir, sizeof(homedir), "%s/%s", club_home, userid);
|
||||
snprintf(acl_s, sizeof(acl_s), club_home_acl, userid);
|
||||
|
||||
acl = acl_from_text(acl_s);
|
||||
if (acl == NULL)
|
||||
fatalpe("Unable to parse club_home_acl");
|
||||
|
||||
if (*club_home_acl) {
|
||||
snprintf(dacl_s, sizeof(dacl_s), club_home_dacl, userid);
|
||||
dacl = acl_from_text(dacl_s);
|
||||
if (dacl == NULL)
|
||||
fatalpe("Unable to parse club_home_dacl");
|
||||
}
|
||||
|
||||
ceo_krb5_init();
|
||||
ceo_ldap_init();
|
||||
ceo_kadm_init();
|
||||
|
@ -80,6 +67,20 @@ int addclub() {
|
|||
if ((id = ceo_new_uid(member_min_id, member_max_id)) <= 0)
|
||||
fatal("no available uids in range [%d, %d]", member_min_id, member_max_id);
|
||||
|
||||
snprintf(acl_s, sizeof(acl_s), club_home_acl, id);
|
||||
|
||||
acl = acl_from_text(acl_s);
|
||||
if (acl == NULL)
|
||||
fatalpe("Unable to parse club_home_acl");
|
||||
|
||||
if (*club_home_dacl) {
|
||||
snprintf(dacl_s, sizeof(dacl_s), club_home_dacl, id);
|
||||
dacl = acl_from_text(dacl_s);
|
||||
if (dacl == NULL)
|
||||
fatalpe("Unable to parse club_home_dacl");
|
||||
}
|
||||
|
||||
|
||||
krb_ok = ceo_del_princ(userid);
|
||||
if (!krb_ok)
|
||||
logmsg("successfully cleared principal for %s", userid);
|
||||
|
|
|
@ -62,18 +62,6 @@ int addmember() {
|
|||
deny("user %s already exists", userid);
|
||||
|
||||
snprintf(homedir, sizeof(homedir), "%s/%s", member_home, userid);
|
||||
snprintf(acl_s, sizeof(acl_s), club_home_acl, userid);
|
||||
|
||||
acl = acl_from_text(acl_s);
|
||||
if (acl == NULL)
|
||||
fatalpe("Unable to parse member_home_acl");
|
||||
|
||||
if (*member_home_acl) {
|
||||
snprintf(dacl_s, sizeof(dacl_s), club_home_dacl, userid);
|
||||
dacl = acl_from_text(dacl_s);
|
||||
if (dacl == NULL)
|
||||
fatalpe("Unable to parse member_home_dacl");
|
||||
}
|
||||
|
||||
if (ceo_read_password(password, sizeof(password), use_stdin))
|
||||
return 1;
|
||||
|
@ -88,6 +76,18 @@ int addmember() {
|
|||
if ((id = ceo_new_uid(member_min_id, member_max_id)) <= 0)
|
||||
fatal("no available uids in range [%d, %d]", member_min_id, member_max_id);
|
||||
|
||||
snprintf(acl_s, sizeof(acl_s), club_home_acl, id);
|
||||
|
||||
acl = acl_from_text(acl_s);
|
||||
if (acl == NULL)
|
||||
fatalpe("Unable to parse member_home_acl");
|
||||
|
||||
if (*member_home_acl) {
|
||||
snprintf(dacl_s, sizeof(dacl_s), club_home_dacl, id);
|
||||
dacl = acl_from_text(dacl_s);
|
||||
if (dacl == NULL)
|
||||
fatalpe("Unable to parse member_home_dacl");
|
||||
}
|
||||
krb_ok = ceo_del_princ(userid);
|
||||
krb_ok = krb_ok || ceo_add_princ(userid, password);
|
||||
if (!krb_ok)
|
||||
|
|
Loading…
Reference in New Issue