Fix home directory error handling

pull/5/head
Michael Spang 14 years ago
parent aaeca32107
commit e0332eecac
  1. 1
      src/net.h
  2. 9
      src/op-adduser.c

@ -42,5 +42,6 @@ enum {
#define EKERB -2
#define ELDAP -3
#define EHOME -4
int receive_one_message(int sock, struct sctp_meta *msg_meta, struct strbuf *msg);

@ -167,7 +167,10 @@ static int32_t addmember(Ceo__AddUser *in, Ceo__AddUserResponse *out) {
response_message(out, 0, "successfully created ldap group");
if ((home_stat = ceo_create_home(homedir, id, id)))
notice("successfully created home directory for %s", in->username);
response_message(out, EHOME, "unable to create home directory for %s", in->username);
else
response_message(out, 0, "successfully created home directory");
return krb_stat || user_stat || group_stat || home_stat;
}
@ -205,7 +208,9 @@ static int32_t addclub(Ceo__AddUser *in, Ceo__AddUserResponse *out) {
response_message(out, 0, "successfully created ldap sudoers");
if ((home_stat = ceo_create_home(homedir, id, id)))
notice("successfully created home directory for %s", in->username);
response_message(out, EHOME, "unable to create home directory for %s", in->username);
else
response_message(out, 0, "successfully created home directory");
return user_stat || group_stat || sudo_stat || home_stat;
}

Loading…
Cancel
Save