]> andersk Git - moira.git/commitdiff
Properly set home directory at user creation time.
authorzacheiss <zacheiss>
Tue, 21 Sep 2004 06:08:17 +0000 (06:08 +0000)
committerzacheiss <zacheiss>
Tue, 21 Sep 2004 06:08:17 +0000 (06:08 +0000)
incremental/winad/winad.c

index d1f46f6a072cccc6d394ce2044a5717fcc461f44..cff3e54c40863f3de1d2e552683af3611caf528f 100755 (executable)
@@ -3120,14 +3120,8 @@ int filesys_process(LDAP *ldap_handle, char *dn_path, char *fs_name,
   char  winProfile[256];
   char  filter[128];
   char  *attr_array[3];
-  char  *homedir_v[] = {NULL, NULL};
-  char  *winProfile_v[] = {NULL, NULL};
-  char  *drives_v[] = {NULL, NULL};
   int   group_count;
-  int   n;
   int   rc;
-  int   i;
-  LDAPMod   *mods[20];
   LK_ENTRY  *group_base;
 
   if (!check_string(fs_name))
@@ -3166,39 +3160,27 @@ int filesys_process(LDAP *ldap_handle, char *dn_path, char *fs_name,
   linklist_free(group_base);
   group_count = 0;
 
-  n = 0;
   if (operation == LDAP_MOD_ADD)
     {
       memset(winPath, 0, sizeof(winPath));
       AfsToWinAfs(fs_pack, winPath);
-      homedir_v[0] = winPath;
-      drives_v[0] = "H:";
       memset(winProfile, 0, sizeof(winProfile));
       strcpy(winProfile, winPath);
       strcat(winProfile, "\\.winprofile");
-      winProfile_v[0] = winProfile;
+
+      rc = attribute_update(ldap_handle, distinguished_name, winProfile, "profilePath", fs_name);
+      rc = attribute_update(ldap_handle, distinguished_name, "H:", "homeDrive", fs_name);
+      rc = attribute_update(ldap_handle, distinguished_name, winPath, "homeDirectory", fs_name);
+
     }
   else
     {
-      homedir_v[0] = NULL;
-      drives_v[0] = NULL;
-      winProfile_v[0] = NULL;
+      rc = attribute_update(ldap_handle, distinguished_name, "", "profilePath", fs_name);
+      rc = attribute_update(ldap_handle, distinguished_name, "", "homeDrive", fs_name);
+      rc = attribute_update(ldap_handle, distinguished_name, "", "homeDirectory", fs_name);
     }
-  ADD_ATTR("profilePath", winProfile_v, operation);
-  ADD_ATTR("homeDrive", drives_v, operation);
-  ADD_ATTR("homeDirectory", homedir_v, operation);
-  mods[n] = NULL;
 
-  rc = ldap_modify_s(ldap_handle, distinguished_name, mods);
-  if (rc != LDAP_SUCCESS)
-    {
-      com_err(whoami, 0, "Unable to modify user data for filesys %s : %s",
-              fs_name, ldap_err2string(rc));
-    }
-  for (i = 0; i < n; i++)
-    free(mods[i]);
-
-  return(rc);
+  return(0);
 }
 
 int user_create(int ac, char **av, void *ptr)
@@ -5681,6 +5663,8 @@ int SetHomeDirectory(LDAP *ldap_handle, char *user_name, char *DistinguishedName
                 }
             }
         }
+        else
+            return(n);
     }
 
     if (hp != NULL)
This page took 0.058949 seconds and 5 git commands to generate.