Mailinglist Archive: zypp-commit (233 mails)

< Previous Next >
[zypp-commit] <libzypp> ma-misc : CheckAccessDeleted: Avoid reporting false positive due to insufficient permission.
  • From: Michael Andres <ma@xxxxxxx>
  • Date: Mon, 2 Nov 2009 16:37:42 +0100
  • Message-id: <E1N4yyf-00087i-0G@xxxxxxxxxxxxxxxx>
ref: refs/heads/ma-misc
commit 8b6b62b90a515354c7f100492c809b97f186b7f7
Author: Michael Andres <ma@xxxxxxx>
Date: Mon Nov 2 16:37:42 2009 +0100

CheckAccessDeleted: Avoid reporting false positive due to insufficient
permission.
---
zypp/misc/CheckAccessDeleted.cc | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/zypp/misc/CheckAccessDeleted.cc b/zypp/misc/CheckAccessDeleted.cc
index 2d148b0..baeafe3 100644
--- a/zypp/misc/CheckAccessDeleted.cc
+++ b/zypp/misc/CheckAccessDeleted.cc
@@ -92,16 +92,15 @@ namespace zypp
}

/** Add line to cache if it refers to a deleted executable or library file:
- * - Either the link count \c(k) os \c 0, or no link cout is present.
+ * - Either the link count \c(k) is \c 0, or no link cout is present.
* - The type \c (t) is set to \c REG or \c DEL
* - The filedescriptor \c (f) is set to \c txt, \c mem or \c DEL
*/
inline void addCacheIf( CheckAccessDeleted::ProcInfo & cache_r, const
std::string & line_r )
{
- const char * k = ".";
- const char * f = ".";
- const char * t = ".";
- const char * n = ".";
+ const char * f = 0;
+ const char * t = 0;
+ const char * n = 0;

for_( ch, line_r.c_str(), ch+line_r.size() )
{
@@ -110,7 +109,6 @@ namespace zypp
case 'k':
if ( *(ch+1) != '0' ) // skip non-zero link counts
return;
- k = ch+1;
break;
case 'f':
f = ch+1;
@@ -141,6 +139,9 @@ namespace zypp

std::string name( n );

+ if ( str::contains( n, "(stat: Permission denied)" ) )
+ return; // Avoid reporting false positive due to insufficient
permission.
+
if ( *f == 'm' || *f == 'D' ) // skip some wellknown nonlibrary
memorymapped files
{
static const char * black[] = {
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages