enumerate executable sections only to build checksum
authorMartin Willi <martin@strongswan.org>
Tue, 21 Jul 2009 13:00:18 +0000 (15:00 +0200)
committerMartin Willi <martin@strongswan.org>
Tue, 21 Jul 2009 13:00:18 +0000 (15:00 +0200)
src/libstrongswan/integrity_checker.c

index 9ad8783..6a402b3 100644 (file)
@@ -113,8 +113,7 @@ static int callback(struct dl_phdr_info *dlpi, size_t size, Dl_info *dli)
                        const ElfW(Phdr) *sgmt = &dlpi->dlpi_phdr[i];
                        
                        /* we are interested in the executable LOAD segment */
                        const ElfW(Phdr) *sgmt = &dlpi->dlpi_phdr[i];
                        
                        /* we are interested in the executable LOAD segment */
-                       if (sgmt->p_type == PT_LOAD &&
-                               (sgmt->p_flags & (PF_X | PF_R)))
+                       if (sgmt->p_type == PT_LOAD && (sgmt->p_flags & PF_X))
                        {
                                /* safe begin of segment in dli_fbase */
                                dli->dli_fbase = (void*)sgmt->p_vaddr + dlpi->dlpi_addr;
                        {
                                /* safe begin of segment in dli_fbase */
                                dli->dli_fbase = (void*)sgmt->p_vaddr + dlpi->dlpi_addr;