Fix home directory error handling
authorMichael Spang <mspang@uwaterloo.ca>
Wed, 29 Jul 2009 13:34:55 +0000 (09:34 -0400)
committerMichael Spang <mspang@uwaterloo.ca>
Wed, 29 Jul 2009 13:47:04 +0000 (09:47 -0400)
src/net.h
src/op-adduser.c

index 45a4a06..8674a82 100644 (file)
--- a/src/net.h
+++ b/src/net.h
@@ -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);
index 17f3602..90ab6aa 100644 (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;
 }