499
499
slot_entry = (char *)malloc(sizeof(char)*(PATH_MAX));
501
bzero(slot_entry,PATH_MAX);
501
memset(slot_entry, 0, PATH_MAX);
504
504
fgets(slot_entry, PATH_MAX, fp);
519
519
// if( feof(fp) )
522
bzero(&sinfo_struct,sizeof(sinfo_struct)); // for good measure zero it out before use each time
522
memset(&sinfo_struct, 0, sizeof(sinfo_struct)); // for good measure zero it out before use each time
524
524
sinfo_struct.global_sessions = 0; // initializing to zero
525
525
element_num = Present;
723
723
? (sizeof(sinfo_struct.dll_location))
724
724
: (strlen(slot_element)) ) ); // took away an ")"
726
/* Set the last character in string to NULL since strncpy may mor may not copy the trailing NULL */
727
sinfo_struct.dll_location[sizeof(sinfo_struct.dll_location) - 1] = (char) NULL;
731
/* check for file existance */
735
if ( stat( sinfo_struct.dll_location, &statbuf ) < 0 ) {
736
/* File not found, or other error */
739
if ( Err == ENOENT ) {
740
fprintf(stderr, "\nReading Slot Info: %s: file not found (%s). Skipping slot entry.", sinfo_struct.dll_location, SysError(Err) );
741
/* WarnLog ( "***** ReadSlotInfoDB: %s: file not found (%s). Skipping DB entry.", sinfo[Index].dll_location, SysError(Err) ); */
744
fprintf(stderr, "\nReading Slot Info: looking at %s, stat64() returned %s (%d; %#x)", sinfo_struct.dll_location, SysError(Err), Err, Err);
745
/* DbgLog (DL0, "***** ReadSlotInfoDB: looking at %s, stat64() returned %s (%d; %#x)", sinfo[Index].dll_location, SysError(Err), Err, Err); */
747
memset( pSlot, '\0', sizeof(*pSlot) );
748
sinfo_struct.present = (CK_BOOL) FALSE;
752
} /* end DLLLocation unconditional block */
726
/* Set the last character in string to NULL since strncpy may mor may not copy the trailing NULL */
727
sinfo_struct.dll_location[sizeof(sinfo_struct.dll_location) - 1] = (char) NULL;
805
779
if( (sinfo_struct.dll_location != NULL) &&
806
780
(sinfo_struct.slot_init_fcn != NULL) ) {
808
bcopy(&sinfo_struct,&sinfo[Index],sizeof(sinfo_struct)); // similar to sinfo[Index] = &sinfo_struct;
782
memcpy(&sinfo[Index], &sinfo_struct, sizeof(sinfo_struct)); // similar to sinfo[Index] = &sinfo_struct;
809
783
PrintSlotInfo( &(sinfo[Index]) );