[1821] in Moira

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

change to winad.gen

daemon@ATHENA.MIT.EDU (Qing Dong)
Thu Jul 19 17:12:00 2001

Message-Id: <200107192111.RAA11954@melbourne-city-street.mit.edu>
Date: Thu, 19 Jul 2001 17:11:54 -0400
To: moiradev@mit.edu
From: Qing Dong <dongq@MIT.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"

Sorry, another change to winad.gen. It is to handle 
users with multiple file systems correctly. 

Thanks. 

Qing

Index: winad.pc
===================================================================
RCS file:
\\dongq-afs\all\athena.mit.edu\astaff\project\moiradev\repository/moira/gen/
winad.pc,v
retrieving revision 1.2
diff -c -r1.2 winad.pc
*** winad.pc	2001/07/03 18:29:24	1.2
--- winad.pc	2001/07/19 21:08:04
***************
*** 84,89 ****
--- 84,90 ----
    int users_id, unix_uid, status;
    char type[FILESYS_TYPE_SIZE];
    char name[FILESYS_NAME_SIZE];
+   int fid;
    EXEC SQL END DECLARE SECTION;
  
    sprintf(foutf, "%s/winuser.db", winad_dir);
***************
*** 110,135 ****
        strtrim(login);
        strtrim(mit_id);
        
!       EXEC SQL SELECT type, name INTO :type, :name 
!       FROM filesys 
!       WHERE lockertype = 'HOMEDIR'
!       AND owner = :users_id;
  
        if (sqlca.sqlcode == 0)
        {
!         strtrim(type);
!         strtrim(name);
        }
        else
        {
!         strcpy(type, "");
!         strcpy(name, "");
        }
        fprintf(fout, "%d %s %d %d %s %s %s\n",
! 		    users_id, login, unix_uid, status, mit_id, 
!         type, name);
! 	}
! 
    if (sqlca.sqlcode < 0)
      db_error(sqlca.sqlcode);
    EXEC SQL CLOSE u_cursor;
--- 111,174 ----
        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, "");
!           strcpy(name, "");
!         }
! 
!         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, "");
!           strcpy(name, "");
!         }
        }
+   
        fprintf(fout, "%d %s %d %d %s %s %s\n",
! 		      users_id, login, unix_uid, status, mit_id, 
!           type, name);
!     }
!   
    if (sqlca.sqlcode < 0)
      db_error(sqlca.sqlcode);
    EXEC SQL CLOSE u_cursor;



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