Fix home directory error handling

This commit is contained in:
Michael Spang 2009-07-29 09:34:55 -04:00
parent aaeca32107
commit e0332eecac
2 changed files with 8 additions and 2 deletions

View File

@ -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);

View File

@ -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;
}