[2085] in Moira
Changes to winad.c
daemon@ATHENA.MIT.EDU (David Tanner)
Tue Sep 7 11:25:56 2004
Message-Id: <5.2.1.1.2.20040907112158.00b4ce98@hesiod>
Date: Tue, 07 Sep 2004 11:25:51 -0400
To: moiradev@mit.edu
From: David Tanner <dtanner@MIT.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format=flowed
Hi Garry,
Please put the changes below onto ttsp for testing. These changes will
take care of the home directory problem. Let me know what I can test.
Thanks,
David
Index: winad.c
===================================================================
RCS file:
\\afs\all\athena.mit.edu\astaff\project\moiradev\repository/moira/incremental/winad/winad.c,v
retrieving revision 1.43
diff -c -r1.43 winad.c
*** winad.c 2004/08/04 18:02:30 1.43
--- winad.c 2004/09/07 13:46:46
***************
*** 1,4 ****
! /* $Header:
\\\\afs\\all\\athena.mit.edu\\astaff\\project\\moiradev\\repository/moira/incremental/winad/winad.c,v
1.43 2004/08/04 18:02:30 zacheiss Exp $
/* winad.incr arguments examples
*
* arguments when moira creates the account - ignored by winad.incr
since the account is unusable.
--- 1,4 ----
! /* $Header:
/afs/athena.mit.edu/astaff/project/moiradev/repository/moira/incremental/winad/winad.c,v
1.43 2004/08/04 18:02:30 zacheiss Exp $
/* winad.incr arguments examples
*
* arguments when moira creates the account - ignored by winad.incr
since the account is unusable.
***************
*** 3117,3133 ****
{
char distinguished_name[256];
char winPath[256];
- 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))
--- 3117,3126 ----
***************
*** 3166,3204 ****
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;
}
else
- {
- homedir_v[0] = NULL;
- drives_v[0] = NULL;
- winProfile_v[0] = NULL;
- }
- 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);
}
int user_create(int ac, char **av, void *ptr)
--- 3159,3182 ----
linklist_free(group_base);
group_count = 0;
if (operation == LDAP_MOD_ADD)
{
memset(winPath, 0, sizeof(winPath));
AfsToWinAfs(fs_pack, winPath);
!
! 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
{
! 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);
}
! return(0);
}
int user_create(int ac, char **av, void *ptr)
***************
*** 5681,5686 ****
--- 5659,5666 ----
}
}
}
+ else
+ return(n);
}
if (hp != NULL)