[2014] in Moira

home help back first fref pref prev next nref lref last post

changes to winad.pc for winhomedir and winprofile support

daemon@ATHENA.MIT.EDU (Qing Dong)
Mon Jun 2 14:14:52 2003

Message-Id: <5.1.0.14.2.20030602140851.02d515a8@hesiod>
Date: Mon, 02 Jun 2003 14:12:54 -0400
To: moiradev@mit.edu
From: Qing Dong <dongq@MIT.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format=flowed

Index: winad.pc
===================================================================
RCS file: 
\\dongq-afs\all\athena.mit.edu\astaff\project\moiradev\repository/moira/gen/winad.pc,v
retrieving revision 1.4
diff -c -r1.4 winad.pc
*** winad.pc	2001/08/12 19:26:33	1.4
--- winad.pc	2003/06/02 18:06:21
***************
*** 86,91 ****
--- 86,93 ----
     int users_id, unix_uid, status;
     char type[FILESYS_TYPE_SIZE];
     char name[FILESYS_NAME_SIZE];
+   char homedir[USERS_WINHOMEDIR_SIZE];
+   char profiledir[USERS_WINPROFILEDIR_SIZE];
     int fid;
     EXEC SQL END DECLARE SECTION;

***************
*** 100,174 ****
     }

     EXEC SQL DECLARE u_cursor CURSOR FOR
!     SELECT users_id, login, unix_uid, status, clearid
       FROM users
       ORDER BY users_id;
     EXEC SQL OPEN u_cursor;
     while (1)
       {
         EXEC SQL FETCH u_cursor INTO :users_id, :login, :unix_uid, :status,
! :mit_id;
         if (sqlca.sqlcode)
   	      break;
         strtrim(login);
         strtrim(mit_id);
!
!       EXEC SQL SELECT filsys_id into :fid
!         FROM filesys
!         WHERE lockertype = 'HOMEDIR'
!         AND label = :login
!         AND type = 'FSGROUP';
!
!       if (sqlca.sqlcode == 0)
!       {
!         EXEC SQL DECLARE f_cursor CURSOR FOR
!           SELECT type, name
!           FROM filesys a, fsgroup b
!           WHERE a.filsys_id=b.filsys_id
!           AND b.group_id=:fid
!           ORDER by key;

!         EXEC SQL OPEN f_cursor;

!         EXEC SQL FETCH f_cursor INTO :type, :name;

!         if (sqlca.sqlcode == 0)
!         {
!           strtrim(type);
!           strtrim(name);
!         }
!         else
!         {
!           strcpy(type, "NONE");
!           strcpy(name, "NONE");
!         }

!         EXEC SQL CLOSE f_cursor;
!       }
   	

!       else
!       {
!         EXEC SQL SELECT type, name into :type, :name
!           FROM filesys
!           WHERE lockertype = 'HOMEDIR'
!           AND label=:login;
!
!         if (sqlca.sqlcode == 0)
!         {
!           strtrim(type);
!           strtrim(name);
!         }
!         else
!         {
!           strcpy(type, "NONE");
!           strcpy(name, "NONE");
!         }
!       }
!
!       fprintf(fout, "%d %s %d %d %s %s %s\n",
   		      users_id, login, unix_uid, status, mit_id,
!           type, name);
       }

     if (sqlca.sqlcode < 0)
--- 102,200 ----
     }

     EXEC SQL DECLARE u_cursor CURSOR FOR
!     SELECT users_id, login, unix_uid, status, clearid, winhomedir, 
winprofiledir
       FROM users
       ORDER BY users_id;
     EXEC SQL OPEN u_cursor;
     while (1)
       {
         EXEC SQL FETCH u_cursor INTO :users_id, :login, :unix_uid, :status,
! :mit_id, :homedir, :profiledir;
         if (sqlca.sqlcode)
   	      break;
         strtrim(login);
         strtrim(mit_id);
! 	  strtrim(homedir);
! 	  strtrim(profiledir);
!
! 	  if (strcmp(mit_id, "") == 0)
! 		strcpy(mit_id, "0");
!
! 	  if (strcasecmp(homedir, "[AFS]") == 0 || strcasecmp(profiledir, 
"[AFS]") == 0)
! 	  {
! 		EXEC SQL SELECT filsys_id into :fid
! 			FROM filesys
! 			WHERE lockertype = 'HOMEDIR'
! 			AND label = :login
! 			AND type = 'FSGROUP';
!
! 		if (sqlca.sqlcode == 0)
! 		{
! 			EXEC SQL DECLARE f_cursor CURSOR FOR
! 			SELECT type, name
! 			FROM filesys a, fsgroup b
! 			WHERE a.filsys_id=b.filsys_id
! 			AND b.group_id=:fid
! 			ORDER by key;

! 			EXEC SQL OPEN f_cursor;

! 			EXEC SQL FETCH f_cursor INTO :type, :name;

! 			if (sqlca.sqlcode == 0)
! 			{
! 				strtrim(type);
! 				strtrim(name);
! 			}
! 			else
! 			{
! 				strcpy(type, "NONE");
! 				strcpy(name, "NONE");
! 			}

! 			EXEC SQL CLOSE f_cursor;
! 		}
   	

! 		else
! 		{
! 			EXEC SQL SELECT type, name into :type, :name
! 			FROM filesys
! 			WHERE lockertype = 'HOMEDIR'
! 			AND label=:login;
!
! 			if (sqlca.sqlcode == 0)
! 			{
! 				strtrim(type);
! 				strtrim(name);
! 			}
! 			else
! 			{
! 				strcpy(type, "NONE");
! 				strcpy(name, "NONE");
! 			}
! 		}
! 		if (strcasecmp(type, "AFS") != 0)
! 			strcpy(name, "[LOCAL]");
! 					
! 	}
! 	
! 	if (strcasecmp(homedir, "[AFS]") == 0)
! 	{
! 		strcpy(homedir, name);
! 	}
!
! 	if (strcasecmp(profiledir, "[AFS]") == 0)
! 	{
! 		strcpy(profiledir, name);
! 		if (strcasecmp(name, "[LOCAL]"))
! 			strcat(profiledir, "/.winprofile");
! 	}
! 	
!
! 	fprintf(fout, "%d %s %d %d %s %s %s\n",
   		      users_id, login, unix_uid, status, mit_id,
! 			  homedir, profiledir);
       }

     if (sqlca.sqlcode < 0)


home help back first fref pref prev next nref lref last post