You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(108) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
(44) |
Feb
(87) |
Mar
(21) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-19 17:32:14
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv2040/src Modified Files: TekACL.cpp Log Message: REMOVE: Non-usable functions and variables. Index: TekACL.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekACL.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C 2 -d -p -r1.3 -r1.4 *** TekACL.cpp 10 Feb 2007 10:34:41 -0000 1.3 --- TekACL.cpp 19 Mar 2007 18:32:03 -0000 1.4 *************** MKTEKDEBUGSTRING(DBTekACL, "DBTekACL") *** 26,34 **** - static struct TekACE _CurrentUser; - static TekFile * _CurrentUserPipe = NULL; - static TEKPIPE _ACEPropertyPipe; - - TEKLTI_DECLSPEC uint8_t TekUserIsRoot() { --- 26,29 ---- *************** TEKLTI_DECLSPEC TEKERR TekACESpawnProces *** 58,69 **** { chroot("/"); - } - ! TEKLTI_DECLSPEC TEKERR TekACEBecomeAnonymous() ! { ! ! ! return TEKERR_OK; } --- 53,58 ---- { chroot("/"); ! return TEKERR_NOTIMPL; } |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-19 14:14:28
|
Update of /cvsroot/libteklti/libteklti/eal4 In directory planetsaphire.com:/tmp/cvs-serv31578/eal4 Added Files: .tekltiacl Makefile.am Log Message: ADD: Default .tekltiacl file. --- NEW FILE: Makefile.am --- --- NEW FILE: .tekltiacl --- |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-19 14:14:04
|
Update of /cvsroot/libteklti/libteklti In directory planetsaphire.com:/tmp/cvs-serv31578 Modified Files: Makefile.am configure.in Log Message: ADD: Default .tekltiacl file. Index: Makefile.am =================================================================== RCS file: /cvsroot/libteklti/libteklti/Makefile.am,v retrieving revision 1.15 retrieving revision 1.16 diff -C 2 -d -p -r1.15 -r1.16 *** Makefile.am 18 Mar 2007 14:05:44 -0000 1.15 --- Makefile.am 19 Mar 2007 15:14:03 -0000 1.16 *************** *** 22,26 **** AUTOMAKE_OPTIONS = foreign 1.9 ! SUBDIRS = uuid bzip2 examples src check_PROGRAMS = --- 22,26 ---- AUTOMAKE_OPTIONS = foreign 1.9 ! SUBDIRS = uuid bzip2 examples eal4 src check_PROGRAMS = Index: configure.in =================================================================== RCS file: /cvsroot/libteklti/libteklti/configure.in,v retrieving revision 1.50 retrieving revision 1.51 diff -C 2 -d -p -r1.50 -r1.51 *** configure.in 18 Mar 2007 14:07:08 -0000 1.50 --- configure.in 19 Mar 2007 15:14:03 -0000 1.51 *************** uuid/uuid_clear.3 uuid/uuid_time.3 *** 1564,1568 **** uuid/uuid_compare.3 uuid/uuid_copy.3 uuid/uuid_unparse.3 uuid/uuid_generate.3 ! examples/Makefile src/Makefile src/teklti.pc src/tekltiver.h Makefile libteklti.spec Doxyfile --- 1564,1568 ---- uuid/uuid_compare.3 uuid/uuid_copy.3 uuid/uuid_unparse.3 uuid/uuid_generate.3 ! examples/Makefile eal4/Makefile src/Makefile src/teklti.pc src/tekltiver.h Makefile libteklti.spec Doxyfile |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-19 14:13:03
|
Update of /cvsroot/libteklti/libteklti/eal4 In directory planetsaphire.com:/tmp/cvs-serv31514/eal4 Log Message: Directory /cvsroot/libteklti/libteklti/eal4 added to the repository |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-19 13:48:56
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv14670/src Modified Files: aclunix.c Log Message: REMOVE: Unneeded ACE from '.' file. Index: aclunix.c =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/aclunix.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C 2 -d -p -r1.7 -r1.8 *** aclunix.c 19 Mar 2007 14:41:16 -0000 1.7 --- aclunix.c 19 Mar 2007 14:48:31 -0000 1.8 *************** static inline int aclunix_prepnewdesc ( *** 329,333 **** { struct _fileent_v1 fent; - struct _aceent_v1 aent; size_t s; --- 329,332 ---- *************** static inline int aclunix_prepnewdesc ( *** 340,352 **** GETTEKUUID(tekfileacluuid, fent._fileent_uuid); fent._fileent_flags = aclunix_fileflag_inherit; ! ! fent._fileent_first_aceloc = 1; ! //fent._fileent_first_aceloc = 0; ! memset(&aent, '\0', sizeof(struct _aceent_v1)); ! aent._aceent_magic = _ent_magic_aceent_v1; ! aent._aceent_uid = getuid(); ! aent._aceent_gid = 0; ! aent._aceent_perms = 0x0000000000000001; ! GETTEKUUID(tekfileaceuuid, aent._aceent_uuid); /* Run fwrite() and return the result. */ --- 339,343 ---- GETTEKUUID(tekfileacluuid, fent._fileent_uuid); fent._fileent_flags = aclunix_fileflag_inherit; ! fent._fileent_first_aceloc = 0; /* Run fwrite() and return the result. */ *************** static inline int aclunix_prepnewdesc ( *** 358,368 **** return 1; } - aclunix_tobendian((struct _ent *)&aent); - s = fwrite(&aent, sizeof(struct _aceent_v1), 1, - handle->aclunix_handle_desc); - if ( s < 1 ) - { - return 1; - } /* Rewind the stream. */ --- 349,352 ---- |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-19 13:41:39
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv13704/src Modified Files: aclunix.c teklti.h tekltifrm.cpp Log Message: ADD: Added access check functions. Index: aclunix.c =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/aclunix.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C 2 -d -p -r1.6 -r1.7 *** aclunix.c 28 Feb 2007 19:42:59 -0000 1.6 --- aclunix.c 19 Mar 2007 14:41:16 -0000 1.7 *************** typedef struct _aceent_v1 *** 64,73 **** ! extern aclunix_handle * aclunix_opendesc ( ! const char *, ! int ! ); ! extern int aclunix_closedesc ( aclunix_handle * ); ! TEKLTI_DECLSPEC void aclunix_getpath ( char * src ) --- 64,70 ---- ! /*********************** ! * BEGIN SOURCE CODE * ! ***********************/ TEKLTI_DECLSPEC void aclunix_getpath ( char * src ) *************** TEKLTI_DECLSPEC void aclunix_getpath ( c *** 78,84 **** tmp = strrchr(src, '/'); /* If found, nullify it. */ ! if ( tmp == NULL ) ! src[0] = '\0'; ! else tmp[0] = '\0'; } --- 75,79 ---- tmp = strrchr(src, '/'); /* If found, nullify it. */ ! if ( tmp != NULL ) tmp[0] = '\0'; } *************** static int aclunix_isowner ( const char *** 91,99 **** uid_t priv_uid; ! #ifdef HAVE_GETEUID ! priv_uid = geteuid(); ! #else /* not HAVE_GETEUID */ priv_uid = getuid(); - #endif /* not HAVE_GETEUID */ /* Copy the string. */ --- 86,91 ---- uid_t priv_uid; ! /* Get the real User ID. */ priv_uid = getuid(); /* Copy the string. */ *************** static char * aclunix_getdesc_env ( char *** 298,301 **** --- 290,294 ---- { const char * desc_env; + size_t i; /* Let's try to get the filename from environ. */ *************** static char * aclunix_getdesc_env ( char *** 308,319 **** return NULL; /* Make sure we do not overrun the buffer with strcat(). */ ! if ( ( strlen(src) + strlen(desc_env) ) > 255 ) return NULL; return strcat(src, desc_env); } TEKLTI_DECLSPEC aclunix_handle * aclunix_opendesc ( const char * dirname, --- 301,377 ---- return NULL; + /* See if we're going to need to append a '/' character. */ + if ( strchr(src, '/') != NULL ) + { + if ( src[strlen(src) - 1] != '/' ) + i = 1; + else + i = 0; + } else { + i = 0; + } + /* Make sure we do not overrun the buffer with strcat(). */ ! if ( ( strlen(src) + strlen(desc_env) + i ) > 255 ) return NULL; + /* Make sure there is a '/' at the end of the string if + this is a full path. */ + if ( strchr(src, '/') != NULL ) + if ( src[strlen(src) - 1] != '/' ) + strcat(src, "/"); + return strcat(src, desc_env); } + static inline int aclunix_prepnewdesc ( aclunix_handle * handle ) + { + struct _fileent_v1 fent; + struct _aceent_v1 aent; + size_t s; + + memset(&fent, '\0', sizeof(struct _fileent_v1)); + fent._fileent_magic = _ent_magic_fileent_v1; + fent._fileent_filename[0] = '.'; + #ifdef UNICODE + fent._fileent_filename_unicode = (uint16_t)L'.'; + #endif /* UNICODE */ + GETTEKUUID(tekfileacluuid, fent._fileent_uuid); + fent._fileent_flags = aclunix_fileflag_inherit; + + fent._fileent_first_aceloc = 1; + //fent._fileent_first_aceloc = 0; + memset(&aent, '\0', sizeof(struct _aceent_v1)); + aent._aceent_magic = _ent_magic_aceent_v1; + aent._aceent_uid = getuid(); + aent._aceent_gid = 0; + aent._aceent_perms = 0x0000000000000001; + GETTEKUUID(tekfileaceuuid, aent._aceent_uuid); + + /* Run fwrite() and return the result. */ + aclunix_tobendian((struct _ent *)&fent); + s = fwrite(&fent, sizeof(struct _fileent_v1), 1, + handle->aclunix_handle_desc); + if ( s < 1 ) + { + return 1; + } + aclunix_tobendian((struct _ent *)&aent); + s = fwrite(&aent, sizeof(struct _aceent_v1), 1, + handle->aclunix_handle_desc); + if ( s < 1 ) + { + return 1; + } + + /* Rewind the stream. */ + rewind(handle->aclunix_handle_desc); + + /* Return success to caller. */ + return 0; + } + + TEKLTI_DECLSPEC aclunix_handle * aclunix_opendesc ( const char * dirname, *************** TEKLTI_DECLSPEC aclunix_handle * aclunix *** 395,398 **** --- 453,464 ---- return NULL; } + + if ( aclunix_prepnewdesc(retval) ) + { + fclose(retval->aclunix_handle_desc); + free(retval); + unlink(tmpdesc); + return NULL; + } } else { /* No other option available but to bail out. */ *************** TEKLTI_DECLSPEC int aclunix_getacl_extin *** 482,486 **** #ifdef HAVE_FSEEKO ! TEKLTI_DECLSPEC int aclunix_acecount ( aclunix_handle * handle, aclunix_aclheader * acl, --- 548,552 ---- #ifdef HAVE_FSEEKO ! static int aclunix_privacecount ( aclunix_handle * handle, aclunix_aclheader * acl, *************** TEKLTI_DECLSPEC int aclunix_acecount ( *** 494,498 **** off_t _nextace; #else /* not HAVE_FSEEKO */ ! TEKLTI_DECLSPEC int aclunix_acecount ( aclunix_handle * handle, aclunix_aclheader * acl, --- 560,564 ---- off_t _nextace; #else /* not HAVE_FSEEKO */ ! static int aclunix_privacecount ( aclunix_handle * handle, aclunix_aclheader * acl, *************** TEKLTI_DECLSPEC int aclunix_acecount ( *** 551,557 **** } ! return 0; AceCountPass: /* Let's pull the first ACE location out of the descriptor. */ if ( file1._fileent_first_aceloc == 0 ) --- 617,626 ---- } ! /* The ACL was not found. */ ! return -1; AceCountPass: + /* Let's put the flags into the caller's structure. */ + acl->aclunix_aclheader_flags = file1._fileent_flags; /* Let's pull the first ACE location out of the descriptor. */ if ( file1._fileent_first_aceloc == 0 ) *************** AceCountPass: *** 592,596 **** if ( retval != NULL ) { ! if ( retval[_numaces]->aclunix_aceheader_uid != 0 ) { retval[_numaces]->aclunix_aceheader_uid = --- 661,665 ---- if ( retval != NULL ) { ! if ( ace1._aceent_uid != 0 ) { retval[_numaces]->aclunix_aceheader_uid = *************** AceCountEmpty: *** 631,634 **** --- 700,787 ---- + #ifdef HAVE_FSEEKO + TEKLTI_DECLSPEC int aclunix_acecount ( + aclunix_handle * handle, + aclunix_aclheader * acl, + uint64_t * numaces, + aclunix_aceheader ** retval, + off_t * lastace, + off_t * nextace + ) + { + #else /* not HAVE_FSEEKO */ + TEKLTI_DECLSPEC int aclunix_acecount ( + aclunix_handle * handle, + aclunix_aclheader * acl, + uint64_t * numaces, + aclunix_aceheader ** retval, + long int * lastace, + long int * nextace + ) + { + #endif /* not HAVE_FSEEKO */ + int retval2; + uint64_t i; + uid_t u; + + /* Run our private function. */ + retval2 = aclunix_privacecount( + handle, acl, numaces, retval, lastace, nextace + ); + /* Bail out on error. */ + if ( retval2 == 0 ) + return 0; + if ( retval2 == -1 ) + return 0; + + /* Flip through the ACEs to see if the user has access to + read the ACL list. */ + if ( ( *numaces > 0 ) && ( retval != NULL ) ) + { + u = getuid(); + + for ( i=0; i < *numaces; i++ ) + { + if ( retval[i]->aclunix_aceheader_uid == u ) + { + if ( retval[i]->aclunix_aceheader_perms + && TEKFILE_PRIVILEGE_READACL ) + { + return retval2; + } + } + } + } + + /* If we're here, access to read the ACL was denied. */ + /* Let's check for inheritance possibility. */ + if ( acl->aclunix_aclheader_flags & aclunix_fileflag_inherit ) + { + /* We'll run the accesscheck() function. */ + switch ( aclunix_accesscheck(".", NULL, + TEKFILE_PRIVILEGE_READACL) ) + { + case -1: + /* Fatal error. */ + return 0; + case 0: + /* Access denied. */ + break; + default: + /* Access granted. */ + return retval2; + } + } + + /* Access is still denied. We'll just have to bail out. */ + /* Clear the aceheaders from memory. */ + if ( retval != NULL ) + for ( i=0; i < *numaces; i++ ) + memset(retval[i], '\0', sizeof(aclunix_aceheader)); + /* Return access denied to caller. */ + return -1; + } + + TEKLTI_DECLSPEC int aclunix_writeace ( aclunix_handle * handle, *************** TEKLTI_DECLSPEC int aclunix_writeace ( *** 670,677 **** /* Find the last ACE element. */ ! if ( !aclunix_acecount(handle, acl, &numaces, NULL, &lastace, &nextace) ) { ! return 0; } --- 823,838 ---- /* Find the last ACE element. */ ! switch ( aclunix_acecount(handle, acl, &numaces, NULL, &lastace, &nextace) ) { ! case 0: ! /* acecount() failed. */ ! return 0; ! case -1: ! /* access denied. */ ! return -1; ! default: ! /* write ACL access granted. */ ! break; } *************** TEKLTI_DECLSPEC int aclunix_writenewdesc *** 795,798 **** --- 956,965 ---- long int cur2; #endif /* not HAVE_FSEEKO */ + char cwdstr[512]; + + /* Get the cwd. */ + if ( getcwd(cwdstr, 256) == NULL ) + return -1; + strcat(cwdstr, "/"); #ifndef NO_SIZE_T_CHECKS *************** TEKLTI_DECLSPEC int aclunix_writenewdesc *** 807,810 **** --- 974,996 ---- return 0; + switch ( aclunix_accesscheck( + strcat(cwdstr, newacl->aclunix_aclheader_filename), NULL, + TEKFILE_PRIVILEGE_WRITEACL) ) + { + case -1: + /* accesscheck() failed. */ + return 0; + case 0: + /* Access denied. */ + return -1; + default: + /* Access granted. */ + break; + } + + /* Make sure the descriptor doesn't already exist. */ + if ( aclunix_getacl_extinfo(handle, newacl) == 1 ) + return 0; + /* Rewind the stream. */ if ( !aclunix_rewind(handle) ) *************** TEKLTI_DECLSPEC int aclunix_writenewdesc *** 991,992 **** --- 1177,1655 ---- } + + static inline void aclunix_fryacearray ( + aclunix_aceheader ** acearray, + uint64_t acecount + ) + { + uint64_t i; + + /* Make sure we don't touch an empty array. */ + if ( acecount == 0 ); + return; + + /* Free the elements in the array. */ + for ( i=0; i < acecount; i++ ) + free(acearray[i]); + /* Free the array itself. */ + free((void *)acearray); + } + + + TEKLTI_DECLSPEC void aclunix_freeacearray ( + aclunix_aceheader ** acearray, + uint64_t acecount + ) + { + uint64_t i; + + /* Make sure we don't touch an empty array. */ + if ( acecount == 0 ); + return; + + /* Free the elements in the array. */ + for ( i=0; i < acecount; i++ ) + free(acearray[i]); + /* Free the array itself. */ + free((void *)acearray); + } + + + #ifdef UNICODE + static int aclunix_findunicodefile ( + aclunix_handle * hacl, + const wchar_t * filename, + struct aclunix_aclheader * newacl, + struct aclunix_aceheader *** newacearray + ) + { + #ifndef NO_SIZE_T_CHECKS + if ( filename == NULL ) + return 1; + #endif /* NO_SIZE_T_CHECKS */ + + return 0; + } + #endif /* UNICODE */ + + + static int aclunix_privfindfile ( + aclunix_handle * hacl, + const char * filename, + aclunix_aclheader * newacl, + aclunix_aceheader *** newacearray, + uint64_t * acecount + ) + { + aclunix_aceheader ** acehdr; + uint64_t numaces; + uint64_t i; + + /* Set up the ACL Header. */ + memset(newacl, '\0', sizeof(aclunix_aclheader)); + strcpy(newacl->aclunix_aclheader_filename, filename); + + /* Count up the ACEs. */ + switch ( aclunix_privacecount(hacl, newacl, &numaces, NULL, NULL, NULL) ) + { + case 0: + return 1; + case -1: + return -1; + default: + break; + } + + if ( numaces > 0 ) + { + /* malloc() the array. */ + acehdr = (aclunix_aceheader **)calloc( + numaces, + sizeof(aclunix_aceheader **) + ); + if ( acehdr == NULL ) + return 1; + /* Allocate the buffers onto the ptr buf. */ + for ( i=0; i < numaces; i++ ) + { + acehdr[i] = (aclunix_aceheader *) + calloc(sizeof(aclunix_aceheader), 1); + if ( acehdr[i] == NULL ) + { + aclunix_fryacearray(acehdr, i); + return 1; + } + } + /* Retrieve a copy of the ACEs. */ + switch ( aclunix_privacecount( + hacl, newacl, &numaces, acehdr, NULL, NULL) ) + { + case 0: + case -1: + aclunix_fryacearray(acehdr, i); + return 1; + default: + break; + } + + /* Put the ACEHeader pointer into the retval. */ + *newacearray = acehdr; + } + + /* Set up the ace count and return to caller. */ + *acecount = numaces; + return 0; + } + + + #define ACLUNIX_OWNERPERMS_DEFAULT 0x0000000000000000 + #define ACLUNIX_GROUPPERMS_DEFAULT 0x0000000000000000 + #define ACLUNIX_ALLPERMS_DEFAULT 0x0000000000000000 + + #define ACLUNIX_FILE_PERM_NONE 0x0000000000000000 + #define ACLUNIX_FILE_PERM_READ 0x0000000000000001 + #define ACLUNIX_FILE_PERM_WRITE 0x0000000000000002 + + + static int aclunix_findfile ( + const char * filename, + aclunix_aclheader * newacl, + aclunix_aceheader *** newacearray, + uint64_t * acecount, + char * dirfound + ) + { + aclunix_handle * priv_handle; + char * path_env; + char * path_env2; + char * path_env3; + char * filnam_f; + char * filnam_p; + char * filnam; + + /* We need to duplicate the string first. */ + filnam = strdup(filename); + if ( filnam == NULL ) + return 0; + + /* Next, we need to pluck out the filename w/o dir */ + if ( ( filnam_f = strrchr(filnam, '/') ) == NULL ) + filnam_f = filnam; + else + filnam_f++; + + /* Determine if we should start looking in the past directories + or the environment variable PATH. */ + if ( strchr(filename, '/') != NULL ) + { + /* Let's look into the past directories. */ + while ( ( filnam_p = strrchr(filnam, '/') ) != NULL ) + { + /* If the both of these are equal, EOS. */ + if ( filnam_p == filnam ) + break; + + /* Put a NULL char in the filnam_p location. */ + *filnam_p = '\0'; + + /* Try to open the descriptor in the filnam. */ + priv_handle = aclunix_opendesc(filnam, 0); + if ( priv_handle == NULL ) + continue; + + /* Go look for the file. */ + if ( aclunix_privfindfile( + priv_handle, ".", newacl, + newacearray, acecount) + == 0 ) + { + /* We found the file's descriptor. */ + aclunix_closedesc(priv_handle); + strcpy(dirfound, filnam); + free(filnam); + return 1; + } + + /* Close the descriptor and try the next PATH. */ + aclunix_closedesc(priv_handle); + path_env2 = path_env3; + } + + /* Try to open the descriptor in the root directory. */ + priv_handle = aclunix_opendesc("/", 0); + if ( priv_handle != NULL ) + { + /* Go look for the file. */ + if ( aclunix_privfindfile( + priv_handle, ".", newacl, + newacearray, acecount) + == 0 ) + { + /* We found the file's descriptor. */ + aclunix_closedesc(priv_handle); + free(filnam); + dirfound[0] = '/'; + dirfound[1] = '\0'; + return 1; + } + } + + /* Close the descriptor and go to end of function. */ + aclunix_closedesc(priv_handle); + } else { + /* Let's try the $PWD directory's descriptor first. */ + filnam_p = (char *)alloca(PATH_MAX); + + /* Obtain the current working directory. */ + if ( getcwd(filnam_p, PATH_MAX) == NULL ) + { + free(filnam); + return 0; + } + + /* Attempt to open the descriptor. */ + priv_handle = aclunix_opendesc(filnam_p, 0); + if ( priv_handle == NULL ) + { + free(filnam); + return 0; + } + + /* Go look for the file. */ + if ( aclunix_privfindfile( + priv_handle, filnam_f, newacl, newacearray, acecount) + == 0 ) + { + /* We found the directory's descriptor. */ + aclunix_closedesc(priv_handle); + strcpy(dirfound, filnam_p); + free(filnam); + return 1; + } + + /* Close the descriptor. */ + aclunix_closedesc(priv_handle); + + /* Let's go get the PATH environment variable. */ + path_env = getenv("PATH"); + if ( path_env == NULL ) + { + free(filnam); + return 0; + } + + /* Duplicate the path_env. */ + path_env = strdup(path_env); + if ( path_env == NULL ) + { + free(filnam); + return 0; + } + + /* Enter the path environment loop. */ + path_env2 = path_env; + while ( ( path_env3 = strchr(path_env2, ':') ) != NULL ) + { + /* Set a NULL in the string. */ + *path_env3 = '\0'; + path_env3++; + + /* Try to open the descriptor in the path_env2. */ + priv_handle = aclunix_opendesc(path_env2, 0); + if ( priv_handle == NULL ) + continue; + + /* Go look for the file. */ + if ( aclunix_privfindfile( + priv_handle, filnam_f, newacl, + newacearray, acecount) + == 0 ) + { + /* We found the directory's descriptor. */ + aclunix_closedesc(priv_handle); + strcpy(dirfound, path_env2); + free(filnam); free(path_env); + return 1; + } + + /* Close the descriptor and try the next PATH. */ + aclunix_closedesc(priv_handle); + path_env2 = path_env3; + } + + /* Try to open the descriptor in the last path_env2. */ + priv_handle = aclunix_opendesc(path_env2, 0); + if ( priv_handle == NULL ) + { + aclunix_closedesc(priv_handle); + free(filnam); free(path_env); + return 0; + } + + /* Go look for the file. */ + if ( aclunix_privfindfile( + priv_handle, filnam_f, newacl, + newacearray, acecount) + == 0 ) + { + /* We found the directory's descriptor. */ + aclunix_closedesc(priv_handle); + strcpy(dirfound, filnam); + free(filnam); free(path_env); + return 1; + } + + /* Close the descriptor and try the next PATH. */ + aclunix_closedesc(priv_handle); + free(path_env); + } + + /* If we're here, the function failed. */ + free(filnam); + return 0; + } + + + TEKLTI_DECLSPEC int aclunix_accesscheck ( + const char * filename, + const void * filename_unicode, + uint64_t permsneeded + ) + { + aclunix_aceheader ** ace; + aclunix_aclheader acl; + uid_t usertocheck; + gid_t * grpsettocheck; + int grpsetcount; + gid_t grptocheck; + uint64_t acecount; + uint64_t i; + char * dirfound; + char * dirfound_r; + int j; + + /* If the current user is the owner, access is okay. */ + if ( filename != NULL ) + if ( aclunix_isowner(filename) ) + return 1; + + /* Set up the dirfound string array. */ + dirfound = alloca(256 * sizeof(char)); + if ( dirfound == NULL ) + return -1; + + /* Let's check to see if we should look up the file by its + Unicode filename. */ + if ( filename_unicode != NULL ) + { + #ifdef UNICODE + /* Look up the file. */ + if ( aclunix_findunicodefile( + (wchar_t *)filename_unicode, + &acl, &ace, &acecount) + == 0 ) + { + return -1; + } + #else /* UNICODE */ + /* If UNICODE is not built into libTekLTI, we + can not use the UNICODE filename. */ + return -1; + #endif /* UNICODE */ + } else { + /* If filename is NULL, there's nothing to do. */ + if ( filename == NULL ) + return -1; + + /* Begin looking for the ASCII filename. */ + /* Look up the file. */ + if ( aclunix_findfile( + filename, &acl, &ace, &acecount, dirfound) + == 0 ) + { + /* Make sure we exit. */ + return -1; + } + } + + /* Get the real UID and GID of the process. */ + usertocheck = getuid(); + grptocheck = getgid(); + /* Get the group info available to the process. */ + grpsetcount = getgroups(0, NULL); + if ( grpsetcount > 0 ) + { + /* Allocate a group set. */ + grpsettocheck = (gid_t *)alloca(grpsetcount * sizeof(gid_t)); + if ( grpsettocheck == NULL ) + return -1; + + if ( getgroups(grpsetcount, grpsettocheck) == 0 ) + return -1; + } + + /* Look for an ACL that's applicable to us. */ + while ( dirfound[0] != '\0' ) + { + /* Look for an ACE that's applicable to us. */ + for ( i=0; i < acecount; i++ ) + { + /* Check for the user permission first. */ + if ( ace[i]->aclunix_aceheader_uid == usertocheck ) + if ( ace[i]->aclunix_aceheader_perms & permsneeded ) + return 1; + /* Check for the primary group permission second. */ + if ( ace[i]->aclunix_aceheader_gid == grptocheck ) + if ( ace[i]->aclunix_aceheader_perms & permsneeded ) + return 1; + /* Check for the secondary (member) groups third. */ + for ( j=0; j < grpsetcount; j++ ) + { + if ( ace[i]->aclunix_aceheader_gid == + grpsettocheck[j] ) + { + if ( ace[i]->aclunix_aceheader_perms & + permsneeded ) + { + return 1; + } + } + } + } + + /* Fry the aces. */ + aclunix_fryacearray(ace, acecount); + + /* Check to see if the acl has inheritance on. */ + if ( acl.aclunix_aclheader_flags & aclunix_fileflag_inherit ) + ; + else + break; + + /* Make sure we're not on "/". */ + if ( dirfound[1] == '\0' ) + break; + + /* Make sure the end of dirfound does not have a '/'. */ + if ( dirfound[strlen(dirfound) - 1] == '/' ) + dirfound[strlen(dirfound) - 1] = '\0'; + + /* Check to see if we need to check the next dir. */ + dirfound_r = strrchr(dirfound, '/'); + if ( dirfound_r == dirfound ) + dirfound[1] = '\0'; + else + *dirfound_r = '\0'; + + /* Go look for the descriptor we're inheriting from. */ + if ( aclunix_findfile( + dirfound, &acl, &ace, &acecount, dirfound) + == 0 ) + { + return -1; + } + } + + return 0; + } + Index: tekltifrm.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekltifrm.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C 2 -d -p -r1.20 -r1.21 *** tekltifrm.cpp 4 Mar 2007 02:29:41 -0000 1.20 --- tekltifrm.cpp 19 Mar 2007 14:41:16 -0000 1.21 *************** static void testdesc() *** 111,185 **** abort(); } - /* Retrieve a copy of the ACEs. */ - if ( !aclunix_acecount(hacl, &aclhdr, &numaces, acehdr2, NULL, NULL) ) - raise(SIGUSR1); - /* Retrieve a copy of the extended information. */ - if ( !aclunix_getacl_extinfo(hacl, &aclhdr) ) - raise(SIGUSR1); - - /* Print out the results. */ - fprintf( - stdout, - "ACL Output for %s\n", - aclhdr.aclunix_aclheader_filename - ); - fprintf( - debugfil, - "ACL Output for %s\n", - aclhdr.aclunix_aclheader_filename - ); - - fprintf( - stdout, - "aclhdr.aclunix_aclheader_flags = %d\n", - aclhdr.aclunix_aclheader_flags - ); - fprintf( - debugfil, - "aclhdr.aclunix_aclheader_flags = %d\n", - aclhdr.aclunix_aclheader_flags - ); ! for ( i=0; i < numaces; i++ ) { fprintf( stdout, ! "acehdr2[%d]->aclunix_aceheader_uid = %u\n", ! i, ! acehdr2[i]->aclunix_aceheader_uid ! ); ! fprintf( ! stdout, ! "acehdr2[%d]->aclunix_aceheader_gid = %u\n", ! i, ! acehdr2[i]->aclunix_aceheader_gid ! ); ! fprintf( ! stdout, ! "acehdr2[%d]->aclunix_aceheader_perms = %.16LX\n", ! i, ! acehdr2[i]->aclunix_aceheader_perms ); fprintf( debugfil, ! "acehdr2[%d]->aclunix_aceheader_uid = %u\n", ! i, ! acehdr2[i]->aclunix_aceheader_uid ); fprintf( ! debugfil, ! "acehdr2[%d]->aclunix_aceheader_gid = %u\n", ! i, ! acehdr2[i]->aclunix_aceheader_gid ); fprintf( debugfil, ! "acehdr2[%d]->aclunix_aceheader_perms = %.16LX\n", ! i, ! acehdr2[i]->aclunix_aceheader_perms ); ! free(acehdr2[i]); ! } /* Write out a blank line. */ --- 111,218 ---- abort(); } ! /* Retrieve a copy of the ACEs. */ ! switch ( ! aclunix_acecount( ! hacl, &aclhdr, &numaces, acehdr2, NULL, NULL) ! ) { + case 0: + raise(SIGUSR1); + break; + case 1: + /* Retrieve a copy of the extended information. */ + if ( !aclunix_getacl_extinfo(hacl, &aclhdr) ) + raise(SIGUSR1); + /* Print out the results. */ fprintf( stdout, ! "ACL Output for %s\n", ! aclhdr.aclunix_aclheader_filename ); fprintf( debugfil, ! "ACL Output for %s\n", ! aclhdr.aclunix_aclheader_filename ); + fprintf( ! stdout, ! "aclhdr.aclunix_aclheader_flags = %d\n", ! aclhdr.aclunix_aclheader_flags ); fprintf( debugfil, ! "aclhdr.aclunix_aclheader_flags = %d\n", ! aclhdr.aclunix_aclheader_flags ); ! for ( i=0; i < numaces; i++ ) ! { ! fprintf( ! stdout, ! "acehdr2[%d]->aclunix_aceheader_uid = %u\n", ! i, ! acehdr2[i]->aclunix_aceheader_uid ! ); ! fprintf( ! stdout, ! "acehdr2[%d]->aclunix_aceheader_gid = %u\n", ! i, ! acehdr2[i]->aclunix_aceheader_gid ! ); ! fprintf( ! stdout, ! "acehdr2[%d]->aclunix_aceheader_perms = %.16LX\n", ! i, ! acehdr2[i]->aclunix_aceheader_perms ! ); ! fprintf( ! debugfil, ! "acehdr2[%d]->aclunix_aceheader_uid = %u\n", ! i, ! acehdr2[i]->aclunix_aceheader_uid ! ); ! fprintf( ! debugfil, ! "acehdr2[%d]->aclunix_aceheader_gid = %u\n", ! i, ! acehdr2[i]->aclunix_aceheader_gid ! ); ! fprintf( ! debugfil, ! "acehdr2[%d]->aclunix_aceheader_perms = %.16LX\n", ! i, ! acehdr2[i]->aclunix_aceheader_perms ! ); ! ! free(acehdr2[i]); ! } ! default: ! /* Retrieve a copy of the extended information. */ ! if ( !aclunix_getacl_extinfo(hacl, &aclhdr) ) ! raise(SIGUSR1); ! /* Print out the results. */ ! fprintf( ! stdout, ! "ACL Output for %s\n", ! aclhdr.aclunix_aclheader_filename ! ); ! fprintf( ! debugfil, ! "ACL Output for %s\n", ! aclhdr.aclunix_aclheader_filename ! ); ! fprintf( ! stdout, ! "aclhdr.aclunix_aclheader_flags = %d\n", ! aclhdr.aclunix_aclheader_flags ! ); ! fprintf( ! debugfil, ! "aclhdr.aclunix_aclheader_flags = %d\n", ! aclhdr.aclunix_aclheader_flags ! ); ! } /* Write out a blank line. */ *************** static void testdesc() *** 187,190 **** --- 220,226 ---- fprintf(debugfil, "\n"); + /* Perform an access check. */ + i = aclunix_accesscheck("/usr/src/tekltifrm", NULL, 1); + /* Close the descriptor and clean up. */ aclunix_closedesc(hacl); Index: teklti.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/teklti.h,v retrieving revision 1.70 retrieving revision 1.71 diff -C 2 -d -p -r1.70 -r1.71 *** teklti.h 11 Mar 2007 05:04:48 -0000 1.70 --- teklti.h 19 Mar 2007 14:41:16 -0000 1.71 *************** typedef unsigned long TEKERR; *** 609,613 **** */ ! // ///// TEKERR CODES BEGIN ///// /** --- 609,613 ---- */ ! /* ///// TEKERR CODES BEGIN ///// */ /** *************** typedef unsigned long TEKERR; *** 734,737 **** --- 734,812 ---- + /* ///// TEKFILE PRIVILEGES BEGIN ///// */ + + /** + * All privileges allowed to the file. + */ + #define TEKFILE_PRIVILEGE_ALL 0x00000000000F11FF + + /** + * No privileges allowed to the file. + */ + #define TEKFILE_PRIVILEGE_NONE 0x0000000000000000 + + /** + * Read file attribute + contents + ACL privilege. + */ + #define TEKFILE_PRIVILEGE_READ 0x000000000000000F + + /** + * Read file attribute privilege. + */ + #define TEKFILE_PRIVILEGE_READATTR 0x0000000000000001 + + /** + * Read file contents privilege. + */ + #define TEKFILE_PRIVILEGE_READCONTENTS 0x0000000000000002 + + /** + * Read file ACL privilege. + */ + #define TEKFILE_PRIVILEGE_READACL 0x0000000000000004 + + /** + * Write file attribute + contents + ACL privilege. + */ + #define TEKFILE_PRIVILEGE_WRITE 0x00000000000000F0 + + /** + * Write file attribute privilege. + */ + #define TEKFILE_PRIVILEGE_WRITEATTR 0x0000000000000010 + + /** + * Write file contents privilege. + */ + #define TEKFILE_PRIVILEGE_WRITECONTENTS 0x0000000000000020 + + /** + * Write file ACL privilege. + */ + #define TEKFILE_PRIVILEGE_WRITEACL 0x0000000000000040 + + /** + * Execute file privilege. + */ + #define TEKFILE_PRIVILEGE_EXECUTE 0x0000000000000100 + + /** + * Take ownership of file privilege. + */ + #define TEKFILE_PRIVILEGE_TAKEOWNERSHIP 0x0000000000001000 + + /** + * Delete file privilege. + */ + #define TEKFILE_PRIVILEGE_DELETE 0x0000000000010000 + + /** + * Create file privilege. + */ + #define TEKFILE_PRIVILEGE_CREATE 0x0000000000020000 + + /* ///// TEKFILE PRIVILEGES CODES END ///// */ + + /* Let's define the variables for the C version of TekStd. */ #ifndef _cplusplus *************** extern int aclunix_writenewdesc ( *** 1327,1330 **** --- 1402,1414 ---- uint32_t ); + extern void aclunix_freeacearray ( + aclunix_aceheader **, + uint64_t + ); + extern int aclunix_accesscheck ( + const char *, + const void *, + uint64_t + ); extern void teklti_erase_userdbline ( char * ); *************** TEKLTI_DECLSPEC int aclunix_writenewdesc *** 1539,1542 **** --- 1623,1635 ---- uint32_t newacelen ); + TEKLTI_DECLSPEC void aclunix_freeacearray ( + aclunix_aceheader ** acearray, + uint64_t acecount + ); + TEKLTI_DECLSPEC int aclunix_accesscheck ( + const char * filename, + const void * filename_unicode, + uint64_t permsneeded + ); TEKLTI_DECLSPEC void teklti_erase_userdbline ( char * line ); |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-18 13:07:15
|
Update of /cvsroot/libteklti/libteklti In directory planetsaphire.com:/tmp/cvs-serv27510 Modified Files: configure.in Log Message: FIX: @RELEASE@ was not defined in configure.in. Index: configure.in =================================================================== RCS file: /cvsroot/libteklti/libteklti/configure.in,v retrieving revision 1.49 retrieving revision 1.50 diff -C 2 -d -p -r1.49 -r1.50 *** configure.in 28 Feb 2007 00:34:52 -0000 1.49 --- configure.in 18 Mar 2007 14:07:08 -0000 1.50 *************** AC_SUBST([TEKLTI_VER_REVISION], 0) *** 53,56 **** --- 53,64 ---- AC_SUBST([TEKLTI_VER_PATCHNO], 6) + # + # Define the RPM release number. This is usually set to 1 + # or the TEKLTI_VER_PATCHNO. + # + + #AC_SUBST([RELEASE], $TEKLTI_VER_PATCHNO) + AC_SUBST([RELEASE], 1) + # |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-18 13:06:11
|
Update of /cvsroot/libteklti/libteklti In directory planetsaphire.com:/tmp/cvs-serv27478 Modified Files: Makefile.am libteklti.spec libteklti.spec.in Log Message: CHANGE: libteklti RPM build now uses bzip2 compression by default. Index: libteklti.spec.in =================================================================== RCS file: /cvsroot/libteklti/libteklti/libteklti.spec.in,v retrieving revision 1.5 retrieving revision 1.6 diff -C 2 -d -p -r1.5 -r1.6 *** libteklti.spec.in 21 Jan 2007 12:40:37 -0000 1.5 --- libteklti.spec.in 18 Mar 2007 14:05:44 -0000 1.6 *************** *** 1,8 **** ! %define name @PACKAGE_NAME@ ! %define version @PACKAGE_VERSION@ ! %define release @TEKLTI_VER_PATCHNO@ %define suexec_caller libteklti %define buildroot /var/tmp/%{name}-%{version}-root ! %define mmn 20050928 #%ifarch ia64 --- 1,8 ---- ! %define name @PACKAGE@ ! %define version @VERSION@ ! %define release @RELEASE@ %define suexec_caller libteklti %define buildroot /var/tmp/%{name}-%{version}-root ! %define mmn 20070318 #%ifarch ia64 *************** Group: System Environment/Libraries *** 19,23 **** Vendor: Kevin McBride <ke...@pl...> Url: http://sourceforge.net/projects/libteklti ! Source: %{name}-%{version}.tar.gz BuildRoot: %{buildroot} BuildPrereq: libstdc++-devel >= 2.96, e2fsprogs-devel >= 1.35 --- 19,23 ---- Vendor: Kevin McBride <ke...@pl...> Url: http://sourceforge.net/projects/libteklti ! Source: %{name}-%{version}.tar.bz2 BuildRoot: %{buildroot} BuildPrereq: libstdc++-devel >= 2.96, e2fsprogs-devel >= 1.35 *************** Prereq: /sbin/chkconfig, /bin/mktemp, / *** 25,33 **** Provides: libteklti = %{version} Requires: e2fsprogs >= 1.35 @WITH_BZIP2_SPEC@ %description libTekLTI (Technical Library Template Interface) is a library intended to implement a new standard for accessing interfaces. It is also written ! entirely from scratch, to favor speed where possible. libTekLTI also provides Creative Commons EAL-4 standards to Linux. --- 25,34 ---- Provides: libteklti = %{version} Requires: e2fsprogs >= 1.35 @WITH_BZIP2_SPEC@ + Requires: rpmlib(PayloadIsBzip2) >= 3.0.5-1 %description libTekLTI (Technical Library Template Interface) is a library intended to implement a new standard for accessing interfaces. It is also written ! entirely from scratch, to favor speed where possible. libTekLTI also provides Creative Commons EAL-4 standards to Linux. *************** entirely from scratch, to favor speed wh *** 45,50 **** provides Creative Commons EAL-4 standards to Linux. ! The libteklti-devel package contains the header files that you ! need to build libraries and programs utilizing libTekLTI. %prep --- 46,51 ---- provides Creative Commons EAL-4 standards to Linux. ! The libteklti-devel package contains the header files that you need ! to build libraries and programs utilizing libTekLTI. %prep *************** rm -rf $RPM_BUILD_ROOT *** 81,84 **** --- 82,86 ---- %defattr(-, root, root) %doc README COPYING COPYING.LIB + /usr/lib/libteklti.so.0 /usr/lib/libteklti.so.0.0.0 Index: libteklti.spec =================================================================== RCS file: /cvsroot/libteklti/libteklti/libteklti.spec,v retrieving revision 1.3 retrieving revision 1.4 diff -C 2 -d -p -r1.3 -r1.4 *** libteklti.spec 21 Jan 2007 12:40:37 -0000 1.3 --- libteklti.spec 18 Mar 2007 14:05:44 -0000 1.4 *************** *** 1,8 **** %define name libteklti %define version 1.0pre7 ! %define release 6 %define suexec_caller libteklti %define buildroot /var/tmp/%{name}-%{version}-root ! %define mmn 20050928 #%ifarch ia64 --- 1,8 ---- %define name libteklti %define version 1.0pre7 ! %define release 1 %define suexec_caller libteklti %define buildroot /var/tmp/%{name}-%{version}-root ! %define mmn 20070318 #%ifarch ia64 *************** Group: System Environment/Libraries *** 19,33 **** Vendor: Kevin McBride <ke...@pl...> Url: http://sourceforge.net/projects/libteklti ! Source: %{name}-%{version}.tar.gz BuildRoot: %{buildroot} BuildPrereq: libstdc++-devel >= 2.96, e2fsprogs-devel >= 1.35 Prereq: /sbin/chkconfig, /bin/mktemp, /bin/rm, /bin/mv, /usr/lib/libuuid.a Provides: libteklti = %{version} ! Requires: e2fsprogs >= 1.35 , bzip2 >= 1.0.3 %description libTekLTI (Technical Library Template Interface) is a library intended to implement a new standard for accessing interfaces. It is also written ! entirely from scratch, to favor speed where possible. libTekLTI also provides Creative Commons EAL-4 standards to Linux. --- 19,34 ---- Vendor: Kevin McBride <ke...@pl...> Url: http://sourceforge.net/projects/libteklti ! Source: %{name}-%{version}.tar.bz2 BuildRoot: %{buildroot} BuildPrereq: libstdc++-devel >= 2.96, e2fsprogs-devel >= 1.35 Prereq: /sbin/chkconfig, /bin/mktemp, /bin/rm, /bin/mv, /usr/lib/libuuid.a Provides: libteklti = %{version} ! Requires: e2fsprogs >= 1.35 , bzip2 >= 1.0.4 ! Requires: rpmlib(PayloadIsBzip2) >= 3.0.5-1 %description libTekLTI (Technical Library Template Interface) is a library intended to implement a new standard for accessing interfaces. It is also written ! entirely from scratch, to favor speed where possible. libTekLTI also provides Creative Commons EAL-4 standards to Linux. *************** entirely from scratch, to favor speed wh *** 45,50 **** provides Creative Commons EAL-4 standards to Linux. ! The libteklti-devel package contains the header files that you ! need to build libraries and programs utilizing libTekLTI. %prep --- 46,51 ---- provides Creative Commons EAL-4 standards to Linux. ! The libteklti-devel package contains the header files that you need ! to build libraries and programs utilizing libTekLTI. %prep *************** rm -rf $RPM_BUILD_ROOT *** 81,84 **** --- 82,86 ---- %defattr(-, root, root) %doc README COPYING COPYING.LIB + /usr/lib/libteklti.so.0 /usr/lib/libteklti.so.0.0.0 Index: Makefile.am =================================================================== RCS file: /cvsroot/libteklti/libteklti/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -C 2 -d -p -r1.14 -r1.15 *** Makefile.am 11 Feb 2007 07:15:41 -0000 1.14 --- Makefile.am 18 Mar 2007 14:05:44 -0000 1.15 *************** dist_noinst_DATA = libteklti.spec COPYIN *** 30,35 **** ! rpm : dist ! rpmbuild -ta $(PACKAGE)-$(VERSION).tar.gz doxygen : --- 30,35 ---- ! rpm : dist-bzip2 ! rpmbuild -ta $(PACKAGE)-$(VERSION).tar.bz2 doxygen : |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-11 23:35:41
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv13557/src Modified Files: dbunixproc.c Log Message: FIX: Removed meaningless statements. Index: dbunixproc.c =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/dbunixproc.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C 2 -d -p -r1.5 -r1.6 *** dbunixproc.c 11 Mar 2007 00:59:28 -0000 1.5 --- dbunixproc.c 11 Mar 2007 23:42:59 -0000 1.6 *************** void teklti_empty_userdbstruct ( struct *** 72,83 **** { /* Destroy the uchar_t's. */ - /*if ( uinfo->TekUserInfo_UserID == 29 ) - __asm__ ( " int $3 " ); - if ( uinfo->TekUserInfo_UserID == 32 ) - __asm__ ( " int $3 " );*/ ucharempty(uinfo->TekUserInfo_Description); ucharempty(uinfo->TekUserInfo_Username); ucharempty(uinfo->TekUserInfo_HomeDir); - ucharempty(uinfo->TekUserInfo_Shell); --- 72,78 ---- *************** int teklti_retrieve_userdbline_results ( *** 128,133 **** line++; } - /*if ( i == 65535 ) - return 1;*/ for ( j=0; j < ((TEKUSERDBUNIX_STDBUFLEN - 1) - i); j++ ) { --- 123,126 ---- *************** int teklti_retrieve_userdbline_results ( *** 139,145 **** line++; } - /*if ( j == ( 65535 - i ) ) - return 1; - i -= j;*/ /* Now, let's process the user id. */ --- 132,135 ---- *************** int teklti_retrieve_userdbline_results ( *** 159,165 **** line++; } - /*if ( j == ( 65535 - i ) ) - return 1; - i -= j;*/ /* Now, let's process the group id. */ --- 149,152 ---- *************** int teklti_retrieve_userdbline_results ( *** 179,185 **** line++; } - /*if ( j == ( 65535 - i ) ) - return 1; - i -= j;*/ /* Let's get the description. */ --- 166,169 ---- *************** int teklti_retrieve_userdbline_results ( *** 215,221 **** line++; } - /*if ( j == ( 65535 - i ) ) - return 1; - i -= j;*/ uinfo->TekUserInfo_Shell = char2uchar(line); --- 199,202 ---- *************** int teklti_process_userdbline ( char * l *** 376,399 **** if ( *line == '\0' ) { ! /* If we are at the end of the buffer, we're done. */ ! if ( i == ( TEKUSERDBUNIX_STDBUFLEN - 2 ) ) ! goto Proc_UserDBLine_Test_j; ! ! /* Increment the line. */ ! line++; ! /* Check to see if we reached the end of read. */ ! if ( *line == '\0' ) ! { ! Proc_UserDBLine_Test_j: ! /* Check to see if the line is valid. */ ! /* If it's invalid, the db is corrupt. */ ! if ( j < 6 ) ! return 1; ! ! return 0; ! } ! /* Reset j. */ ! j = 0; } --- 357,366 ---- if ( *line == '\0' ) { ! /* Check to see if the line is valid. */ ! /* If it's invalid, the db is corrupt. */ ! if ( j < 6 ) ! return 1; ! return 0; } |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-11 23:32:47
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv5703/src Modified Files: TekFileASCIIBare.386.cpp Log Message: FIX: Refactored asm code in ReadLine(). Index: TekFileASCIIBare.386.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileASCIIBare.386.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C 2 -d -p -r1.14 -r1.15 *** TekFileASCIIBare.386.cpp 11 Mar 2007 13:14:04 -0000 1.14 --- TekFileASCIIBare.386.cpp 11 Mar 2007 23:40:00 -0000 1.15 *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 404,407 **** --- 404,413 ---- /* Put asciilen into %ebx. */ __asm__ ( " movl %ecx, %ebx " ); + /* and into esp, in case fseek() needs to be called. */ + /* Negate ecx first. */ + __asm__ ( " negl %ecx " ); + /* Then put it in esp. */ + __asm__ ( " movl %ecx, 4(%esp) " ); + /* Put ReadMax into eax. */ __asm__ ( " movl 16(%ebp), %ecx " ); *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 417,421 **** /* Check to see if we have already read the last bit. */ __asm__ ( " testl %ebx, %ebx " ); ! /* If we have, we need to bail out of this loop. */ __asm__ ( " je .FileASCIIBare_ReadLine_readmax_bailout3 " ); --- 423,427 ---- /* Check to see if we have already read the last bit. */ __asm__ ( " testl %ebx, %ebx " ); ! /* If we have, we need to re-read the buffer. */ __asm__ ( " je .FileASCIIBare_ReadLine_readmax_bailout3 " ); *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 437,445 **** __asm__ ( " jmp .FileASCIIBare_ReadLine_readmax_bailout " ); /* This label is used to bail out of the ReadMax loop. */ __asm__ ( " .FileASCIIBare_ReadLine_readmax_bailout2: " ); - /* This label is also used to bail out of the ReadMax loop. */ __asm__ ( " .FileASCIIBare_ReadLine_readmax_bailout3: " ); /* Restore private value's string pointer. */ #ifdef UNICODE --- 443,452 ---- __asm__ ( " jmp .FileASCIIBare_ReadLine_readmax_bailout " ); + /* This label is used to bail out of the ReadMax loop. */ __asm__ ( " .FileASCIIBare_ReadLine_readmax_bailout2: " ); /* This label is also used to bail out of the ReadMax loop. */ __asm__ ( " .FileASCIIBare_ReadLine_readmax_bailout3: " ); + /* Restore private value's string pointer. */ #ifdef UNICODE *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 457,462 **** #endif /* UNICODE */ - /* Restore %ebx from %esp+12. */ - __asm__ ( " movl 12(%esp), %ebx " ); #ifdef USE_386_ASM_ENFORCE_PRIVACY --- 464,467 ---- *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 469,476 **** /* Fry the buffer. */ __asm__ ( " rep stosl " ); ! #endif /* not USE_386_ASM_ENFORCE_PRIVACY */ /* Set %ecx to TEKERR_FILE_EOF. */ ! __asm__ ( " movl %1, %%eax " : "=m" (_tfbtmp) : "i" (TEKERR_FILE_EOF) ); /* Jump to cleanup area. */ __asm__ ( " jmp .FileASCIIBare_ReadLine_ret " ); --- 474,525 ---- /* Fry the buffer. */ __asm__ ( " rep stosl " ); ! /* We need to restore eax. */ ! __asm__ ( " movl 8(%ebp), %eax " ); ! #endif /* USE_386_ASM_ENFORCE_PRIVACY */ ! ! /* Check to see if we need to call fseek(). */ ! __asm__ ( " testl %ebx, %ebx " ); ! /* Test the result; jump if necessary. */ ! __asm__ ( " jne .FileASCIIBare_ReadLine_readmax_nofseek " ); ! ! ! #ifdef UNICODE ! /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 596(%eax), %ecx " ); ! #else /* UNICODE */ ! /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 588(%eax), %ecx " ); ! #endif /* UNICODE */ ! /* Put the FILE * onto the stack. */ ! __asm__ ( " movl %ecx, 8(%esp) " ); ! /* Put SEEK_CUR onto the stack. */ ! __asm__ ( " movl %1, (%%esp) " ! : "=m" (_tfbtmp) : "i" (SEEK_CUR) ); ! /* Call fseek(). */ ! __asm__ ( " call fseek " ); ! /* Test the retval. */ ! __asm__ ( " testl %eax, %eax " ); ! /* Jump if fseek() succeeded. */ ! __asm__ ( " je .FileASCIIBare_ReadLine_readmax_fseekok " ); ! /* If we didn't jump, then fseek() failed. */ ! /* Restore %ebx from %esp+12. */ ! __asm__ ( " movl 12(%esp), %ebx " ); ! /* Report error to caller. */ ! __asm__ ( " movl %1, %%eax " ! : "=m" (_tfbtmp) : "i" (TEKERR_FAIL) ); ! /* Jump to cleanup area. */ ! __asm__ ( " jmp .FileASCIIBare_ReadLine_ret " ); ! /* This label is used when fseek() succeeds. */ ! __asm__ ( " .FileASCIIBare_ReadLine_readmax_fseekok: " ); ! ! ! /* This label is used when we don't need to call fseek(). */ ! __asm__ ( " .FileASCIIBare_ReadLine_readmax_nofseek: " ); ! ! /* Restore %ebx from %esp+12. */ ! __asm__ ( " movl 12(%esp), %ebx " ); /* Set %ecx to TEKERR_FILE_EOF. */ ! TEKLTI_RETVAL_TEKERR_OK /* Jump to cleanup area. */ __asm__ ( " jmp .FileASCIIBare_ReadLine_ret " ); |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-11 13:06:49
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv21657/src Modified Files: TekFileASCIIBare.386.cpp Log Message: FIX: Ordinary 386 code missing counter in constructor. Index: TekFileASCIIBare.386.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileASCIIBare.386.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C 2 -d -p -r1.13 -r1.14 *** TekFileASCIIBare.386.cpp 11 Mar 2007 12:31:11 -0000 1.13 --- TekFileASCIIBare.386.cpp 11 Mar 2007 13:14:04 -0000 1.14 *************** teklti::FileASCIIBare::FileASCIIBare() *** 127,130 **** --- 127,135 ---- /* Set ax = 0. */ __asm__ ( " xorl %eax, %eax " ); + #ifdef UNICODE + __asm__ ( " movl $12, %ecx " ); + #else /* not UNICODE */ + __asm__ ( " movl $9, %ecx " ); + #endif /* not UNICODE */ /* Add 112 to edi for alignment with our private members. */ |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-11 12:28:02
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv4963 Modified Files: uchar.386.c uchar.c Log Message: TEMPORARY FIX: 386 asm version of uchardup() needs reordering. Index: uchar.386.c =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/uchar.386.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C 2 -d -p -r1.5 -r1.6 *** uchar.386.c 29 Oct 2005 17:12:15 -0000 1.5 --- uchar.386.c 11 Mar 2007 12:35:09 -0000 1.6 *************** static const char _char2uchar_srcnull[] *** 39,42 **** --- 39,48 ---- + #endif /* USE_386_ASM */ + + #ifdef UCHARDUP_SAFE + /** + * FIXME: This function keeps crashing the system malloc() and free(). + */ TEKLTI_DECLSPEC uchar_t * uchardup ( const uchar_t * src ) { *************** TEKLTI_DECLSPEC uchar_t * uchardup ( con *** 152,157 **** --- 158,166 ---- return; } + #endif /* UCHARDUP_SAFE */ + #ifdef USE_386_ASM + TEKLTI_DECLSPEC uchar_t * char2ucharlen ( const char * src, size_t len ) { Index: uchar.c =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/uchar.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C 2 -d -p -r1.3 -r1.4 *** uchar.c 29 Oct 2005 17:12:15 -0000 1.3 --- uchar.c 11 Mar 2007 12:35:09 -0000 1.4 *************** static const char char2uchar_srcnull[] = *** 36,40 **** static const char ucharempty_uchrtofreenull[] = "POTENTIAL SEGFAULT in ucharfree: uchrtofree is NULL!\n"; #endif /* DEBUG_USE_FERROR */ ! #ifndef USE_386_ASM --- 36,45 ---- static const char ucharempty_uchrtofreenull[] = "POTENTIAL SEGFAULT in ucharfree: uchrtofree is NULL!\n"; #endif /* DEBUG_USE_FERROR */ ! ! ! /* #ifndef USE_386_ASM */ ! /* ! * FIXME: The assembly function is broken at the moment. ! */ *************** TEKLTI_DECLSPEC uchar_t * uchardup ( con *** 80,83 **** --- 85,90 ---- + #ifndef USE_386_ASM + TEKLTI_DECLSPEC uchar_t * char2ucharlen ( const char * src, size_t len ) { |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-11 12:24:14
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv4790 Modified Files: TekFileASCIIBare.386.cpp Log Message: CHANGE: Refactored assembly instructions. Index: TekFileASCIIBare.386.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileASCIIBare.386.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C 2 -d -p -r1.12 -r1.13 *** TekFileASCIIBare.386.cpp 11 Mar 2007 05:04:47 -0000 1.12 --- TekFileASCIIBare.386.cpp 11 Mar 2007 12:31:11 -0000 1.13 *************** teklti::FileASCIIBare::FileASCIIBare() *** 86,160 **** __asm__ ( " movq %0, %%mm7 " : "=m" (tekzerovar) ); #endif /* USE_386_ASM_MMX_RESET_MM7 */ /* Obtain our private section of local variables. */ __asm__ ( " movl 8(%ebp), %ecx " ); #ifdef UNICODE /* Copy the null quadword to the ascii variables. */ ! __asm__ ( " movq %mm7, 112(%ecx) " ); /* Copy the null quadword to the unicode variables. */ ! __asm__ ( " movq %mm7, 120(%ecx) " ); ! /* then into PrivFileDesc/PrivFileMode */ ! __asm__ ( " movq %mm7, 128(%ecx) " ); /* and finally into PrivTekFileType. */ ! __asm__ ( " movl %1, 136(%%ecx) " : "=m" (_tfbtmp) : "i" (TekFileType_ASCII) ); #else /* not UNICODE */ ! /* Copy the null quadword to the ascii variables. */ ! __asm__ ( " movq %mm7, 112(%ecx) " ); /* then into PrivFileDesc/PrivFileMode */ ! __asm__ ( " movq %mm7, 120(%ecx) " ); /* and finally into PrivTekFileType. */ ! __asm__ ( " movl %1, 128(%%ecx) " : "=m" (_tfbtmp) : "i" (TekFileType_ASCII) ); ! #endif /* not UNICODE */ ! ! /* Run malloc(TEKFILEASCII_STDBUFLEN) */ ! /* Make sure ecx can be saved. */ ! __asm__ ( " subl $8, %esp " ); ! /* FIXME: Possible duplicate instruction, */ ! /* Set the TekBufferLen to zero. */ ! __asm__ ( " movd %mm7, 136(%ecx) " ); ! /* Save ecx. */ ! __asm__ ( " movl %ecx, 4(%esp) " ); ! /* Put TEKFILEASCII_STDBUFLEN on the stack as param 0 of malloc(). */ ! __asm__ ( " movl %1, (%%esp) " : "=m" (_tfbtmp) : "i" (TEKFILEASCII_STDBUFLEN) ); ! /* Call malloc(). */ ! __asm__ ( " call malloc " ); ! /* Restore %ecx. */ ! __asm__ ( " movl 4(%esp), %ecx " ); ! /* Restore the stack. */ ! __asm__ ( " addl $8, %esp " ); ! ! /* Test result of %eax. */ ! __asm__ ( " testl %eax, %eax " ); ! /* Check to see what to do. */ ! __asm__ ( " je tekfileasciibare_dummyreturn " ); ! /* FIXME: Needs to become UNICODE ready. */ ! /* Put %eax into the private value. */ ! __asm__ ( " movl %eax, 132(%ecx) " ); ! ! /* Copy the null dword to the ascii length var of PrivBuffer. */ ! /* FIXME: Possible duplicate instruction, */ ! __asm__ ( " movd %mm7, 136(%ecx) " ); ! #ifdef UNICODE ! /* Copy the null quadword to the unicode variables. */ ! __asm__ ( " movq %mm7, 140(%ecx) " ); ! /* Put %eax into the private value pointer. */ ! __asm__ ( " movl %eax, 148(%ecx) " ); ! /* Copy the null dword to the ascii length var of PrivBufferPtr. */ ! /* NOTE: Commented out, zeroing not necessary at this time. */ ! /* __asm__ ( " movd %mm7, 152(%ecx) " ); */ ! /* Copy the null quadword to the unicode variables. */ ! __asm__ ( " movq %mm7, 160(%ecx) " ); ! #else /* not UNICODE */ ! /* Put %eax into the private value pointer. */ ! __asm__ ( " movl %eax, 140(%ecx) " ); ! __asm__ ( " movl %eax, 144(%ecx) " ); ! /* Copy the null dword to the ascii length var of PrivBufferPtr. */ ! /* NOTE: Commented out, zeroing not necessary at this time. */ ! /* __asm__ ( " movd %mm7, 144(%ecx) " ); */ #endif /* not UNICODE */ /* Be sure to exit the mmx state before leaving. */ __asm__ ( " emms " ); - #else /* not USE_386_ASM_MMX */ /* If we're here, we are not using mmx. */ --- 86,119 ---- __asm__ ( " movq %0, %%mm7 " : "=m" (tekzerovar) ); #endif /* USE_386_ASM_MMX_RESET_MM7 */ + /* Obtain our private section of local variables. */ __asm__ ( " movl 8(%ebp), %ecx " ); #ifdef UNICODE + /* PrivFileName */ /* Copy the null quadword to the ascii variables. */ ! __asm__ ( " movq %mm7, 580(%ecx) " ); /* Copy the null quadword to the unicode variables. */ ! __asm__ ( " movq %mm7, 588(%ecx) " ); ! /* Copy the null quadword into PrivFileDesc/PrivFileMode */ ! __asm__ ( " movq %mm7, 596(%ecx) " ); /* and finally into PrivTekFileType. */ ! __asm__ ( " movq %mm7, 604(%ecx) " ); ! /* Copy over the remaining variables. */ ! __asm__ ( " movq %mm7, 612(%ecx) " ); ! __asm__ ( " movq %mm7, 620(%ecx) " ); #else /* not UNICODE */ ! /* Copy the null quadword to the ascii of PrivFileName. */ ! __asm__ ( " movq %mm7, 580(%ecx) " ); /* then into PrivFileDesc/PrivFileMode */ ! __asm__ ( " movq %mm7, 588(%ecx) " ); /* and finally into PrivTekFileType. */ ! __asm__ ( " movq %mm7, 596(%ecx) " ); ! __asm__ ( " movq %mm7, 604(%ecx) " ); ! __asm__ ( " movl $0, 612(%ecx) " ); #endif /* not UNICODE */ /* Be sure to exit the mmx state before leaving. */ __asm__ ( " emms " ); #else /* not USE_386_ASM_MMX */ /* If we're here, we are not using mmx. */ *************** teklti::FileASCIIBare::FileASCIIBare() *** 163,167 **** __asm__ ( " pushl %edi " ); #endif /* USE_386_ASM_PUSHPOP */ - /* Obtain our private section of local variables. */ __asm__ ( " movl 8(%ebp), %edi " ); --- 122,125 ---- *************** teklti::FileASCIIBare::FileASCIIBare() *** 171,202 **** /* Add 112 to edi for alignment with our private members. */ ! __asm__ ( " addl $112, %edi " ); ! ! /* Set up ecx as appropriate. */ ! #ifdef UNICODE ! __asm__ ( " movl $6, %ecx " ); ! #else /* not UNICODE */ ! __asm__ ( " movl $4, %ecx " ); ! #endif /* not UNICODE */ /* Call the stosl function until the area in edi is nullified. */ __asm__ ( " rep stosl " ); - /* Set up the FileType value. */ - __asm__ ( " movl %1, (%%edi) " : "=m" (_tfbtmp) : "i" (TekFileType_ASCII) ); /* Run malloc(TEKFILEASCII_STDBUFLEN) */ - /* Make sure edi is saved. */ - __asm__ ( " subl $8, %esp " ); - /* Save edi. */ - __asm__ ( " movl %edi, 4(%esp) " ); /* Put TEKFILEASCII_STDBUFLEN on the stack as param 0 of malloc(). */ ! __asm__ ( " movl %1, (%%esp) " : "=m" (_tfbtmp) : "i" (TEKFILEASCII_STDBUFLEN) ); /* Call malloc(). */ __asm__ ( " call malloc " ); ! /* Restore %edi. */ ! __asm__ ( " movl 4(%esp), %edi " ); /* Restore the stack. */ ! __asm__ ( " addl $8, %esp " ); /* Test result of %eax. */ --- 129,152 ---- /* Add 112 to edi for alignment with our private members. */ ! __asm__ ( " addl $580, %edi " ); /* Call the stosl function until the area in edi is nullified. */ __asm__ ( " rep stosl " ); + #endif /* not USE_386_ASM_MMX */ + + /********************************************* + * BOTH MMX AND REGULAR FORKS INTERSECT HERE * + *********************************************/ /* Run malloc(TEKFILEASCII_STDBUFLEN) */ /* Put TEKFILEASCII_STDBUFLEN on the stack as param 0 of malloc(). */ ! __asm__ ( " pushl %1 " : "=m" (_tfbtmp) : "i" (TEKFILEASCII_STDBUFLEN) ); /* Call malloc(). */ __asm__ ( " call malloc " ); ! /* Obtain our private section of local variables. (again) */ ! __asm__ ( " movl 8(%ebp), %ecx " ); /* Restore the stack. */ ! __asm__ ( " addl $4, %esp " ); /* Test result of %eax. */ *************** teklti::FileASCIIBare::FileASCIIBare() *** 204,232 **** /* Check to see what to do. */ __asm__ ( " je tekfileasciibare_dummyreturn " ); - /* Put %eax into the private value. */ - __asm__ ( " movl %eax, 4(%edi) " ); - /* Re-align edi. */ - __asm__ ( " addl $8, %edi " ); /* Set up ecx as appropriate. */ ! #ifdef UNICODE ! __asm__ ( " movl $7, %ecx " ); ! #else /* not UNICODE */ ! ! __asm__ ( " movl $0, (%edi) " ); ! /* Set BufferPtr's ascii. */ ! __asm__ ( " movl %eax, 4(%edi) " ); ! /* Set BufferPtr's asciilen. */ ! __asm__ ( " movl %eax, 8(%edi) " ); ! /* Re-align edi. */ ! //__asm__ ( " addl $8, %edi " ); ! //__asm__ ( " movl $2, %ecx " ); ! #endif /* not UNICODE */ ! ! /* NULLify eax again. */ ! //__asm__ ( " xorl %eax, %eax " ); ! /* Call the stosl function until the area in ecx is nullified. */ ! //__asm__ ( " rep stosl " ); #ifdef USE_386_ASM_PUSHPOP /* Be sure to pop edi off the stack if we saved it earlier. */ --- 154,169 ---- /* Check to see what to do. */ __asm__ ( " je tekfileasciibare_dummyreturn " ); /* Set up ecx as appropriate. */ ! /* Set up the FileType value. */ ! __asm__ ( " movl %1, 596(%%ecx) " ! : "=m" (_tfbtmp) : "i" (TekFileType_ASCII) ); ! /* Set Buffer's ascii. */ ! __asm__ ( " movl %eax, 600(%ecx) " ); ! /* Set Buffer's asciilen. */ ! __asm__ ( " movl %1, 604(%%ecx) " ! : "=m" (_tfbtmp) : "i" (TEKFILEASCII_STDBUFLEN) ); + #ifndef USE_386_ASM_MMX #ifdef USE_386_ASM_PUSHPOP /* Be sure to pop edi off the stack if we saved it earlier. */ *************** teklti::FileASCIIBare::FileASCIIBare() *** 245,257 **** teklti::FileASCIIBare::~FileASCIIBare() { ! __asm__ ( " int $3 " ); if ( this->PrivFileDesc != NULL ) fclose(this->PrivFileDesc); - if ( this->PrivFileName.uchar_t_ascii != NULL ) - free(this->PrivFileName.uchar_t_ascii); - #ifdef TEKLTI_ENFORCE_PRIVACY - memset(this->PrivBuffer.uchar_t_ascii, '\0', TEKFILEASCII_STDBUFLEN); - #endif /* TEKLTI_ENFORCE_PRIVACY */ - free((void *)this->PrivBufferPtr.uchar_t_asciilen); } --- 182,194 ---- teklti::FileASCIIBare::~FileASCIIBare() { ! this->PrivBufferPtr.uchar_t_ascii = NULL; ! this->PrivBufferPtr.uchar_t_asciilen = 0; ! #ifdef UNICODE ! this->PrivBufferPtr.uchar_t_unicode = NULL; ! this->PrivBufferPtr.uchar_t_unicodelen = 0; ! #endif /* UNICODE */ ! if ( this->PrivFileDesc != NULL ) fclose(this->PrivFileDesc); } *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 276,280 **** ) { ! return TEKERR_NOTIMPL; } --- 213,217 ---- ) { ! return this->ReadLine(&Buffer, ReadMax); } *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 295,302 **** #ifdef UNICODE /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 128(%eax), %ecx " ); #else /* UNICODE */ /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 120(%eax), %ecx " ); #endif /* UNICODE */ /* Test to see if %ecx is NULL. */ --- 232,239 ---- #ifdef UNICODE /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 596(%eax), %ecx " ); #else /* UNICODE */ /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 588(%eax), %ecx " ); #endif /* UNICODE */ /* Test to see if %ecx is NULL. */ *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 417,424 **** #ifdef UNICODE /* Move a section of memory that contains the string len. */ ! __asm__ ( " movl 144(%eax), %ecx " ); #else /* UNICODE */ /* Move a section of memory that contains the string len. */ ! __asm__ ( " movl 136(%eax), %ecx " ); #endif /* UNICODE */ /* Get the pointer to the string. */ --- 354,361 ---- #ifdef UNICODE /* Move a section of memory that contains the string len. */ ! __asm__ ( " movl 628(%eax), %ecx " ); #else /* UNICODE */ /* Move a section of memory that contains the string len. */ ! __asm__ ( " movl 612(%eax), %ecx " ); #endif /* UNICODE */ /* Get the pointer to the string. */ *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 452,458 **** /* We need to get the pointer to the buffer. */ #ifdef UNICODE ! __asm__ ( " movl 140(%eax), %esi " ); #else /* UNICODE */ ! __asm__ ( " movl 132(%eax), %esi " ); #endif /* UNICODE */ --- 389,395 ---- /* We need to get the pointer to the buffer. */ #ifdef UNICODE ! __asm__ ( " movl 624(%eax), %esi " ); #else /* UNICODE */ ! __asm__ ( " movl 608(%eax), %esi " ); #endif /* UNICODE */ *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 502,516 **** /* Restore private value's string pointer. */ #ifdef UNICODE ! __asm__ ( " movl 148(%eax), %edi " ); ! __asm__ ( " movl %edi, 140(%eax), " ); #else /* not UNICODE */ ! __asm__ ( " movl 140(%eax), %edi " ); ! __asm__ ( " movl %edi, 132(%eax) " ); #endif /* not UNICODE */ /* Reset Buffer's len. */ #ifdef UNICODE ! __asm__ ( " movl $0, 144(%eax) " ); #else /* UNICODE */ ! __asm__ ( " movl $0, 136(%eax) " ); #endif /* UNICODE */ --- 439,453 ---- /* Restore private value's string pointer. */ #ifdef UNICODE ! __asm__ ( " movl 608(%eax), %edi " ); ! __asm__ ( " movl %edi, 624(%eax), " ); #else /* not UNICODE */ ! __asm__ ( " movl 600(%eax), %edi " ); ! __asm__ ( " movl %edi, 608(%eax) " ); #endif /* not UNICODE */ /* Reset Buffer's len. */ #ifdef UNICODE ! __asm__ ( " movl $0, 628(%eax) " ); #else /* UNICODE */ ! __asm__ ( " movl $0, 612(%eax) " ); #endif /* UNICODE */ *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 542,554 **** /* Move ebx to memory that contains the Buffer len. */ #ifdef UNICODE ! __asm__ ( " movl %ebx, 144(%eax) " ); #else /* UNICODE */ ! __asm__ ( " movl %ebx, 136(%eax) " ); #endif /* UNICODE */ /* Move edi to area containing the Buffer pointer. */ #ifdef UNICODE ! __asm__ ( " movl %esi, 140(%eax), " ); #else /* not UNICODE */ ! __asm__ ( " movl %esi, 132(%eax) " ); #endif /* not UNICODE */ /* Restore %ebx from %esp+12. */ --- 479,491 ---- /* Move ebx to memory that contains the Buffer len. */ #ifdef UNICODE ! __asm__ ( " movl %ebx, 620(%eax) " ); #else /* UNICODE */ ! __asm__ ( " movl %ebx, 612(%eax) " ); #endif /* UNICODE */ /* Move edi to area containing the Buffer pointer. */ #ifdef UNICODE ! __asm__ ( " movl %esi, 616(%eax), " ); #else /* not UNICODE */ ! __asm__ ( " movl %esi, 608(%eax) " ); #endif /* not UNICODE */ /* Restore %ebx from %esp+12. */ *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 582,589 **** #ifdef UNICODE /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 128(%eax), %ecx " ); #else /* UNICODE */ /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 120(%eax), %ecx " ); #endif /* UNICODE */ /* Put the FILE * onto the stack. */ --- 519,526 ---- #ifdef UNICODE /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 596(%eax), %ecx " ); #else /* UNICODE */ /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 588(%eax), %ecx " ); #endif /* UNICODE */ /* Put the FILE * onto the stack. */ *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 595,602 **** #ifdef UNICODE /* Move a section of memory that contains the PrivBuffer. */ ! __asm__ ( " movl 140(%eax), %ecx " ); #else /* UNICODE */ /* Move a section of memory that contains the PrivBuffer. */ ! __asm__ ( " movl 132(%eax), %ecx " ); #endif /* UNICODE */ /* Move the buffer string onto the stack. */ --- 532,539 ---- #ifdef UNICODE /* Move a section of memory that contains the PrivBuffer. */ ! __asm__ ( " movl 608(%eax), %ecx " ); #else /* UNICODE */ /* Move a section of memory that contains the PrivBuffer. */ ! __asm__ ( " movl 600(%eax), %ecx " ); #endif /* UNICODE */ /* Move the buffer string onto the stack. */ *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 616,623 **** #ifdef UNICODE /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 128(%eax), %ecx " ); #else /* UNICODE */ /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 120(%eax), %ecx " ); #endif /* UNICODE */ /* Put %ecx onto the stack as param 0. */ --- 553,560 ---- #ifdef UNICODE /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 596(%eax), %ecx " ); #else /* UNICODE */ /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 588(%eax), %ecx " ); #endif /* UNICODE */ /* Put %ecx onto the stack as param 0. */ *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 677,683 **** /* We need to get the pointer to the buffer. */ #ifdef UNICODE ! __asm__ ( " movl 140(%eax), %esi " ); #else /* UNICODE */ ! __asm__ ( " movl 132(%eax), %esi " ); #endif /* UNICODE */ /* Let's restore the %edi. */ --- 614,620 ---- /* We need to get the pointer to the buffer. */ #ifdef UNICODE ! __asm__ ( " movl 608(%eax), %esi " ); #else /* UNICODE */ ! __asm__ ( " movl 600(%eax), %esi " ); #endif /* UNICODE */ /* Let's restore the %edi. */ *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 764,770 **** /* We need to save the pointer to the PrivBuffer. */ #ifdef UNICODE ! __asm__ ( " movl %esi, 140(%edi) " ); #else /* UNICODE */ ! __asm__ ( " movl %esi, 132(%edi) " ); #endif /* UNICODE */ --- 701,707 ---- /* We need to save the pointer to the PrivBuffer. */ #ifdef UNICODE ! __asm__ ( " movl %esi, 624(%edi) " ); #else /* UNICODE */ ! __asm__ ( " movl %esi, 608(%edi) " ); #endif /* UNICODE */ *************** TEKERR teklti::FileASCIIBare::ReadLine( *** 790,797 **** #ifdef UNICODE /* Move a section of memory that contains the string len. */ ! __asm__ ( " movl %ebx, 144(%edi) " ); #else /* UNICODE */ /* Move a section of memory that contains the string len. */ ! __asm__ ( " movl %ebx, 136(%edi) " ); #endif /* UNICODE */ --- 727,734 ---- #ifdef UNICODE /* Move a section of memory that contains the string len. */ ! __asm__ ( " movl %ebx, 628(%edi) " ); #else /* UNICODE */ /* Move a section of memory that contains the string len. */ ! __asm__ ( " movl %ebx, 612(%edi) " ); #endif /* UNICODE */ *************** TEKERR teklti::FileASCIIBare::WriteLine( *** 872,879 **** #ifdef UNICODE /* Move a section of memory to %mm6 that contains the FILE *. */ ! __asm__ ( " movd 128(%eax), %mm6 " ); #else /* UNICODE */ /* Move a section of memory to %mm6 that contains the FILE *. */ ! __asm__ ( " movd 120(%eax), %mm6 " ); #endif /* UNICODE */ #endif /* defined(USE_386_ASM_MMX_FPUTS_SAFE) && defined(USE_386_ASM_FPUTS_FIX1) */ --- 809,816 ---- #ifdef UNICODE /* Move a section of memory to %mm6 that contains the FILE *. */ ! __asm__ ( " movd 596(%eax), %mm6 " ); #else /* UNICODE */ /* Move a section of memory to %mm6 that contains the FILE *. */ ! __asm__ ( " movd 588(%eax), %mm6 " ); #endif /* UNICODE */ #endif /* defined(USE_386_ASM_MMX_FPUTS_SAFE) && defined(USE_386_ASM_FPUTS_FIX1) */ *************** TEKERR teklti::FileASCIIBare::WriteLine( *** 888,895 **** #ifdef UNICODE /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 128(%eax), %eax " ); #else /* UNICODE */ /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 120(%eax), %eax " ); #endif /* UNICODE */ /* and over to the stack. */ --- 825,832 ---- #ifdef UNICODE /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 596(%eax), %eax " ); #else /* UNICODE */ /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 588(%eax), %eax " ); #endif /* UNICODE */ /* and over to the stack. */ *************** TEKERR teklti::FileASCIIBare::WriteLine( *** 907,914 **** #ifdef UNICODE /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 128(%eax), %ecx " ); #else /* UNICODE */ /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 120(%eax), %ecx " ); #endif /* UNICODE */ /* Test to see if %ecx is NULL. */ --- 844,851 ---- #ifdef UNICODE /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 596(%eax), %ecx " ); #else /* UNICODE */ /* Move a section of memory that contains the FILE *. */ ! __asm__ ( " movl 588(%eax), %ecx " ); #endif /* UNICODE */ /* Test to see if %ecx is NULL. */ *************** TEKERR teklti::FileASCIIBare::put_Filena *** 1262,1276 **** ) { ! /* Put FileDescriptor into the eax register. */ ! __asm__ ( " movl %0, %%eax " : "=m" (Name) ); /* Test to see if Name == NULL */ ! __asm__ ( " testl %eax, %eax " ); /* If Name == NULL, there's nothing to do. */ __asm__ ( " je .FileASCIIBare_put_Filename_donothing " ); /* Put file name pointer into esi, pushing if defined to do so. */ #ifdef USE_386_ASM_PUSHPOP __asm__ ( " pushl %esi " ); #endif /* USE_386_ASM_PUSHPOP */ __asm__ ( " movl (%eax), %esi " ); --- 1199,1314 ---- ) { ! #ifndef NO_SIZE_T_CHECKS ! /* Put FileDescriptor into the eax register. */ ! __asm__ ( " movl %0, %%ecx " : "=m" (Name) ); /* Test to see if Name == NULL */ ! __asm__ ( " testl %ecx, %ecx " ); ! /* Set retval for worst case scenario. */ ! __asm__ ( " movl %1, %%eax " : "=m" (_tfbtmp) : "i" (TEKERR_POINTER) ); /* If Name == NULL, there's nothing to do. */ __asm__ ( " je .FileASCIIBare_put_Filename_donothing " ); + #else /* NO_SIZE_T_CHECKS */ + /* Put provided uchar_t into the eax register. */ + __asm__ ( " movl %0, %%ecx " : "=m" (Name) ); + #endif /* NO_SIZE_T_CHECKS */ + /* Let's get the sizeof() the provided uchar_t. */ + __asm__ ( " movl 4(%ecx), %ecx " ); + /* Get our Private uchar_t ASCII pointer via this ptr... */ + __asm__ ( " movl 8(%ebp), %eax " ); + /* and save the result to eax. */ + __asm__ ( " movl 580(%eax), %eax " ); + /* Test to see if the integer is zero. */ + __asm__ ( " testl %eax, %eax " ); + /* If it is, we need to utilize malloc() instead. */ + __asm__ ( " je .FileASCIIBare_put_Filename_Start_malloc " ); + + /* Reset direction flag, just in case. */ + __asm__ ( " cld " ); + /* Go perform the comparison. */ + __asm__ ( " cmpl %eax, %ecx " ); + /* Check to see if we need to run realloc(). */ + __asm__ ( " jg .FileASCIIBare_put_Filename_realloc " ); + /* We don't need to run realloc(). Get ready to copy. */ + #ifdef USE_386_ASM_PUSHPOP + __asm__ ( " pushl %esi " ); + __asm__ ( " pushl %edi " ); + #endif /* USE_386_ASM_PUSHPOP */ + /* Put provided uchar_t into the eax register. */ + __asm__ ( " movl %0, %%eax " : "=m" (Name) ); + /* and then copy their ptr to esi. */ + __asm__ ( " movl (%eax), %esi " ); + /* Get the this ptr. */ + __asm__ ( " movl 8(%ebp), %eax " ); + /* and then copy the pointer to eax. */ + __asm__ ( " movl 580(%eax), %eax " ); + /* and then to edi. */ + __asm__ ( " movl %eax, %edi " ); + /* We're ready to copy the string. */ + __asm__ ( " jmp .FileASCIIBare_put_Filename_BeginCopy " ); + + /* Realloc label. */ + __asm__ ( " .FileASCIIBare_put_Filename_realloc: " ); + /* Get the this ptr. */ + __asm__ ( " movl 8(%ebp), %eax " ); + /* Obtain realloc's src pointer. */ + __asm__ ( " movl 580(%eax), %eax " ); + /* Push the count onto the stack first. */ + __asm__ ( " pushl %ecx " ); + /* Push the pointer second. */ + __asm__ ( " pushl %eax " ); + /* Call realloc(). */ + __asm__ ( " call realloc " ); + /* Test to see if realloc() succeeded. */ + __asm__ ( " testl %eax, %eax " ); + /* If it did, get ready to copy. */ + __asm__ ( " jne .FileASCIIBare_put_Filename_realloc_ok " ); + /* The function failed; we'll need fix the stack. */ + __asm__ ( " addl $8, %esp " ); + /* Put TEKERR_MEMORY as the return value. */ + __asm__ ( " movl %1, %%eax " : "=m" (_tfbtmp) : "i" (TEKERR_MEMORY) ); + /* Nothing to do... */ + __asm__ ( " jmp .FileASCIIBare_put_Filename_donothing " ); + + /* realloc() succeeded label. */ + __asm__ ( " .FileASCIIBare_put_Filename_realloc_ok: " ); + /* Get this pointer. */ + __asm__ ( " movl 8(%ebp), %ecx "); + /* Save the new pointer into uchar_t now at eax. */ + __asm__ ( " movl %eax, 580(%ecx) " ); + /* Move ecx to eax so we can store the new count. */ + __asm__ ( " movl %ecx, %eax " ); + /* Get the count from the stack; movsb now needs it. */ + __asm__ ( " movl 4(%esp), %ecx " ); + /* Store the count into our uchar_t. */ + __asm__ ( " movl %ecx, 584(%eax) " ); + /* Save esi and edi if necessary. */ + #ifdef USE_386_ASM_PUSHPOP + __asm__ ( " movl %esi, 4(%esp) " ); + __asm__ ( " movl %edi, (%esp) " ); + #else /* not USE_386_ASM_PUSHPOP */ + __asm__ ( " addl $8, %esp " ); + #endif /* USE_386_ASM_PUSHPOP */ + /* Put destination pointer into edi. */ + __asm__ ( " movl 580(%eax), %edi " ); + /* Get pointer of the provided uchar_t... */ + __asm__ ( " movl %0, %%eax " : "=m" (Name) ); + /* ... and put its ASCII pointer into esi. */ + __asm__ ( " movl (%eax), %esi " ); + + /* Get the this pointer one more time. */ + __asm__ ( " movl 8(%ebp), %eax " ); + /* and go get the new realloc() pointer. */ + __asm__ ( " movl 580(%eax), %eax " ); + /* We're ready to copy the string. */ + __asm__ ( " jmp .FileASCIIBare_put_Filename_BeginCopy " ); + + /* Label for when malloc() has to be called. */ + __asm__ ( " .FileASCIIBare_put_Filename_Start_malloc: " ); /* Put file name pointer into esi, pushing if defined to do so. */ #ifdef USE_386_ASM_PUSHPOP __asm__ ( " pushl %esi " ); #endif /* USE_386_ASM_PUSHPOP */ + __asm__ ( " movl %0, %%eax " : "=m" (Name) ); __asm__ ( " movl (%eax), %esi " ); *************** TEKERR teklti::FileASCIIBare::put_Filena *** 1348,1351 **** --- 1386,1399 ---- /* Move dest string to edi. */ __asm__ ( " movl %eax, %edi " ); + /* Temporarily push dest string onto the stack. */ + __asm__ ( " pushl %eax " ); + + /* We need to get the this pointer... */ + __asm__ ( " movl 8(%ebp), %eax " ); + /* ... or we'll lose the count forever. */ + __asm__ ( " movl %ecx, 584(%eax) " ); + /* Restore eax. */ + __asm__ ( " popl %eax " ); + #ifdef USE_386_ASM_MALLOC_FIX2 /* malloc() calls std and leaves direction flag set, so... */ *************** TEKERR teklti::FileASCIIBare::put_Filena *** 1353,1362 **** __asm__ ( " cld " ); #endif /* USE_386_ASM_MALLOC_FIX2 */ /* And copy it. */ __asm__ ( " rep movsb " ); /* Get the pointer to the instance's variables. */ __asm__ ( " movl 8(%ebp), %ecx " ); ! /* Move result to PrivTekFileName. */ ! __asm__ ( " movl %eax, 112(%ecx) " ); /* Used for do-nothing returns. */ --- 1401,1412 ---- __asm__ ( " cld " ); #endif /* USE_386_ASM_MALLOC_FIX2 */ + /* Copy label. */ + __asm__ ( " .FileASCIIBare_put_Filename_BeginCopy: " ); /* And copy it. */ __asm__ ( " rep movsb " ); /* Get the pointer to the instance's variables. */ __asm__ ( " movl 8(%ebp), %ecx " ); ! /* Move result to PrivFileName. */ ! __asm__ ( " movl %eax, 580(%ecx) " ); /* Used for do-nothing returns. */ *************** TEKERR teklti::FileASCIIBare::put_Filena *** 1370,1374 **** /* Clean up - pointer, then stack. */ #ifdef USE_386_ASM_PUSHPOP ! __asm__ ( " addl $8, %esp " ); #endif /* USE_386_ASM_PUSHPOP */ --- 1420,1425 ---- /* Clean up - pointer, then stack. */ #ifdef USE_386_ASM_PUSHPOP ! __asm__ ( " popl %edi " ); ! __asm__ ( " popl %esi " ); #endif /* USE_386_ASM_PUSHPOP */ *************** TEKERR teklti::FileASCIIBare::Open() *** 1761,1767 **** /* Move result to PrivFileDesc. */ #ifdef UNICODE ! __asm__ ( " movl %eax, 128(%ecx) " ); #else /* not UNICODE */ ! __asm__ ( " movl %eax, 120(%ecx) " ); #endif /* not UNICODE */ --- 1812,1818 ---- /* Move result to PrivFileDesc. */ #ifdef UNICODE ! __asm__ ( " movl %eax, 596(%ecx) " ); #else /* not UNICODE */ ! __asm__ ( " movl %eax, 588(%ecx) " ); #endif /* not UNICODE */ *************** TEKERR teklti::FileASCIIBare::Open64() *** 1900,1906 **** /* Move result to PrivFileDesc. */ #ifdef UNICODE ! __asm__ ( " movl %eax, 128(%ecx) " ); #else /* not UNICODE */ ! __asm__ ( " movl %eax, 120(%ecx) " ); #endif /* not UNICODE */ --- 1951,1957 ---- /* Move result to PrivFileDesc. */ #ifdef UNICODE ! __asm__ ( " movl %eax, 596(%ecx) " ); #else /* not UNICODE */ ! __asm__ ( " movl %eax, 588(%ecx) " ); #endif /* not UNICODE */ *************** TEKERR teklti::FileASCIIBare::put_Mode( *** 1932,1938 **** __asm__ ( " movl 8(%ebp), %eax "); #ifdef UNICODE ! __asm__ ( " movl 128(%eax), %ecx " ); #else /* not UNICODE */ ! __asm__ ( " movl 120(%eax), %ecx " ); #endif /* not UNICODE */ --- 1983,1989 ---- __asm__ ( " movl 8(%ebp), %eax "); #ifdef UNICODE ! __asm__ ( " movl 596(%eax), %ecx " ); #else /* not UNICODE */ ! __asm__ ( " movl 588(%eax), %ecx " ); #endif /* not UNICODE */ *************** TEKERR teklti::FileASCIIBare::put_Mode( *** 1960,1966 **** #endif /* NO_INTERNAL_NULL_CHECKS */ #ifdef UNICODE ! __asm__ ( " movl %ecx, 132(%eax) " ); #else /* not UNICODE */ ! __asm__ ( " movl %ecx, 124(%eax) " ); #endif /* not UNICODE */ --- 2011,2017 ---- #endif /* NO_INTERNAL_NULL_CHECKS */ #ifdef UNICODE ! __asm__ ( " movl %ecx, 600(%eax) " ); #else /* not UNICODE */ ! __asm__ ( " movl %ecx, 592(%eax) " ); #endif /* not UNICODE */ |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-11 08:35:36
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv29856/src Modified Files: TekFileBinary.386.cpp testsuite-tekfilebinary.cpp Log Message: CHANGE: Refactored assembly instructions. Index: testsuite-tekfilebinary.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/testsuite-tekfilebinary.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C 2 -d -p -r1.4 -r1.5 *** testsuite-tekfilebinary.cpp 11 Feb 2007 07:52:38 -0000 1.4 --- testsuite-tekfilebinary.cpp 11 Mar 2007 08:42:49 -0000 1.5 *************** int runtekfiletests ( void ) *** 60,64 **** /* --- HUNK 0 BEGIN --- */ /* -------------------- */ ! PRINTHUNK(0, "Create an instance of TekFileBinary") /* NULLify tekbin. */ --- 60,64 ---- /* --- HUNK 0 BEGIN --- */ /* -------------------- */ ! PRINTHUNK(0, "Create an instance of TekFileBinary"); /* NULLify tekbin. */ *************** TekFileBinaryHunk0Fail: *** 95,99 **** /* --- HUNK 1 BEGIN --- */ /* -------------------- */ ! PRINTHUNK(1, "Check that the instance is derived from TekFile") /* Get the binary UUID of UTekFile. */ --- 95,99 ---- /* --- HUNK 1 BEGIN --- */ /* -------------------- */ ! PRINTHUNK(1, "Check that the instance is derived from TekFile"); /* Get the binary UUID of UTekFile. */ *************** TekFileBinaryHunk1Fail: *** 132,136 **** /* --- HUNK 2 BEGIN --- */ /* -------------------- */ ! PRINTHUNK(2, "Check that get_Type currently reports TekFileType_Binary") /* Get the typeof tekfil. */ --- 132,136 ---- /* --- HUNK 2 BEGIN --- */ /* -------------------- */ ! PRINTHUNK(2, "Check that get_Type currently reports TekFileType_Binary"); /* Get the typeof tekfil. */ *************** TekFileBinaryHunk2Fail: *** 165,169 **** /* --- HUNK 3 BEGIN --- */ /* -------------------- */ ! PRINTHUNK(3, "Check that put_FILE and get_FILE works") /* Set FILE param to stderr. */ --- 165,169 ---- /* --- HUNK 3 BEGIN --- */ /* -------------------- */ ! PRINTHUNK(3, "Check that put_FILE and get_FILE works"); /* Set FILE param to stderr. */ *************** TekFileBinaryHunk4Fail: *** 278,285 **** } - /*tekmode = TekFileMode_ReadAppend; - hres = tekfil->put_Mode(tekmode); - tekmode = TekFileMode_ReadOnly; - hres = tekfil->get_Mode(&tekmode);*/ /* -------------------- */ --- 278,281 ---- Index: TekFileBinary.386.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileBinary.386.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C 2 -d -p -r1.15 -r1.16 *** TekFileBinary.386.cpp 11 Mar 2007 05:04:47 -0000 1.15 --- TekFileBinary.386.cpp 11 Mar 2007 08:42:49 -0000 1.16 *************** FileBinary::FileBinary() *** 72,76 **** /* Get the value of 'this' ptr into ecx. */ - __asm__ ( " int $3 " ); __asm__ ( " movl %1, %%ecx " : "=m" (_tfbtmp) : "X" (this) ); --- 72,75 ---- *************** Destructor. *** 120,124 **** FileBinary::~FileBinary() { - __asm__ ( " int $3 " ); /* Get the value of this->PrivFileDesc. */ __asm__ ( " movl %0, %%ecx " : "=m" (this->PrivFileDesc) ); --- 119,122 ---- *************** TEKERR FileBinary::get_FILE(FILE ** File *** 186,190 **** #endif /* NO_SIZE_T_CHECKS */ ! /* Put the PrivTekFileType into the ecx register. */ __asm__ ( " movl %0, %%ecx " : "=m" (this->PrivFileDesc) ); /* And then into *FileTypePointer. */ --- 184,188 ---- #endif /* NO_SIZE_T_CHECKS */ ! /* Put the PrivFileDesc into the ecx register. */ __asm__ ( " movl %0, %%ecx " : "=m" (this->PrivFileDesc) ); /* And then into *FileTypePointer. */ *************** TEKERR FileBinary::put_FILE(FILE * FileD *** 401,415 **** TEKERR FileBinary::put_Filename(uchar_t * Name) { /* Put FileDescriptor into the eax register. */ ! __asm__ ( " movl %0, %%eax " : "=m" (Name) ); /* Test to see if Name == NULL */ ! __asm__ ( " testl %eax, %eax " ); /* If Name == NULL, there's nothing to do. */ __asm__ ( " je .FileBinary_put_Filename_donothing " ); /* Put file name pointer into esi, pushing if defined to do so. */ #ifdef USE_386_ASM_PUSHPOP __asm__ ( " pushl %esi " ); #endif /* USE_386_ASM_PUSHPOP */ __asm__ ( " movl (%eax), %esi " ); --- 399,514 ---- TEKERR FileBinary::put_Filename(uchar_t * Name) { + #ifndef NO_SIZE_T_CHECKS /* Put FileDescriptor into the eax register. */ ! __asm__ ( " movl %0, %%ecx " : "=m" (Name) ); /* Test to see if Name == NULL */ ! __asm__ ( " testl %ecx, %ecx " ); ! /* Set retval for worst case scenario. */ ! __asm__ ( " movl %1, %%eax " : "=m" (_tfbtmp) : "i" (TEKERR_POINTER) ); /* If Name == NULL, there's nothing to do. */ __asm__ ( " je .FileBinary_put_Filename_donothing " ); + #else /* NO_SIZE_T_CHECKS */ + /* Put provided uchar_t into the eax register. */ + __asm__ ( " movl %0, %%ecx " : "=m" (Name) ); + #endif /* NO_SIZE_T_CHECKS */ + + /* Let's get the sizeof() the provided uchar_t. */ + __asm__ ( " movl 4(%ecx), %ecx " ); + /* Get our Private uchar_t ASCII pointer via this ptr... */ + __asm__ ( " movl 8(%ebp), %eax " ); + /* and save the result to eax. */ + __asm__ ( " movl 392(%eax), %eax " ); + /* Test to see if the integer is zero. */ + __asm__ ( " testl %eax, %eax " ); + /* If it is, we need to utilize malloc() instead. */ + __asm__ ( " je .FileBinary_put_Filename_Start_malloc " ); + + /* Reset direction flag, just in case. */ + __asm__ ( " cld " ); + /* Go perform the comparison. */ + __asm__ ( " cmpl %eax, %ecx " ); + /* Check to see if we need to run realloc(). */ + __asm__ ( " jg .FileBinary_put_Filename_realloc " ); + /* We don't need to run realloc(). Get ready to copy. */ + #ifdef USE_386_ASM_PUSHPOP + __asm__ ( " pushl %esi " ); + __asm__ ( " pushl %edi " ); + #endif /* USE_386_ASM_PUSHPOP */ + /* Put provided uchar_t into the eax register. */ + __asm__ ( " movl %0, %%eax " : "=m" (Name) ); + /* and then copy their ptr to esi. */ + __asm__ ( " movl (%eax), %esi " ); + /* Get the this ptr. */ + __asm__ ( " movl 8(%ebp), %eax " ); + /* and then copy the pointer to eax. */ + __asm__ ( " movl 388(%eax), %eax " ); + /* and then to edi. */ + __asm__ ( " movl %eax, %edi " ); + /* We're ready to copy the string. */ + __asm__ ( " jmp .FileBinary_put_Filename_BeginCopy " ); + + /* Realloc label. */ + __asm__ ( " .FileBinary_put_Filename_realloc: " ); + /* Get the this ptr. */ + __asm__ ( " movl 8(%ebp), %eax " ); + /* Obtain realloc's src pointer. */ + __asm__ ( " movl 388(%eax), %eax " ); + /* Push the count onto the stack first. */ + __asm__ ( " pushl %ecx " ); + /* Push the pointer second. */ + __asm__ ( " pushl %eax " ); + /* Call realloc(). */ + __asm__ ( " call realloc " ); + /* Test to see if realloc() succeeded. */ + __asm__ ( " testl %eax, %eax " ); + /* If it did, get ready to copy. */ + __asm__ ( " jne .FileBinary_put_Filename_realloc_ok " ); + /* The function failed; we'll need fix the stack. */ + __asm__ ( " addl $8, %esp " ); + /* Put TEKERR_MEMORY as the return value. */ + __asm__ ( " movl %1, %%eax " : "=m" (_tfbtmp) : "i" (TEKERR_MEMORY) ); + /* Nothing to do... */ + __asm__ ( " jmp .FileBinary_put_Filename_donothing " ); + /* realloc() succeeded label. */ + __asm__ ( " .FileBinary_put_Filename_realloc_ok: " ); + /* Get this pointer. */ + __asm__ ( " movl 8(%ebp), %ecx "); + /* Save the new pointer into uchar_t now at eax. */ + __asm__ ( " movl %eax, 388(%ecx) " ); + /* Move ecx to eax so we can store the new count. */ + __asm__ ( " movl %ecx, %eax " ); + /* Get the count from the stack; movsb now needs it. */ + __asm__ ( " movl 4(%esp), %ecx " ); + /* Store the count into our uchar_t. */ + __asm__ ( " movl %ecx, 392(%eax) " ); + /* Save esi and edi if necessary. */ + #ifdef USE_386_ASM_PUSHPOP + __asm__ ( " movl %esi, 4(%esp) " ); + __asm__ ( " movl %edi, (%esp) " ); + #else /* not USE_386_ASM_PUSHPOP */ + __asm__ ( " addl $8, %esp " ); + #endif /* USE_386_ASM_PUSHPOP */ + /* Put destination pointer into edi. */ + __asm__ ( " movl 388(%eax), %edi " ); + /* Get pointer of the provided uchar_t... */ + __asm__ ( " movl %0, %%eax " : "=m" (Name) ); + /* ... and put its ASCII pointer into esi. */ + __asm__ ( " movl (%eax), %esi " ); + + /* Get the this pointer one more time. */ + __asm__ ( " movl 8(%ebp), %eax " ); + /* and go get the new realloc() pointer. */ + __asm__ ( " movl 388(%eax), %eax " ); + /* We're ready to copy the string. */ + __asm__ ( " jmp .FileBinary_put_Filename_BeginCopy " ); + + /* Label for when malloc() has to be called. */ + __asm__ ( " .FileBinary_put_Filename_Start_malloc: " ); /* Put file name pointer into esi, pushing if defined to do so. */ #ifdef USE_386_ASM_PUSHPOP __asm__ ( " pushl %esi " ); #endif /* USE_386_ASM_PUSHPOP */ + __asm__ ( " movl %0, %%eax " : "=m" (Name) ); __asm__ ( " movl (%eax), %esi " ); *************** TEKERR FileBinary::put_Filename(uchar_t *** 487,490 **** --- 586,599 ---- /* Move dest string to edi. */ __asm__ ( " movl %eax, %edi " ); + /* Temporarily push dest string onto the stack. */ + __asm__ ( " pushl %eax " ); + + /* We need to get the this pointer... */ + __asm__ ( " movl 8(%ebp), %eax " ); + /* ... or we'll lose the count forever. */ + __asm__ ( " movl %ecx, 392(%eax) " ); + /* Restore eax. */ + __asm__ ( " popl %eax " ); + #ifdef USE_386_ASM_MALLOC_FIX2 /* malloc() calls std and leaves direction flag set, so... */ *************** TEKERR FileBinary::put_Filename(uchar_t *** 492,501 **** __asm__ ( " cld " ); #endif /* USE_386_ASM_MALLOC_FIX2 */ /* And copy it. */ __asm__ ( " rep movsb " ); /* Get the pointer to the instance's variables. */ __asm__ ( " movl 8(%ebp), %ecx " ); ! /* Move result to PrivTekFileName. */ ! __asm__ ( " movl %eax, 76(%ecx) " ); /* Used for do-nothing returns. */ --- 601,612 ---- __asm__ ( " cld " ); #endif /* USE_386_ASM_MALLOC_FIX2 */ + /* Copy label. */ + __asm__ ( " .FileBinary_put_Filename_BeginCopy: " ); /* And copy it. */ __asm__ ( " rep movsb " ); /* Get the pointer to the instance's variables. */ __asm__ ( " movl 8(%ebp), %ecx " ); ! /* Move result to PrivFileName. */ ! __asm__ ( " movl %eax, 388(%ecx) " ); /* Used for do-nothing returns. */ *************** TEKERR FileBinary::put_Filename(uchar_t *** 509,513 **** /* Clean up - pointer, then stack. */ #ifdef USE_386_ASM_PUSHPOP ! __asm__ ( " addl $8, %esp " ); #endif /* USE_386_ASM_PUSHPOP */ --- 620,625 ---- /* Clean up - pointer, then stack. */ #ifdef USE_386_ASM_PUSHPOP ! __asm__ ( " popl %edi " ); ! __asm__ ( " popl %esi " ); #endif /* USE_386_ASM_PUSHPOP */ *************** TEKERR FileBinary::Open() *** 896,902 **** /* Move result to PrivFileDesc. */ #ifdef UNICODE ! __asm__ ( " movl %eax, 92(%ecx) " ); #else /* not UNICODE */ ! __asm__ ( " movl %eax, 84(%ecx) " ); #endif /* not UNICODE */ --- 1008,1014 ---- /* Move result to PrivFileDesc. */ #ifdef UNICODE ! __asm__ ( " movl %eax, 404(%ecx) " ); #else /* not UNICODE */ ! __asm__ ( " movl %eax, 396(%ecx) " ); #endif /* not UNICODE */ *************** TEKERR FileBinary::Open64() *** 1035,1041 **** /* Move result to PrivFileDesc. */ #ifdef UNICODE ! __asm__ ( " movl %eax, 92(%ecx) " ); #else /* not UNICODE */ ! __asm__ ( " movl %eax, 84(%ecx) " ); #endif /* not UNICODE */ --- 1147,1153 ---- /* Move result to PrivFileDesc. */ #ifdef UNICODE ! __asm__ ( " movl %eax, 404(%ecx) " ); #else /* not UNICODE */ ! __asm__ ( " movl %eax, 396(%ecx) " ); #endif /* not UNICODE */ *************** TEKERR FileBinary::put_Mode(FileMode Mod *** 1063,1071 **** { #ifndef NO_INTERNAL_NULL_CHECKS __asm__ ( " movl 8(%ebp), %eax "); #ifdef UNICODE ! __asm__ ( " movl 92(%eax), %ecx " ); #else /* not UNICODE */ ! __asm__ ( " movl 84(%eax), %ecx " ); #endif /* not UNICODE */ --- 1175,1185 ---- { #ifndef NO_INTERNAL_NULL_CHECKS + /* Get the this pointer. */ __asm__ ( " movl 8(%ebp), %eax "); + /* Get the file descriptor pointer. */ #ifdef UNICODE ! __asm__ ( " movl 404(%eax), %ecx " ); #else /* not UNICODE */ ! __asm__ ( " movl 396(%eax), %ecx " ); #endif /* not UNICODE */ *************** TEKERR FileBinary::put_Mode(FileMode Mod *** 1093,1099 **** #endif /* NO_INTERNAL_NULL_CHECKS */ #ifdef UNICODE ! __asm__ ( " movl %ecx, 96(%eax) " ); #else /* not UNICODE */ ! __asm__ ( " movl %ecx, 88(%eax) " ); #endif /* not UNICODE */ --- 1207,1213 ---- #endif /* NO_INTERNAL_NULL_CHECKS */ #ifdef UNICODE ! __asm__ ( " movl %ecx, 408(%eax) " ); #else /* not UNICODE */ ! __asm__ ( " movl %ecx, 400(%eax) " ); #endif /* not UNICODE */ |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-11 04:57:41
|
Update of /cvsroot/libteklti/libteklti In directory planetsaphire.com:/tmp/cvs-serv24285 Modified Files: Doxyfile.in Log Message: FIX: Interfaces make their own Std funcs due to ~ failing in lib. Index: Doxyfile.in =================================================================== RCS file: /cvsroot/libteklti/libteklti/Doxyfile.in,v retrieving revision 1.8 retrieving revision 1.9 diff -C 2 -d -p -r1.8 -r1.9 *** Doxyfile.in 23 Feb 2007 02:37:32 -0000 1.8 --- Doxyfile.in 11 Mar 2007 05:04:47 -0000 1.9 *************** PREDEFINED = TEKUUIDIMPORT(x *** 1143,1146 **** --- 1143,1147 ---- TEKSTD_HEADER_VARS= \ TEKSTD_HEADER_FUNC(cls)= \ + TEKSTD_HEADER_FUNC_PURE(cls)= \ TEKSTD_HEADER_VARSANDFUNC(cls)= \ TEKSTD_SOURCE_FUNC= \ |
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv24285/src Modified Files: TekFileASCIIBare.386.cpp TekFileASCIIBare.cpp TekFileBZ2Binary.cpp TekFileBinary.386.cpp TekFileBinary.cpp TekStatFilePOSIX.cpp TekStd.cpp TekUserDBUnix.cpp TekUserUnixRO.cpp TekUserUnixRW.cpp tekacl.h tekenum.h tekfile.h tekfileascii.h tekfileasciibare.h tekfilebinary.h tekfilebz2.h tekfilebz2binary.h teklti.h tekstatfile.h tekstatfileposix.h tekstd.h tekuser.h tekuserdb.h tekuserdbunix.h tekuserunixro.h tekuserunixrw.h Log Message: FIX: Interfaces make their own Std funcs due to ~ failing in lib. Index: TekUserDBUnix.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekUserDBUnix.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C 2 -d -p -r1.22 -r1.23 *** TekUserDBUnix.cpp 25 Feb 2007 17:51:35 -0000 1.22 --- TekUserDBUnix.cpp 11 Mar 2007 05:04:47 -0000 1.23 *************** namespace teklti *** 54,57 **** --- 54,60 ---- + TEKSTD_SOURCE_FUNC_TYPEI(UserDBUnix); + + UserDBUnix::UserDBUnix() { Index: tekfilebz2binary.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekfilebz2binary.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C 2 -d -p -r1.9 -r1.10 *** tekfilebz2binary.h 15 Feb 2007 11:08:48 -0000 1.9 --- tekfilebz2binary.h 11 Mar 2007 05:04:48 -0000 1.10 *************** uchar_t PrivFilename; *** 66,69 **** --- 66,70 ---- public: + TEKSTD_HEADER_VARSANDFUNC(FileBZ2Binary); /** * Instantizer. Index: tekfilebz2.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekfilebz2.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C 2 -d -p -r1.9 -r1.10 *** tekfilebz2.h 15 Feb 2007 11:08:48 -0000 1.9 --- tekfilebz2.h 11 Mar 2007 05:04:47 -0000 1.10 *************** class FileBZ2 : public File *** 53,56 **** --- 53,57 ---- { public: + TEKSTD_HEADER_FUNC_PURE(FileBZ2); /** Instantizer. Index: TekUserUnixRO.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekUserUnixRO.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C 2 -d -p -r1.8 -r1.9 *** TekUserUnixRO.cpp 24 Feb 2007 17:47:11 -0000 1.8 --- TekUserUnixRO.cpp 11 Mar 2007 05:04:47 -0000 1.9 *************** namespace teklti *** 37,40 **** --- 37,43 ---- + TEKSTD_SOURCE_FUNC_TYPEI(UserUnixRO); + + UserUnixRO::UserUnixRO() { Index: teklti.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/teklti.h,v retrieving revision 1.69 retrieving revision 1.70 diff -C 2 -d -p -r1.69 -r1.70 *** teklti.h 28 Feb 2007 10:36:25 -0000 1.69 --- teklti.h 11 Mar 2007 05:04:48 -0000 1.70 *************** virtual TEKERR CallFunc( \ *** 1946,1949 **** --- 1946,1968 ---- ); + #define TEKSTD_HEADER_FUNC_PURE(cls) \ + public: \ + \ + virtual unsigned int AddRef() = 0; \ + virtual TEKERR CheckFor( \ + const uuid_t * UUIDArray, \ + size_t UUIDArraySize, \ + unsigned short Flags = 0x0000, \ + void ** RetVal = (void **)NULL, \ + unsigned int ** RefCountPtrRet = (unsigned int **)NULL \ + ) = 0; \ + virtual unsigned int Release() = 0; \ + virtual TEKERR CallFunc( \ + const uchar_t * FuncName, \ + void * RetVal, \ + unsigned short ParamsCount, \ + void ** Params \ + ) = 0; + #define TEKSTD_PUREVIRTUAL_FUNC_V1 \ virtual TEKERR CallFunc(const uchar_t* FuncName, void* RetVal, unsigned short ParamsCount, void** Params) = 0; \ *************** TEKSTD_HEADER_FUNC(cls) *** 1957,1961 **** #ifdef NO_SIZE_T_CHECKS ! #define TEKSTD_SOURCE_FUNC_CHECKFOR(cls) #else /* not NO_SIZE_T_CHECKS */ #ifdef DEBUG_USE_FERROR --- 1976,1980 ---- #ifdef NO_SIZE_T_CHECKS ! #define TEKSTD_SOURCE_FUNC_CHECKFOR #else /* not NO_SIZE_T_CHECKS */ #ifdef DEBUG_USE_FERROR *************** unsigned int cls::Release() { \ *** 2058,2061 **** --- 2077,2143 ---- TEKSTD_SOURCE_FUNC_CALLFUNC(cls) + /** + * Function template including source code for + * implementing the TekStd interface. The + * macro is intended to be used in source files + * of Type II interfaces. + */ + #define TEKSTD_SOURCE_FUNC_TYPEII(cls) \ + TEKSTD_SOURCE_FUNC(cls) + + /** + * Function template including source code for + * implementing the TekStd interface. The + * macro is intended to be used in source files + * of Type I interfaces. + */ + #define TEKSTD_SOURCE_FUNC_TYPEI(cls) \ + unsigned int cls::AddRef() { this->Std::__instancecount++; return this->Std::__instancecount; } \ + TEKERR cls::CheckFor( \ + const uuid_t * UUIDArray, \ + size_t UUIDArraySize, \ + unsigned short Flags, \ + void ** RetVal, \ + unsigned int ** RefCountPtrRet \ + ) { \ + TEKERR result; \ + size_t i; \ + size_t j; \ + TEKSTD_SOURCE_FUNC_CHECKFOR \ + for ( i=0; i < UUIDArraySize; i++ ) \ + { \ + for ( j=0; j < this->Std::__uuidarraycount; j++ ) \ + if ( uuid_compare(this->Std::__uuidarray[j], UUIDArray[i]) == 0 ) \ + goto FoundUUID; \ + \ + i++; \ + result = i << (8 * sizeof(short)); \ + result |= TEKERR_NOTIMPL; \ + return result; \ + FoundUUID: \ + ; \ + } \ + \ + if ( Flags ) { \ + this->AddRef(); \ + *RetVal = this; \ + } \ + \ + if ( RefCountPtrRet != (unsigned int **)NULL ) \ + *RefCountPtrRet = &this->Std::__instancecount; \ + \ + return TEKERR_OK; \ + } \ + unsigned int cls::Release() { \ + this->Std::__instancecount--; \ + if ( this->Std::__instancecount == 0 ) \ + { \ + delete this; \ + return 0; \ + } \ + return this->Std::__instancecount; \ + } \ + TEKSTD_SOURCE_FUNC_CALLFUNC(cls) + #define TEKSTD_CHECKFOR_UUIDNO(err) (unsigned short)((err >> 8 * sizeof(short)) #define TEKSTD_CHECKFOR_ERRNO(err) (unsigned short)((err << 8 * sizeof(short)) Index: tekstatfileposix.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekstatfileposix.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C 2 -d -p -r1.6 -r1.7 *** tekstatfileposix.h 26 Feb 2007 19:55:04 -0000 1.6 --- tekstatfileposix.h 11 Mar 2007 05:04:48 -0000 1.7 *************** class StatFilePOSIX : public StatFile *** 43,46 **** --- 43,47 ---- { public: + TEKSTD_HEADER_FUNC_PURE(StatFilePOSIX); /** Instantizer. Index: TekFileASCIIBare.386.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileASCIIBare.386.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C 2 -d -p -r1.11 -r1.12 *** TekFileASCIIBare.386.cpp 11 Mar 2007 00:58:15 -0000 1.11 --- TekFileASCIIBare.386.cpp 11 Mar 2007 05:04:47 -0000 1.12 *************** extern const char FileASCIIBare_ReadAppe *** 50,53 **** --- 50,56 ---- + TEKSTD_SOURCE_FUNC_TYPEI(teklti::FileASCIIBare); + + #ifdef TEKLTI_DEFINE_OUTSIDECODE_FUNC static void tekfileasciibare_dummyreturn ( void ) Index: tekenum.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekenum.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C 2 -d -p -r1.5 -r1.6 *** tekenum.h 25 Feb 2007 07:48:38 -0000 1.5 --- tekenum.h 11 Mar 2007 05:04:47 -0000 1.6 *************** This interface is <b>INHERITABLE</b>. *** 41,44 **** --- 41,45 ---- class Enum : public Std { + TEKSTD_HEADER_FUNC_PURE(Enum); public: /** Index: tekfile.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekfile.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C 2 -d -p -r1.9 -r1.10 *** tekfile.h 15 Feb 2007 11:08:48 -0000 1.9 --- tekfile.h 11 Mar 2007 05:04:47 -0000 1.10 *************** This interface is <b>INHERITABLE</b>. *** 112,115 **** --- 112,116 ---- class File : public Std { + TEKSTD_HEADER_FUNC_PURE(File); public: /** Index: TekStatFilePOSIX.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekStatFilePOSIX.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C 2 -d -p -r1.5 -r1.6 *** TekStatFilePOSIX.cpp 26 Feb 2007 19:55:04 -0000 1.5 --- TekStatFilePOSIX.cpp 11 Mar 2007 05:04:47 -0000 1.6 *************** namespace teklti *** 37,40 **** --- 37,43 ---- + TEKSTD_SOURCE_FUNC_TYPEI(StatFilePOSIX); + + StatFilePOSIX::StatFilePOSIX() { Index: tekuserunixro.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekuserunixro.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C 2 -d -p -r1.8 -r1.9 *** tekuserunixro.h 24 Feb 2007 17:47:11 -0000 1.8 --- tekuserunixro.h 11 Mar 2007 05:04:48 -0000 1.9 *************** class UserUnixRO : public User *** 43,46 **** --- 43,47 ---- { public: + TEKSTD_HEADER_VARSANDFUNC(UserUnixRO); /** Index: tekuserdbunix.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekuserdbunix.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C 2 -d -p -r1.13 -r1.14 *** tekuserdbunix.h 25 Feb 2007 08:29:58 -0000 1.13 --- tekuserdbunix.h 11 Mar 2007 05:04:48 -0000 1.14 *************** class UserDBUnix : public UserDB *** 45,48 **** --- 45,49 ---- { public: + TEKSTD_HEADER_VARSANDFUNC(UserDBUnix); /** Instantizer. Index: tekfileasciibare.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekfileasciibare.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C 2 -d -p -r1.8 -r1.9 *** tekfileasciibare.h 21 Feb 2007 04:55:03 -0000 1.8 --- tekfileasciibare.h 11 Mar 2007 05:04:47 -0000 1.9 *************** private: *** 51,54 **** --- 51,55 ---- public: + TEKSTD_HEADER_VARSANDFUNC(FileASCIIBare); /** Instantizer. *************** virtual TEKERR get_Location(unsigned lon *** 208,213 **** */ virtual TEKERR get_Location64(uint64_t * Location); - - TEKSTD_HEADER_VARS; }; --- 209,212 ---- Index: TekFileBinary.386.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileBinary.386.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C 2 -d -p -r1.14 -r1.15 *** TekFileBinary.386.cpp 11 Mar 2007 04:03:12 -0000 1.14 --- TekFileBinary.386.cpp 11 Mar 2007 05:04:47 -0000 1.15 *************** namespace teklti *** 36,39 **** --- 36,42 ---- + TEKSTD_SOURCE_FUNC_TYPEI(FileBinary); + + #undef TEKLTI_NULLALL Index: tekuser.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekuser.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C 2 -d -p -r1.10 -r1.11 *** tekuser.h 24 Feb 2007 17:47:11 -0000 1.10 --- tekuser.h 11 Mar 2007 05:04:48 -0000 1.11 *************** class User : public Std *** 55,58 **** --- 55,59 ---- { public: + TEKSTD_HEADER_FUNC_PURE(User); /** Instantizer. Index: TekFileBinary.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileBinary.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C 2 -d -p -r1.6 -r1.7 *** TekFileBinary.cpp 15 Feb 2007 11:08:48 -0000 1.6 --- TekFileBinary.cpp 11 Mar 2007 05:04:47 -0000 1.7 *************** namespace teklti *** 37,43 **** { - #ifndef USE_386_ASM /** Instantizer. --- 37,46 ---- { #ifndef USE_386_ASM + + TEKSTD_SOURCE_FUNC_TYPEI(FileBinary); + + /** Instantizer. *************** Instantizer. *** 45,49 **** FileBinary::FileBinary() { - //TEKSTD_IMPLEMENT_BEGIN(UTekFileBinary) TEKSTD_IMPLEMENT_INTERFACE(UTekFile) TEKSTD_IMPLEMENT_INTERFACE(UTekFileBinary) --- 48,51 ---- Index: TekStd.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekStd.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C 2 -d -p -r1.4 -r1.5 *** TekStd.cpp 26 Feb 2007 20:41:28 -0000 1.4 --- TekStd.cpp 11 Mar 2007 05:04:47 -0000 1.5 *************** teklti::Std::~Std() *** 45,162 **** - unsigned int teklti::Std::AddRef() - { - /* Add a reference to the instance. */ - __instancecount++; - /* Return reference count to the caller. */ - return __instancecount; - } - - TEKERR teklti::Std::CheckFor( - const uuid_t * UUIDArray, - size_t UUIDArraySize, - unsigned short Flags, - void ** RetVal, - unsigned int ** RefCountPtrRet - ) - { - TEKERR result; /* Used to prepare return value. */ - size_t i; /* Used for enumerating UUIDArray. */ - size_t j; /* Used for enumerating this->__uuidarray. */ - - #ifndef NO_SIZE_T_CHECKS - if ( UUIDArray == NULL ) - { - #ifdef DEBUG_USE_FERROR - fprintf( - stderr, - "POTENTIAL SEGFAULT in interface %s, function CheckFor(): UUIDArray is null!\n", - TEKDEBUGSTRING(DBTekStd) - ); - #endif /* DEBUG_USE_FERROR */ - return TEKERR_POINTER; - } - - if ( Flags ) - { - if ( RetVal == NULL ) - { - #ifdef DEBUG_USE_FERROR - fprintf( - stderr, - "POTENTIAL SEGFAULT in interface %s, function CheckFor(): RetVal is null!\n", - TEKDEBUGSTRING(DBTekStd) - ); - #endif /* DEBUG_USE_FERROR */ - return TEKERR_POINTER; - } - } - #endif /* NO_SIZE_T_CHECKS */ - - for ( i=0; i < UUIDArraySize; i++ ) - { - /* - Check our private UUID array to see if UUIDArray[i] - is supported by this instance. - */ - for ( j=0; j < this->__uuidarraycount; j++ ) - if ( uuid_compare(this->__uuidarray[j], UUIDArray[i]) == 0 ) - goto FoundUUID; /* UUIDArray[i] is supported. */ - - /* We get here if UUIDArray[i] was not supported. */ - /* Increment 'i' to help caller make debugging output. */ - i++; - /* Set upper 16 bits to failing UUIDArray element. */ - result = i << (8 * sizeof(short)); - /* Set lower 16 bits to TEKERR_NOTIMPL. */ - result |= TEKERR_NOTIMPL; - /* Return the 'result' value to caller. */ - return result; - FoundUUID: - ; - } - - /* We get here if the checks passed. */ - /* If Flags is set to 1, we are to add a reference and set RetVal. */ - if ( Flags ) - { - /* Add a reference to ourselves. */ - this->AddRef(); - /* Set RetVal to ourselves. */ - *RetVal = this; - } - - /* Return to caller with TEKERR_OK status. That's all folks. */ - return TEKERR_OK; - } - - unsigned int teklti::Std::Release() - { - /* Decrement reference count. */ - __instancecount--; - - /* If instancecount is now zero, we need to delete ourselves. */ - if ( __instancecount == 0 ) - { - /* Delete ourselves. */ - delete this; - /* Return zero to indicate "we no longer exist!" */ - return 0; - } - - /* Return reference count to caller. */ - return __instancecount; - } - - TEKERR teklti::Std::CallFunc( - const uchar_t * FuncName, - void * RetVal, - unsigned short ParamsCount, - void ** Params - ) - { - return TEKERR_NOTIMPL; - } - TEKLTI_DECLSPEC int TekStdAddRef ( --- 45,48 ---- Index: TekFileASCIIBare.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileASCIIBare.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C 2 -d -p -r1.18 -r1.19 *** TekFileASCIIBare.cpp 11 Mar 2007 00:58:15 -0000 1.18 --- TekFileASCIIBare.cpp 11 Mar 2007 05:04:47 -0000 1.19 *************** namespace teklti *** 40,43 **** --- 40,45 ---- { + TEKSTD_SOURCE_FUNC_TYPEI(FileASCIIBare); + FileASCIIBare::FileASCIIBare() { Index: TekFileBZ2Binary.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileBZ2Binary.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C 2 -d -p -r1.13 -r1.14 *** TekFileBZ2Binary.cpp 15 Feb 2007 11:08:48 -0000 1.13 --- TekFileBZ2Binary.cpp 11 Mar 2007 05:04:47 -0000 1.14 *************** namespace teklti *** 56,59 **** --- 56,62 ---- + TEKSTD_SOURCE_FUNC_TYPEI(FileBZ2Binary); + + FileBZ2Binary::FileBZ2Binary() { Index: tekacl.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekacl.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C 2 -d -p -r1.5 -r1.6 *** tekacl.h 4 Mar 2007 02:03:28 -0000 1.5 --- tekacl.h 11 Mar 2007 05:04:47 -0000 1.6 *************** class ACL : public Std *** 43,46 **** --- 43,47 ---- { public: + TEKSTD_HEADER_FUNC_PURE(ACL); /** * Instantizer. Index: tekfileascii.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekfileascii.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C 2 -d -p -r1.8 -r1.9 *** tekfileascii.h 21 Feb 2007 04:55:03 -0000 1.8 --- tekfileascii.h 11 Mar 2007 05:04:47 -0000 1.9 *************** class FileASCII : public File *** 43,46 **** --- 43,47 ---- { public: + TEKSTD_HEADER_FUNC_PURE(FileASCII); /** Index: tekstatfile.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekstatfile.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C 2 -d -p -r1.8 -r1.9 *** tekstatfile.h 11 Feb 2007 00:30:05 -0000 1.8 --- tekstatfile.h 11 Mar 2007 05:04:48 -0000 1.9 *************** class StatFile : public Std *** 49,52 **** --- 49,53 ---- { public: + TEKSTD_HEADER_FUNC_PURE(StatFile); /** Instantizer. Index: tekuserdb.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekuserdb.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C 2 -d -p -r1.14 -r1.15 *** tekuserdb.h 25 Feb 2007 07:48:38 -0000 1.14 --- tekuserdb.h 11 Mar 2007 05:04:48 -0000 1.15 *************** class UserDB : public Enum *** 48,51 **** --- 48,52 ---- { public: + TEKSTD_HEADER_FUNC_PURE(UserDB); /** Instantizer. Index: tekfilebinary.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekfilebinary.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C 2 -d -p -r1.6 -r1.7 *** tekfilebinary.h 15 Feb 2007 11:08:48 -0000 1.6 --- tekfilebinary.h 11 Mar 2007 05:04:47 -0000 1.7 *************** private: *** 48,51 **** --- 48,52 ---- FileType PrivTekFileType; public: + TEKSTD_HEADER_VARSANDFUNC(FileBinary); /** Instantizer. *************** virtual TEKERR get_Location(unsigned lon *** 171,175 **** */ virtual TEKERR get_Location64(uint64_t * Location); - TEKSTD_HEADER_VARS; }; --- 172,175 ---- Index: tekstd.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekstd.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C 2 -d -p -r1.15 -r1.16 *** tekstd.h 22 Feb 2007 23:53:53 -0000 1.15 --- tekstd.h 11 Mar 2007 05:04:48 -0000 1.16 *************** Destructor. *** 64,68 **** Adds a reference to the instance. */ ! virtual unsigned int AddRef(); /** Checks the instance for support of a particular set of interfaces.\n --- 64,68 ---- Adds a reference to the instance. */ ! virtual unsigned int AddRef() = 0; /** Checks the instance for support of a particular set of interfaces.\n *************** virtual TEKERR CheckFor( *** 98,106 **** void ** RetVal = (void **)NULL, unsigned int ** RefCountPtrRet = (unsigned int **)NULL ! ); /** Removes a reference to the instance. */ ! virtual unsigned int Release(); /** Calls a function in the instance. --- 98,106 ---- void ** RetVal = (void **)NULL, unsigned int ** RefCountPtrRet = (unsigned int **)NULL ! ) = 0; /** Removes a reference to the instance. */ ! virtual unsigned int Release() = 0; /** Calls a function in the instance. *************** virtual TEKERR CallFunc( *** 118,122 **** unsigned short ParamsCount, void ** Params ! ); #endif /* not TEKSTD_INTERNAL */ }; --- 118,122 ---- unsigned short ParamsCount, void ** Params ! ) = 0; #endif /* not TEKSTD_INTERNAL */ }; Index: tekuserunixrw.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekuserunixrw.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C 2 -d -p -r1.8 -r1.9 *** tekuserunixrw.h 24 Feb 2007 17:47:11 -0000 1.8 --- tekuserunixrw.h 11 Mar 2007 05:04:48 -0000 1.9 *************** class UserUnixRW : public User *** 44,47 **** --- 44,48 ---- { public: + TEKSTD_HEADER_VARSANDFUNC(UserUnixRW); /** Instantizer. SUInfo is the input. Index: TekUserUnixRW.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekUserUnixRW.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C 2 -d -p -r1.8 -r1.9 *** TekUserUnixRW.cpp 24 Feb 2007 17:47:11 -0000 1.8 --- TekUserUnixRW.cpp 11 Mar 2007 05:04:47 -0000 1.9 *************** namespace teklti *** 35,38 **** --- 35,41 ---- + TEKSTD_SOURCE_FUNC_TYPEI(UserUnixRW); + + UserUnixRW::UserUnixRW() { |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-11 03:56:27
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv14064/src Modified Files: TekFileBinary.386.cpp Log Message: CHANGE: Locations of variables in asm code. Index: TekFileBinary.386.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileBinary.386.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C 2 -d -p -r1.13 -r1.14 *** TekFileBinary.386.cpp 11 Mar 2007 00:58:16 -0000 1.13 --- TekFileBinary.386.cpp 11 Mar 2007 04:03:12 -0000 1.14 *************** FileBinary::FileBinary() *** 68,144 **** TEKSTD_IMPLEMENT_ENDBASE ! #ifdef USE_386_ASM_MMX ! #ifdef USE_386_ASM_MMX_RESET_MM7 ! /* Copy the nullified quadword to mm0. */ ! __asm__ ( " movq %0, %%mm7 " : "=m" (tekzerovar) ); ! #endif /* USE_386_ASM_MMX_RESET_MM7 */ ! /* Obtain our private section of local variables. */ ! __asm__ ( " movl 8(%ebp), %ecx " ); ! #ifdef UNICODE ! /* Copy the null quadword to the ascii variables. */ ! __asm__ ( " movq %mm7, 76(%ecx) " ); ! /* Copy the null quadword to the unicode variables. */ ! __asm__ ( " movq %mm7, 84(%ecx) " ); ! /* then into PrivFileDesc/PrivFileMode */ ! __asm__ ( " movq %mm7, 92(%ecx) " ); ! /* and finally into PrivTekFileType. */ ! __asm__ ( " movd %mm7, 100(%ecx) " ); ! #else /* not UNICODE */ ! /* Copy the null quadword to the ascii variables. */ ! __asm__ ( " movq %mm7, 76(%ecx) " ); ! /* then into PrivFileDesc/PrivFileMode */ ! __asm__ ( " movq %mm7, 84(%ecx) " ); ! /* and finally into PrivTekFileType. */ ! __asm__ ( " movd %mm7, 92(%ecx) " ); ! #endif /* not UNICODE */ ! /* Be sure to exit the mmx state before leaving. */ ! __asm__ ( " emms " ); ! #else /* not USE_386_ASM_MMX */ ! /* If we're here, we are not using mmx. */ ! #ifdef USE_386_ASM_PUSHPOP ! /* Save the current value of edi if necessary. */ ! __asm__ ( " pushl %edi " ); ! #endif /* USE_386_ASM_PUSHPOP */ - /* Obtain our private section of local variables. */ - __asm__ ( " movl 8(%ebp), %edi " ); ! /* Set ax = 0. */ ! __asm__ ( " xorl %eax, %eax " ); ! /* Add 76 to edi for alignment with our private members. */ ! __asm__ ( " addl $76, %edi " ); ! /* Set up ecx as appropriate. */ ! #ifdef UNICODE ! __asm__ ( " movl $7, %ecx " ); ! #else /* not UNICODE */ ! __asm__ ( " movl $5, %ecx " ); ! #endif /* not UNICODE */ ! /* Call the stosl function until the area in ecx is nullified. */ ! __asm__ ( " rep stosl " ); ! #ifdef USE_386_ASM_PUSHPOP ! /* Be sure to pop edi off the stack if we saved it earlier. */ ! __asm__ ( " popl %edi " ); ! #endif /* USE_386_ASM_PUSHPOP */ ! #endif /* not USE_386_ASM_MMX */ } /** Destructor. - - FIXME: Convert this function to assembly. */ FileBinary::~FileBinary() { ! if ( this->PrivFileDesc != NULL ) ! fclose(this->PrivFileDesc); ! if ( this->PrivFileName.uchar_t_ascii != NULL ) ! free(this->PrivFileName.uchar_t_ascii); } --- 68,125 ---- TEKSTD_IMPLEMENT_ENDBASE ! /* Get the value of 'this' ptr into ecx. */ ! __asm__ ( " int $3 " ); ! __asm__ ( " movl %1, %%ecx " : "=m" (_tfbtmp) : "X" (this) ); ! /* Set this->PrivFileDesc to NULL. */ ! __asm__ ( " movl $0, 396(%ecx) " ); ! /* Set this->PrivFileMode to zero. */ ! __asm__ ( " movl $0, 400(%ecx) " ); ! /* Set this->PrivTekFileType to zero. */ ! __asm__ ( " movl $0, 404(%ecx) " ); ! } ! #ifdef TEKLTI_DEFINE_OUTSIDECODE_FUNC ! static void FileBinaryDestruct() ! { ! #endif /* TEKLTI_DEFINE_OUTSIDECODE_FUNC */ ! /* Function start label. */ ! __asm__ ( " .Destructor_TekFileBinary: " ); ! /* Run the NULL test. */ ! __asm__ ( " testl %ecx, %ecx " ); ! /* Skip the file closure if there's nothing to close. */ ! __asm__ ( " je .Destructor_TekFileBinary_Skip_fclose " ); ! /* Push the PrivFileDesc */ ! __asm__ ( " pushl %ecx " ); ! /* Call fclose(). */ ! __asm__ ( " call fclose " ); ! /* Take care of the stack frame. */ ! __asm__ ( " addl $4, %esp " ); ! /* Skip file closure label. */ ! __asm__ ( " .Destructor_TekFileBinary_Skip_fclose: " ); ! ! /* Return to caller. */ ! __asm__ ( " ret " ); ! #ifdef TEKLTI_DEFINE_OUTSIDECODE_FUNC } + #endif /* TEKLTI_DEFINE_OUTSIDECODE_FUNC */ /** Destructor. */ FileBinary::~FileBinary() { ! __asm__ ( " int $3 " ); ! /* Get the value of this->PrivFileDesc. */ ! __asm__ ( " movl %0, %%ecx " : "=m" (this->PrivFileDesc) ); ! /* Call our private destructor. */ ! __asm__ ( " call .Destructor_TekFileBinary " ); } *************** TEKERR FileBinary::ConvertToPipe() *** 164,168 **** __asm__ ( " movl 8(%ebp), %ecx " ); /* Set this->PrivTekFileType to TekFileType_BinaryPipe. */ ! __asm__ ( " movl %1, 92(%%ecx) " : "=m" (_tfbtmp) : "i" (TekFileType_BinaryPipe) --- 145,149 ---- __asm__ ( " movl 8(%ebp), %ecx " ); /* Set this->PrivTekFileType to TekFileType_BinaryPipe. */ ! __asm__ ( " movl %1, 404(%%ecx) " : "=m" (_tfbtmp) : "i" (TekFileType_BinaryPipe) |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-11 00:52:17
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv2630/src Modified Files: dbunixproc.c Log Message: FIX: Improper error checking of strtol()s. Index: dbunixproc.c =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/dbunixproc.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C 2 -d -p -r1.4 -r1.5 *** dbunixproc.c 15 Feb 2007 11:08:48 -0000 1.4 --- dbunixproc.c 11 Mar 2007 00:59:28 -0000 1.5 *************** int teklti_retrieve_userdbline_results ( *** 107,113 **** --- 107,117 ---- ) { + char * errbuf; unsigned int i; unsigned int j; + /* Make sure errbuf is NULL. */ + errbuf = NULL; + /* First, get the username. */ uinfo->TekUserInfo_Username = char2uchar(line); *************** int teklti_retrieve_userdbline_results ( *** 140,146 **** /* Now, let's process the user id. */ ! uinfo->TekUserInfo_UserID = (uid_t)strtol(line, NULL, 0); ! if ( errno ) ! return 1; /* Let's find the next NULL. */ --- 144,151 ---- /* Now, let's process the user id. */ ! uinfo->TekUserInfo_UserID = (uid_t)strtol(line, &errbuf, 0); ! if ( errbuf != NULL ) ! if ( *errbuf != '\0' ) ! return 1; /* Let's find the next NULL. */ *************** int teklti_retrieve_userdbline_results ( *** 159,165 **** /* Now, let's process the group id. */ ! uinfo->TekUserInfo_GroupID = (gid_t)strtol(line, NULL, 0); ! if ( errno ) ! return 1; /* Let's find the next NULL. */ --- 164,171 ---- /* Now, let's process the group id. */ ! uinfo->TekUserInfo_GroupID = (gid_t)strtol(line, &errbuf, 0); ! if ( errbuf != NULL ) ! if ( *errbuf != '\0' ) ! return 1; /* Let's find the next NULL. */ *************** char * teklti_find_userdbline_username ( *** 304,314 **** char * teklti_find_userdbline_uid ( char * line, uid_t userid ) { char * tmp; unsigned int i; unsigned long j; ! /* Make sure j is reset. */ j = 0; i = 0; /* Let's compare the usernames. */ --- 310,322 ---- char * teklti_find_userdbline_uid ( char * line, uid_t userid ) { + char * errbuf; char * tmp; unsigned int i; unsigned long j; ! /* Make sure j, i, and errbuf are reset. */ j = 0; i = 0; + errbuf = NULL; /* Let's compare the usernames. */ *************** char * teklti_find_userdbline_uid ( char *** 323,330 **** { /* Convert the string to a unsigned long. */ ! j = strtoul(line, NULL, 0); /* Check to see if it's corrupt. */ ! /*if ( errno ) ! return (char *)-1;*/ /* Comare the userid. */ if ( j == (unsigned long)userid ) --- 331,339 ---- { /* Convert the string to a unsigned long. */ ! j = strtoul(line, &errbuf, 0); /* Check to see if it's corrupt. */ ! if ( errbuf != NULL ) ! if ( *errbuf != '\0' ) ! return NULL; /* Comare the userid. */ if ( j == (unsigned long)userid ) |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-11 00:51:31
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv2607/src Modified Files: TekFileASCIIBare.386.cpp TekFileASCIIBare.cpp TekFileBinary.386.cpp testsuite-err.cpp Log Message: FIX: Made assembly code compilable. Index: TekFileBinary.386.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileBinary.386.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C 2 -d -p -r1.12 -r1.13 *** TekFileBinary.386.cpp 12 Feb 2007 09:56:47 -0000 1.12 --- TekFileBinary.386.cpp 11 Mar 2007 00:58:16 -0000 1.13 *************** namespace teklti *** 40,57 **** //#ifdef TEKLTI_OBSERVE_BINARY_FILE_MODE ! const char TekFileBinary_ReadOnly[] = "rb"; ! const char TekFileBinary_WriteOnly[] = "wb"; ! const char TekFileBinary_Append[] = "ab"; ! const char TekFileBinary_ReadWrite[] = "r+b"; ! const char TekFileBinary_ReadWriteTrunc[] = "w+b"; ! const char TekFileBinary_ReadAppend[] = "a+b"; //#else /* not TEKLTI_OBSERVE_BINARY_FILE_MODE */ [...2032 lines suppressed...] /*! ! \fn TekFileBinary::get_Location64(uint64_t * Location) Retrieves the location and stores it in a 64-bit variable. */ ! TEKERR TekFileBinary::get_Location64(uint64_t * Location) { return TEKERR_NOTIMPL; --- 1605,1614 ---- /*! ! \fn FileBinary::get_Location64(uint64_t * Location) Retrieves the location and stores it in a 64-bit variable. */ ! TEKERR FileBinary::get_Location64(uint64_t * Location) { return TEKERR_NOTIMPL; Index: TekFileASCIIBare.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileASCIIBare.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C 2 -d -p -r1.17 -r1.18 *** TekFileASCIIBare.cpp 15 Feb 2007 11:08:48 -0000 1.17 --- TekFileASCIIBare.cpp 11 Mar 2007 00:58:15 -0000 1.18 *************** TEKERR FileASCIIBare::get_Location64(uin *** 726,731 **** - #endif /* not USE_386_ASM */ - } --- 726,730 ---- } + #endif /* not USE_386_ASM */ Index: testsuite-err.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/testsuite-err.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C 2 -d -p -r1.6 -r1.7 *** testsuite-err.cpp 28 Feb 2007 19:41:56 -0000 1.6 --- testsuite-err.cpp 11 Mar 2007 00:58:16 -0000 1.7 *************** void checkprocessor ( void ) *** 236,240 **** { #ifdef TEKLTI_USE_386_ASM ! struct TekStdProcessorInfoIntel tekgen[3]; TEKERR tekerr; --- 236,240 ---- { #ifdef TEKLTI_USE_386_ASM ! /* struct TekStdProcessorInfo tekgen[3]; TEKERR tekerr; *************** void checkprocessor ( void ) *** 242,247 **** --- 242,249 ---- if ( tekerr != TEKERR_OK ) exit(EXIT_FAILURE); + */ #endif /* TEKLTI_USE_386_ASM */ + /* This is currently a do-nothing function. */ return; } Index: TekFileASCIIBare.386.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/TekFileASCIIBare.386.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C 2 -d -p -r1.10 -r1.11 *** TekFileASCIIBare.386.cpp 10 Feb 2007 10:34:41 -0000 1.10 --- TekFileASCIIBare.386.cpp 11 Mar 2007 00:58:15 -0000 1.11 *************** *** 35,51 **** static const void * _tfbtmp = NULL; ! const char TekFileASCIIBare_ReadOnly[] = "rb"; ! const char TekFileASCIIBare_WriteOnly[] = "wb"; ! const char TekFileASCIIBare_Append[] = "ab"; ! const char TekFileASCIIBare_ReadWrite[] = "r+b"; ! const char TekFileASCIIBare_ReadWriteTrunc[] = "w+b"; ! const char TekFileASCIIBare_ReadAppend[] = "a+b"; ! /*extern const char TekFileASCIIBare_ReadOnly[] = "r"; [...2659 lines suppressed...] /*! ! \fn TekFileASCIIBare::get_Location64(uint64_t * Location) Retrieves the location and stores it in a 64-bit variable. */ ! TEKERR teklti::TekFileASCIIBare::get_Location64( uint64_t * Location ) --- 2419,2428 ---- /*! ! \fn FileASCIIBare::get_Location64(uint64_t * Location) Retrieves the location and stores it in a 64-bit variable. */ ! TEKERR teklti::FileASCIIBare::get_Location64( uint64_t * Location ) |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-04 02:23:24
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv27646/src Modified Files: tekltifrm.cpp Log Message: ADD: Comments inside the low-level ACL test function. Index: tekltifrm.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekltifrm.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C 2 -d -p -r1.19 -r1.20 *** tekltifrm.cpp 28 Feb 2007 19:41:56 -0000 1.19 --- tekltifrm.cpp 4 Mar 2007 02:29:41 -0000 1.20 *************** static void testdesc() *** 67,74 **** --- 67,76 ---- uint32_t i; + /* First off, let's open the descriptor. */ hacl = aclunix_opendesc(NULL, 1); if ( hacl == NULL ) raise(SIGUSR1); + /* Second, let's set up the defaults in the fields. */ memset(&aclhdr, '\0', sizeof(aclunix_aclheader)); strcpy(aclhdr.aclunix_aclheader_filename, "tekltifrm"); *************** static void testdesc() *** 83,99 **** --- 85,107 ---- acehdr[1]->aclunix_aceheader_perms = 0x0000000000000001; + /* Write out the initial descriptor information. */ if ( !aclunix_writenewdesc(hacl, &aclhdr, acehdr, 2) ) raise(SIGUSR1); + /* Get ready to write out the descriptor amendment. */ acehdr[0]->aclunix_aceheader_uid = 0; acehdr[0]->aclunix_aceheader_gid = getgid(); + /* Amend it. */ if ( !aclunix_writeace(hacl, &aclhdr, acehdr, 1) ) raise(SIGUSR1); + /* Count up the ACEs. */ if ( !aclunix_acecount(hacl, &aclhdr, &numaces, NULL, NULL, NULL) ) raise(SIGUSR1); + /* Check the count to make sure we don't overrun the ptr buf. */ if ( numaces > sizeof(acehdr2) ) raise(SIGUSR1); + /* Allocate the buffers onto the ptr buf. */ for ( i=0; i < numaces; i++ ) { *************** static void testdesc() *** 103,111 **** --- 111,122 ---- abort(); } + /* Retrieve a copy of the ACEs. */ if ( !aclunix_acecount(hacl, &aclhdr, &numaces, acehdr2, NULL, NULL) ) raise(SIGUSR1); + /* Retrieve a copy of the extended information. */ if ( !aclunix_getacl_extinfo(hacl, &aclhdr) ) raise(SIGUSR1); + /* Print out the results. */ fprintf( stdout, *************** static void testdesc() *** 113,116 **** --- 124,132 ---- aclhdr.aclunix_aclheader_filename ); + fprintf( + debugfil, + "ACL Output for %s\n", + aclhdr.aclunix_aclheader_filename + ); fprintf( *************** static void testdesc() *** 119,122 **** --- 135,143 ---- aclhdr.aclunix_aclheader_flags ); + fprintf( + debugfil, + "aclhdr.aclunix_aclheader_flags = %d\n", + aclhdr.aclunix_aclheader_flags + ); for ( i=0; i < numaces; i++ ) *************** static void testdesc() *** 140,147 **** --- 161,191 ---- acehdr2[i]->aclunix_aceheader_perms ); + fprintf( + debugfil, + "acehdr2[%d]->aclunix_aceheader_uid = %u\n", + i, + acehdr2[i]->aclunix_aceheader_uid + ); + fprintf( + debugfil, + "acehdr2[%d]->aclunix_aceheader_gid = %u\n", + i, + acehdr2[i]->aclunix_aceheader_gid + ); + fprintf( + debugfil, + "acehdr2[%d]->aclunix_aceheader_perms = %.16LX\n", + i, + acehdr2[i]->aclunix_aceheader_perms + ); free(acehdr2[i]); } + /* Write out a blank line. */ + fprintf(stdout, "\n"); + fprintf(debugfil, "\n"); + + /* Close the descriptor and clean up. */ aclunix_closedesc(hacl); unlink("./.tekltiacl"); *************** int main(int argc, char *argv[]) *** 259,262 **** --- 303,311 ---- initteklti(); + /* We're in: begin the testsuite. */ + + fprintf(stdout, "\n\nWelcome to the libTekLTI Testsuite.\n"); + fprintf(stdout, "Results will be written to ./testsuite.out\n\n"); + /* Set up our signal handlers for the worst. */ sigemptyset(&signos); *************** int main(int argc, char *argv[]) *** 360,369 **** #endif /* TEKLTI_EAL4 */ - - /* We're in: begin the testsuite. */ - - fprintf(stdout, "\n\nWelcome to the libTekLTI Testsuite.\n"); - fprintf(stdout, "Results will be written to ./testsuite.out\n\n"); - TEKSLEEP; --- 409,412 ---- |
From: Kevin's C. B. A. <kev...@pl...> - 2007-03-04 01:57:22
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv27104/src Modified Files: tekacl.h Log Message: FIX: Fixed up spelling mistakes of variables in ACL header. Index: tekacl.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekacl.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C 2 -d -p -r1.4 -r1.5 *** tekacl.h 11 Feb 2007 00:30:05 -0000 1.4 --- tekacl.h 4 Mar 2007 02:03:28 -0000 1.5 *************** public: *** 58,62 **** * \param[in] InfoToCheck Information about a user to * verify against the contained ACL. If ! * TekACE.TekACE_UserInfo is NULL (the default), the * current user's TekUser instance from * \ref TekGetCurrentUser will be used instead. --- 58,62 ---- * \param[in] InfoToCheck Information about a user to * verify against the contained ACL. If ! * \ref TekACE.TekACE_UserInfo is NULL (the default), the * current user's TekUser instance from * \ref TekGetCurrentUser will be used instead. *************** public: *** 78,87 **** * Sets a new ACE into the interface instance. */ ! virtual TEKERR put_ACE(PTekACE ACE) = 0; /** * Sets a new set of ACEs into the interface instance. */ ! virtual TEKERR put_MultipleACE(TekArray * ACLs) = 0; }; --- 78,87 ---- * Sets a new ACE into the interface instance. */ ! virtual TEKERR put_ACE(PTekACE TheACE) = 0; /** * Sets a new set of ACEs into the interface instance. */ ! virtual TEKERR put_MultipleACE(TekArray * TheACEs) = 0; }; |
From: Kevin's C. B. A. <kev...@pl...> - 2007-02-28 19:36:49
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv23472/src Modified Files: aclunix.c Log Message: FIX: Improper writing of uid_t and gid_t. Index: aclunix.c =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/aclunix.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C 2 -d -p -r1.5 -r1.6 *** aclunix.c 28 Feb 2007 10:36:25 -0000 1.5 --- aclunix.c 28 Feb 2007 19:42:59 -0000 1.6 *************** TEKLTI_DECLSPEC int aclunix_writeace ( *** 715,721 **** aent._aceent_magic = _ent_magic_aceent_v1; if ( newace[i]->aclunix_aceheader_uid != 0 ) aent._aceent_uid = newace[i]->aclunix_aceheader_uid; ! else aent._aceent_gid = newace[i]->aclunix_aceheader_gid; aent._aceent_perms = newace[i]->aclunix_aceheader_perms; aent._aceent_next_aceloc = 0; --- 715,725 ---- aent._aceent_magic = _ent_magic_aceent_v1; if ( newace[i]->aclunix_aceheader_uid != 0 ) + { aent._aceent_uid = newace[i]->aclunix_aceheader_uid; ! aent._aceent_gid = 0; ! } else { ! aent._aceent_uid = 0; aent._aceent_gid = newace[i]->aclunix_aceheader_gid; + } aent._aceent_perms = newace[i]->aclunix_aceheader_perms; aent._aceent_next_aceloc = 0; *************** TEKLTI_DECLSPEC int aclunix_writenewdesc *** 873,879 **** aent._aceent_magic = _ent_magic_aceent_v1; if ( newace[0]->aclunix_aceheader_uid != 0 ) aent._aceent_uid = newace[0]->aclunix_aceheader_uid; ! else aent._aceent_gid = newace[0]->aclunix_aceheader_gid; aent._aceent_perms = newace[0]->aclunix_aceheader_perms; GETTEKUUID(tekfileaceuuid, aent._aceent_uuid); --- 877,887 ---- aent._aceent_magic = _ent_magic_aceent_v1; if ( newace[0]->aclunix_aceheader_uid != 0 ) + { aent._aceent_uid = newace[0]->aclunix_aceheader_uid; ! aent._aceent_gid = 0; ! } else { ! aent._aceent_uid = 0; aent._aceent_gid = newace[0]->aclunix_aceheader_gid; + } aent._aceent_perms = newace[0]->aclunix_aceheader_perms; GETTEKUUID(tekfileaceuuid, aent._aceent_uuid); *************** TEKLTI_DECLSPEC int aclunix_writenewdesc *** 936,942 **** aent._aceent_magic = _ent_magic_aceent_v1; if ( newace[i]->aclunix_aceheader_uid != 0 ) aent._aceent_uid = newace[i]->aclunix_aceheader_uid; ! else aent._aceent_gid = newace[i]->aclunix_aceheader_gid; aent._aceent_perms = newace[i]->aclunix_aceheader_perms; aent._aceent_next_aceloc = 0; --- 944,954 ---- aent._aceent_magic = _ent_magic_aceent_v1; if ( newace[i]->aclunix_aceheader_uid != 0 ) + { aent._aceent_uid = newace[i]->aclunix_aceheader_uid; ! aent._aceent_gid = 0; ! } else { ! aent._aceent_uid = 0; aent._aceent_gid = newace[i]->aclunix_aceheader_gid; + } aent._aceent_perms = newace[i]->aclunix_aceheader_perms; aent._aceent_next_aceloc = 0; |
From: Kevin M. <ke...@pl...> - 2007-02-28 19:35:48
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv23448/src Modified Files: tekltifrm.cpp testsuite-err.cpp Log Message: ADD: SIGUSR1 raising for File ACL failure. Index: tekltifrm.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekltifrm.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C 2 -d -p -r1.18 -r1.19 *** tekltifrm.cpp 28 Feb 2007 10:36:25 -0000 1.18 --- tekltifrm.cpp 28 Feb 2007 19:41:56 -0000 1.19 *************** static void testdesc() *** 69,73 **** hacl = aclunix_opendesc(NULL, 1); if ( hacl == NULL ) ! exit(1); memset(&aclhdr, '\0', sizeof(aclunix_aclheader)); --- 69,73 ---- hacl = aclunix_opendesc(NULL, 1); if ( hacl == NULL ) ! raise(SIGUSR1); memset(&aclhdr, '\0', sizeof(aclunix_aclheader)); *************** static void testdesc() *** 76,86 **** acehdr[0] = (aclunix_aceheader *)alloca(sizeof(aclunix_aceheader)); acehdr[1] = (aclunix_aceheader *)alloca(sizeof(aclunix_aceheader)); acehdr[0]->aclunix_aceheader_uid = getuid(); acehdr[0]->aclunix_aceheader_perms = 0x0000000000000001; ! acehdr[1]->aclunix_aceheader_gid = getuid() + 1; acehdr[1]->aclunix_aceheader_perms = 0x0000000000000001; if ( !aclunix_writenewdesc(hacl, &aclhdr, acehdr, 2) ) ! exit(1); acehdr[0]->aclunix_aceheader_uid = 0; --- 76,88 ---- acehdr[0] = (aclunix_aceheader *)alloca(sizeof(aclunix_aceheader)); acehdr[1] = (aclunix_aceheader *)alloca(sizeof(aclunix_aceheader)); + memset(acehdr[0], '\0', sizeof(aclunix_aceheader)); + memset(acehdr[1], '\0', sizeof(aclunix_aceheader)); acehdr[0]->aclunix_aceheader_uid = getuid(); acehdr[0]->aclunix_aceheader_perms = 0x0000000000000001; ! acehdr[1]->aclunix_aceheader_gid = getgid() + 1; acehdr[1]->aclunix_aceheader_perms = 0x0000000000000001; if ( !aclunix_writenewdesc(hacl, &aclhdr, acehdr, 2) ) ! raise(SIGUSR1); acehdr[0]->aclunix_aceheader_uid = 0; *************** static void testdesc() *** 88,97 **** if ( !aclunix_writeace(hacl, &aclhdr, acehdr, 1) ) ! exit(1); if ( !aclunix_acecount(hacl, &aclhdr, &numaces, NULL, NULL, NULL) ) ! exit(1); if ( numaces > sizeof(acehdr2) ) ! exit(1); for ( i=0; i < numaces; i++ ) { --- 90,99 ---- if ( !aclunix_writeace(hacl, &aclhdr, acehdr, 1) ) ! raise(SIGUSR1); if ( !aclunix_acecount(hacl, &aclhdr, &numaces, NULL, NULL, NULL) ) ! raise(SIGUSR1); if ( numaces > sizeof(acehdr2) ) ! raise(SIGUSR1); for ( i=0; i < numaces; i++ ) { *************** static void testdesc() *** 102,108 **** } if ( !aclunix_acecount(hacl, &aclhdr, &numaces, acehdr2, NULL, NULL) ) ! exit(1); if ( !aclunix_getacl_extinfo(hacl, &aclhdr) ) ! exit(1); fprintf( --- 104,110 ---- } if ( !aclunix_acecount(hacl, &aclhdr, &numaces, acehdr2, NULL, NULL) ) ! raise(SIGUSR1); if ( !aclunix_getacl_extinfo(hacl, &aclhdr) ) ! raise(SIGUSR1); fprintf( *************** static void testdesc() *** 144,148 **** aclunix_closedesc(hacl); unlink("./.tekltiacl"); ! exit(0); } #endif /* TEKLTI_EAL4 */ --- 146,150 ---- aclunix_closedesc(hacl); unlink("./.tekltiacl"); ! return; } #endif /* TEKLTI_EAL4 */ *************** int main(int argc, char *argv[]) *** 339,342 **** --- 341,345 ---- sigaction(SIGSEGV, &oldactsegv, NULL); sigaction(SIGILL, &oldactill, NULL); + sigaction(SIGUSR1, &oldactusr1, NULL); #ifdef TEKLTI_EAL4 *************** int main(int argc, char *argv[]) *** 348,351 **** --- 351,355 ---- sigaction(SIGSEGV, &newact, &oldactsegv); sigaction(SIGILL, &newact, &oldactill); + sigaction(SIGUSR1, &newact, &oldactill); testdesc(); Index: testsuite-err.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/testsuite-err.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C 2 -d -p -r1.5 -r1.6 *** testsuite-err.cpp 28 Feb 2007 09:54:05 -0000 1.5 --- testsuite-err.cpp 28 Feb 2007 19:41:56 -0000 1.6 *************** void eal4_sigsegv ( int signum ) *** 109,116 **** default: { ! fprintf(stderr, "ERROR: Unknown signal caught.\n"); break; } } exit(EXIT_FAILURE); } --- 109,118 ---- default: { ! fprintf(stderr, "ERROR: Unknown signal caught in the low-level File ACL functions.\n"); break; } } + + unlink("./.tekltiacl"); exit(EXIT_FAILURE); } |
From: Kevin's C. B. A. <kev...@pl...> - 2007-02-28 10:30:19
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv5780/src Modified Files: aclunix.c teklti.h tekltifrm.cpp Log Message: ADD: gid_t field to File ACE. Index: aclunix.c =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/aclunix.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C 2 -d -p -r1.4 -r1.5 *** aclunix.c 28 Feb 2007 09:54:04 -0000 1.4 --- aclunix.c 28 Feb 2007 10:36:25 -0000 1.5 *************** typedef struct _aceent_v1 *** 55,62 **** uint32_t _aceent_magic; uint64_t _aceent_uid; uint64_t _aceent_perms; uint64_t _aceent_next_aceloc; uuid_t _aceent_uuid; ! uint8_t _aceent_empty[980]; } __aceent_v1; #endif /* not DOXYGEN_BUILD */ --- 55,63 ---- uint32_t _aceent_magic; uint64_t _aceent_uid; + uint64_t _aceent_gid; uint64_t _aceent_perms; uint64_t _aceent_next_aceloc; uuid_t _aceent_uuid; ! uint8_t _aceent_empty[972]; } __aceent_v1; #endif /* not DOXYGEN_BUILD */ *************** AceCountPass: *** 591,596 **** if ( retval != NULL ) { ! retval[_numaces]->aclunix_aceheader_uid = ! ace1._aceent_uid; retval[_numaces]->aclunix_aceheader_perms = ace1._aceent_perms; --- 592,605 ---- if ( retval != NULL ) { ! if ( retval[_numaces]->aclunix_aceheader_uid != 0 ) ! { ! retval[_numaces]->aclunix_aceheader_uid = ! ace1._aceent_uid; ! retval[_numaces]->aclunix_aceheader_gid = 0; ! } else { ! retval[_numaces]->aclunix_aceheader_uid = 0; ! retval[_numaces]->aclunix_aceheader_gid = ! ace1._aceent_gid; ! } retval[_numaces]->aclunix_aceheader_perms = ace1._aceent_perms; *************** TEKLTI_DECLSPEC int aclunix_writeace ( *** 705,709 **** /* Set the info onto the ACE. */ aent._aceent_magic = _ent_magic_aceent_v1; ! aent._aceent_uid = newace[i]->aclunix_aceheader_uid; aent._aceent_perms = newace[i]->aclunix_aceheader_perms; aent._aceent_next_aceloc = 0; --- 714,721 ---- /* Set the info onto the ACE. */ aent._aceent_magic = _ent_magic_aceent_v1; ! if ( newace[i]->aclunix_aceheader_uid != 0 ) ! aent._aceent_uid = newace[i]->aclunix_aceheader_uid; ! else ! aent._aceent_gid = newace[i]->aclunix_aceheader_gid; aent._aceent_perms = newace[i]->aclunix_aceheader_perms; aent._aceent_next_aceloc = 0; *************** TEKLTI_DECLSPEC int aclunix_writenewdesc *** 860,864 **** /* Set the info onto the ACE. */ aent._aceent_magic = _ent_magic_aceent_v1; ! aent._aceent_uid = newace[0]->aclunix_aceheader_uid; aent._aceent_perms = newace[0]->aclunix_aceheader_perms; GETTEKUUID(tekfileaceuuid, aent._aceent_uuid); --- 872,879 ---- /* Set the info onto the ACE. */ aent._aceent_magic = _ent_magic_aceent_v1; ! if ( newace[0]->aclunix_aceheader_uid != 0 ) ! aent._aceent_uid = newace[0]->aclunix_aceheader_uid; ! else ! aent._aceent_gid = newace[0]->aclunix_aceheader_gid; aent._aceent_perms = newace[0]->aclunix_aceheader_perms; GETTEKUUID(tekfileaceuuid, aent._aceent_uuid); *************** TEKLTI_DECLSPEC int aclunix_writenewdesc *** 920,924 **** /* Set the info onto the ACE. */ aent._aceent_magic = _ent_magic_aceent_v1; ! aent._aceent_uid = newace[i]->aclunix_aceheader_uid; aent._aceent_perms = newace[i]->aclunix_aceheader_perms; aent._aceent_next_aceloc = 0; --- 935,942 ---- /* Set the info onto the ACE. */ aent._aceent_magic = _ent_magic_aceent_v1; ! if ( newace[i]->aclunix_aceheader_uid != 0 ) ! aent._aceent_uid = newace[i]->aclunix_aceheader_uid; ! else ! aent._aceent_gid = newace[i]->aclunix_aceheader_gid; aent._aceent_perms = newace[i]->aclunix_aceheader_perms; aent._aceent_next_aceloc = 0; Index: tekltifrm.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekltifrm.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C 2 -d -p -r1.17 -r1.18 *** tekltifrm.cpp 28 Feb 2007 09:54:05 -0000 1.17 --- tekltifrm.cpp 28 Feb 2007 10:36:25 -0000 1.18 *************** static void testdesc() *** 78,82 **** acehdr[0]->aclunix_aceheader_uid = getuid(); acehdr[0]->aclunix_aceheader_perms = 0x0000000000000001; ! acehdr[1]->aclunix_aceheader_uid = getuid() + 1; acehdr[1]->aclunix_aceheader_perms = 0x0000000000000001; --- 78,82 ---- acehdr[0]->aclunix_aceheader_uid = getuid(); acehdr[0]->aclunix_aceheader_perms = 0x0000000000000001; ! acehdr[1]->aclunix_aceheader_gid = getuid() + 1; acehdr[1]->aclunix_aceheader_perms = 0x0000000000000001; *************** static void testdesc() *** 84,88 **** exit(1); ! acehdr[0]->aclunix_aceheader_uid += 2; if ( !aclunix_writeace(hacl, &aclhdr, acehdr, 1) ) --- 84,89 ---- exit(1); ! acehdr[0]->aclunix_aceheader_uid = 0; ! acehdr[0]->aclunix_aceheader_gid = getgid(); if ( !aclunix_writeace(hacl, &aclhdr, acehdr, 1) ) *************** static void testdesc() *** 127,130 **** --- 128,137 ---- fprintf( stdout, + "acehdr2[%d]->aclunix_aceheader_gid = %u\n", + i, + acehdr2[i]->aclunix_aceheader_gid + ); + fprintf( + stdout, "acehdr2[%d]->aclunix_aceheader_perms = %.16LX\n", i, Index: teklti.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/teklti.h,v retrieving revision 1.68 retrieving revision 1.69 diff -C 2 -d -p -r1.68 -r1.69 *** teklti.h 28 Feb 2007 09:54:04 -0000 1.68 --- teklti.h 28 Feb 2007 10:36:25 -0000 1.69 *************** typedef struct _aclunix_aceheader *** 1281,1284 **** --- 1281,1285 ---- { uid_t aclunix_aceheader_uid; + gid_t aclunix_aceheader_gid; uint64_t aclunix_aceheader_perms; } aclunix_aceheader; |
From: Kevin's C. B. A. <kev...@pl...> - 2007-02-28 09:48:01
|
Update of /cvsroot/libteklti/libteklti/src In directory planetsaphire.com:/tmp/cvs-serv4075/src Modified Files: aclunix.c teklti.h tekltifrm.cpp testsuite-err.cpp testsuite-tekstd.cpp testsuite.h Log Message: ADD: Low-level code for the File ACL. Index: testsuite.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/testsuite.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C 2 -d -p -r1.11 -r1.12 *** testsuite.h 12 Feb 2007 09:56:47 -0000 1.11 --- testsuite.h 28 Feb 2007 09:54:05 -0000 1.12 *************** int processorcheckfail ( void ); *** 104,107 **** --- 104,108 ---- void checkprocessor ( void ); void uchar_sigsegv ( int signum ); + void eal4_sigsegv ( int signum ); void verstructfatal ( void ); void incorrectverfatal ( void ); Index: testsuite-tekstd.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/testsuite-tekstd.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C 2 -d -p -r1.3 -r1.4 *** testsuite-tekstd.cpp 11 Feb 2007 07:52:38 -0000 1.3 --- testsuite-tekstd.cpp 28 Feb 2007 09:54:05 -0000 1.4 *************** int runtekstdtests ( struct sigaction * *** 68,74 **** PRINTHUNK(1, "Create an instance of a TekStd-derived interface") - /* Restore the sigactions back to what they were */ - sigaction(SIGSEGV, oldactsegv, NULL); - sigaction(SIGILL, oldactill, NULL); ct = new TekFileBinary; PRINTPASS(bi, 1); --- 68,71 ---- Index: tekltifrm.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/tekltifrm.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C 2 -d -p -r1.16 -r1.17 *** tekltifrm.cpp 12 Feb 2007 11:31:46 -0000 1.16 --- tekltifrm.cpp 28 Feb 2007 09:54:05 -0000 1.17 *************** static int checkbz2() *** 57,60 **** --- 57,145 ---- + #ifdef TEKLTI_EAL4 + static void testdesc() + { + aclunix_aclheader aclhdr; + aclunix_aceheader * acehdr[3]; + aclunix_aceheader * acehdr2[10]; + aclunix_handle * hacl; + uint64_t numaces; + uint32_t i; + + hacl = aclunix_opendesc(NULL, 1); + if ( hacl == NULL ) + exit(1); + + memset(&aclhdr, '\0', sizeof(aclunix_aclheader)); + strcpy(aclhdr.aclunix_aclheader_filename, "tekltifrm"); + aclhdr.aclunix_aclheader_flags = aclunix_fileflag_inherit; + acehdr[0] = (aclunix_aceheader *)alloca(sizeof(aclunix_aceheader)); + acehdr[1] = (aclunix_aceheader *)alloca(sizeof(aclunix_aceheader)); + acehdr[0]->aclunix_aceheader_uid = getuid(); + acehdr[0]->aclunix_aceheader_perms = 0x0000000000000001; + acehdr[1]->aclunix_aceheader_uid = getuid() + 1; + acehdr[1]->aclunix_aceheader_perms = 0x0000000000000001; + + if ( !aclunix_writenewdesc(hacl, &aclhdr, acehdr, 2) ) + exit(1); + + acehdr[0]->aclunix_aceheader_uid += 2; + + if ( !aclunix_writeace(hacl, &aclhdr, acehdr, 1) ) + exit(1); + + if ( !aclunix_acecount(hacl, &aclhdr, &numaces, NULL, NULL, NULL) ) + exit(1); + if ( numaces > sizeof(acehdr2) ) + exit(1); + for ( i=0; i < numaces; i++ ) + { + acehdr2[i] = (aclunix_aceheader *) + malloc(sizeof(aclunix_aceheader)); + if ( acehdr2[i] == NULL ) + abort(); + } + if ( !aclunix_acecount(hacl, &aclhdr, &numaces, acehdr2, NULL, NULL) ) + exit(1); + if ( !aclunix_getacl_extinfo(hacl, &aclhdr) ) + exit(1); + + fprintf( + stdout, + "ACL Output for %s\n", + aclhdr.aclunix_aclheader_filename + ); + + fprintf( + stdout, + "aclhdr.aclunix_aclheader_flags = %d\n", + aclhdr.aclunix_aclheader_flags + ); + + for ( i=0; i < numaces; i++ ) + { + fprintf( + stdout, + "acehdr2[%d]->aclunix_aceheader_uid = %u\n", + i, + acehdr2[i]->aclunix_aceheader_uid + ); + fprintf( + stdout, + "acehdr2[%d]->aclunix_aceheader_perms = %.16LX\n", + i, + acehdr2[i]->aclunix_aceheader_perms + ); + + free(acehdr2[i]); + } + + aclunix_closedesc(hacl); + unlink("./.tekltiacl"); + exit(0); + } + #endif /* TEKLTI_EAL4 */ + + /*void timetest(char * dbbuf) { *************** int main(int argc, char *argv[]) *** 244,247 **** --- 329,352 ---- } + /* Restore the sigactions back to what they were */ + sigaction(SIGSEGV, &oldactsegv, NULL); + sigaction(SIGILL, &oldactill, NULL); + + #ifdef TEKLTI_EAL4 + sigemptyset(&signos); + sigaddset(&signos, SIGSEGV); + newact.sa_handler = &eal4_sigsegv; + newact.sa_mask = signos; + newact.sa_flags = SA_RESTART; + sigaction(SIGSEGV, &newact, &oldactsegv); + sigaction(SIGILL, &newact, &oldactill); + + testdesc(); + + /* Restore the sigactions back to what they were */ + sigaction(SIGSEGV, &oldactsegv, NULL); + sigaction(SIGILL, &oldactill, NULL); + #endif /* TEKLTI_EAL4 */ + /* We're in: begin the testsuite. */ Index: teklti.h =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/teklti.h,v retrieving revision 1.67 retrieving revision 1.68 diff -C 2 -d -p -r1.67 -r1.68 *** teklti.h 28 Feb 2007 02:02:43 -0000 1.67 --- teklti.h 28 Feb 2007 09:54:04 -0000 1.68 *************** extern uint8_t TekUserIsRoot(); *** 1264,1267 **** --- 1264,1330 ---- #ifdef COMPILING_LIBTEKLTI + typedef struct _aclunix_handle + { + FILE * aclunix_handle_desc; + int aclunix_handle_writable; + void * aclunix_handle_remoteuserdb; + } aclunix_handle; + + typedef struct _aclunix_aclheader + { + char aclunix_aclheader_filename[256]; + uint16_t aclunix_aclheader_filename_unicode[256]; + uint32_t aclunix_aclheader_flags; + } aclunix_aclheader; + + typedef struct _aclunix_aceheader + { + uid_t aclunix_aceheader_uid; + uint64_t aclunix_aceheader_perms; + } aclunix_aceheader; + + #define aclunix_fileflag_none 0x00000000 + #define aclunix_fileflag_inherit 0x00000001 + + extern void aclunix_getpath ( char * src ); + extern aclunix_handle * aclunix_opendesc ( const char *, int ); + extern int aclunix_closedesc ( aclunix_handle * ); + extern int aclunix_closedesc_force ( aclunix_handle * ); + extern int aclunix_getacl_extinfo ( + aclunix_handle *, + aclunix_aclheader * + ); + #ifdef HAVE_FSEEKO + extern int aclunix_acecount ( + aclunix_handle *, + aclunix_aclheader *, + uint64_t *, + aclunix_aceheader **, + off_t *, + off_t * + ); + #else /* not HAVE_FSEEKO */ + extern int aclunix_acecount ( + aclunix_handle *, + aclunix_aclheader *, + uint64_t *, + aclunix_aceheader **, + long int *, + long int * + ); + #endif /* not HAVE_FSEEKO */ + extern int aclunix_writeace ( + aclunix_handle *, + aclunix_aclheader *, + aclunix_aceheader **, + uint32_t + ); + extern int aclunix_writenewdesc ( + aclunix_handle *, + aclunix_aclheader *, + aclunix_aceheader **, + uint32_t + ); + extern void teklti_erase_userdbline ( char * ); extern uchar_t * teklti_alloc_userdbbuffer ( void ); *************** TEKLTI_DECLSPEC int TekStdRelease ( *** 1433,1436 **** --- 1496,1542 ---- #ifdef COMPILING_LIBTEKLTI + TEKLTI_DECLSPEC void aclunix_getpath ( char * src ); + TEKLTI_DECLSPEC aclunix_handle * aclunix_opendesc ( + const char * dirname, + int writing + ); + TEKLTI_DECLSPEC int aclunix_closedesc ( aclunix_handle * handle ); + TEKLTI_DECLSPEC int aclunix_closedesc_force ( aclunix_handle * handle ); + TEKLTI_DECLSPEC int aclunix_getacl_extinfo ( + aclunix_handle * handle, + aclunix_aclheader * acl + ); + #ifdef HAVE_FSEEKO + TEKLTI_DECLSPEC int aclunix_acecount ( + aclunix_handle * handle, + aclunix_aclheader * acl, + uint64_t * numaces, + aclunix_aceheader ** retval, + off_t * lastace, + off_t * nextace + ); + #else /* not HAVE_FSEEKO */ + TEKLTI_DECLSPEC int aclunix_acecount ( + aclunix_handle * handle, + aclunix_aclheader * acl, + uint64_t * numaces, + aclunix_aceheader ** retval, + long int * lastace, + long int * nextace + ); + #endif /* not HAVE_FSEEKO */ + TEKLTI_DECLSPEC int aclunix_writeace ( + aclunix_handle * handle, + aclunix_aclheader * acl, + aclunix_aceheader ** newace, + uint32_t newacelen + ); + TEKLTI_DECLSPEC int aclunix_writenewdesc ( + aclunix_handle * handle, + aclunix_aclheader * newacl, + aclunix_aceheader ** newace, + uint32_t newacelen + ); + TEKLTI_DECLSPEC void teklti_erase_userdbline ( char * line ); TEKLTI_DECLSPEC uchar_t * teklti_alloc_userdbbuffer ( void ); Index: aclunix.c =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/aclunix.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C 2 -d -p -r1.3 -r1.4 *** aclunix.c 27 Feb 2007 22:36:35 -0000 1.3 --- aclunix.c 28 Feb 2007 09:54:04 -0000 1.4 *************** *** 23,31 **** /* We do not want doxygen to process these private areas. */ #ifndef DOXYGEN_BUILD #define _ent_magic_empty 0 ! #define _ent_magic_fileent 1 ! #define _ent_magic_aceent 2 typedef struct _ent --- 23,36 ---- [...1012 lines suppressed...] + return 0; + #endif /* not HAVE_FSEEKO */ + + /* ...and write it. */ + len = fwrite( + aclunix_tobendian((struct _ent *)&aent2), + sizeof(struct _aceent_v1), 1, + handle->aclunix_handle_desc + ); + /* Check for errors. */ + if ( len < 1 ) + return 0; + /* Overwrite the current value. */ + cur = cur2; + } + + /* Return to caller. */ + return 1; + } + Index: testsuite-err.cpp =================================================================== RCS file: /cvsroot/libteklti/libteklti/src/testsuite-err.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C 2 -d -p -r1.4 -r1.5 *** testsuite-err.cpp 12 Feb 2007 09:56:47 -0000 1.4 --- testsuite-err.cpp 28 Feb 2007 09:54:05 -0000 1.5 *************** const char * gettekerrstr ( TEKERR Error *** 92,95 **** --- 92,122 ---- + #ifdef TEKLTI_EAL4 + void eal4_sigsegv ( int signum ) + { + switch ( signum ) + { + case SIGSEGV: + { + fprintf(stderr, "ERROR: Segmentation fault in low-level File ACL functions.\n"); + break; + } + case SIGILL: + { + fprintf(stderr, "ERROR: Your processor complained about an instruction being\n"); + fprintf(stderr, "ran illegal in the low-level File ACL functions.\n"); + } + default: + { + fprintf(stderr, "ERROR: Unknown signal caught.\n"); + break; + } + } + exit(EXIT_FAILURE); + } + #endif /* TEKLTI_EAL4 */ + + + void uchar_sigsegv ( int signum ) { *************** void uchar_sigsegv ( int signum ) *** 99,102 **** --- 126,130 ---- { fprintf(stderr, "ERROR: Segmentation fault in uchar functions.\n"); + break; } case SIGILL: *************** void uchar_sigsegv ( int signum ) *** 104,119 **** --- 132,151 ---- fprintf(stderr, "ERROR: Your processor complained about an instruction being\n"); fprintf(stderr, "ran illegal in the uchar processing functions.\n"); + break; } case SIGUSR1: { fprintf(stderr, "ERROR: uchar_t functions ran out of memory.\n"); + break; } case SIGUSR2: { fprintf(stderr, "ERROR: Invalid pointer got passed into the uchar_t functions.\n"); + break; } default: { fprintf(stderr, "ERROR: Unknown signal caught.\n"); + break; } } *************** return; *** 180,183 **** --- 212,225 ---- } + void printeal4error() + { + fprintf(stderr, "Unexpected failure in low-level File ACL functions.\n"); + fprintf(stdout, "TekLTI Testsuite cannot run if the low-level File ACL Functions do not work.\n"); + #ifdef USE_386_ASM + fprintf(stdout, "You may want to disable TEKLTI_EAL4 and recompile libTekLTI\n"); + #endif /* USE_386_ASM */ + return; + } + int processorcheckfail ( void ) |