Imported Upstream version 17.0.0
[platform/upstream/libzypp.git] / zypp / misc / CheckAccessDeleted.cc
index 8f666c4..bee525f 100644 (file)
@@ -10,6 +10,7 @@
  *
 */
 #include <iostream>
+#include <fstream>
 #include <unordered_set>
 #include "zypp/base/LogTools.h"
 #include "zypp/base/String.h"
@@ -161,6 +162,7 @@ namespace zypp
         static const char * black[] = {
             "/SYSV"
           , "/var/run/"
+          , "/var/lib/sss/"
           , "/dev/"
         };
         for_( it, arrayBegin( black ), arrayEnd( black ) )
@@ -199,6 +201,44 @@ namespace zypp
       ino_t mntNS;
     };
 
+#if 0
+    void lsofdebug( const Pathname & file_r )
+    {
+      std::ifstream infile( file_r.c_str() );
+      USR << infile << endl;
+      std::vector<std::string> fields;
+      CacheEntry cache;
+      for( iostr::EachLine in( infile ); in; in.next() )
+      {
+       std::string field( *in );
+       if ( field[0] == 'f' || field[0] == 'p' )
+       {
+         if ( !fields.empty() )
+         {
+           // consume
+           std::string line( str::join( fields, "\n" ) );
+           for ( char & c : line )
+           { if ( c == '\n' ) c = '\0'; }
+           line.push_back( '\n' );
+
+           size_t sze = cache.second.size();
+           addCacheIf( cache, line, false );
+           if ( sze != cache.second.size() )
+             USR << fields << endl;
+
+           fields.clear();
+         }
+         if ( field[0] == 'p' )
+           continue;
+         fields.push_back( field );
+       }
+       else if ( !fields.empty() )
+       {
+         fields.push_back( field );
+       }
+      }
+    }
+#endif
     /////////////////////////////////////////////////////////////////
   } // namespace
   ///////////////////////////////////////////////////////////////////