<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Le Stephane</title>
    <description>The latest articles on DEV Community by Le Stephane (@lestephane).</description>
    <link>https://dev.to/lestephane</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F104890%2Fbecd5ac6-54da-4b98-8498-621190591e8b.jpeg</url>
      <title>DEV Community: Le Stephane</title>
      <link>https://dev.to/lestephane</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lestephane"/>
    <language>en</language>
    <item>
      <title>Sanitizing Debian</title>
      <dc:creator>Le Stephane</dc:creator>
      <pubDate>Wed, 12 Dec 2018 15:47:24 +0000</pubDate>
      <link>https://dev.to/lestephane/sanity-checking-debian-1-2f4g</link>
      <guid>https://dev.to/lestephane/sanity-checking-debian-1-2f4g</guid>
      <description>&lt;p&gt;&lt;em&gt;(this is my first post on dev.to, testing the waters, be gentle)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Today I wanted to check whether any file on my system was not exactly the file that was shipped in its debian package. So after some research, I settled on the &lt;em&gt;debsums&lt;/em&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;debsums &lt;span class="nt"&gt;-s&lt;/span&gt;
debsums: changed file /usr/share/applications/code-url-handler.desktop &lt;span class="o"&gt;(&lt;/span&gt;from code package&lt;span class="o"&gt;)&lt;/span&gt;
debsums: changed file /usr/share/applications/code.desktop &lt;span class="o"&gt;(&lt;/span&gt;from code package&lt;span class="o"&gt;)&lt;/span&gt;
debsums: changed file /usr/share/applications/gedit.desktop &lt;span class="o"&gt;(&lt;/span&gt;from gedit package&lt;span class="o"&gt;)&lt;/span&gt;
debsums: changed file /usr/lib/python3/dist-packages/cupshelpers/__pycache__/__init__.cpython-35.pyc &lt;span class="o"&gt;(&lt;/span&gt;from python3-cupshelpers package&lt;span class="o"&gt;)&lt;/span&gt;
debsums: changed file /usr/lib/python3/dist-packages/cupshelpers/__pycache__/config.cpython-35.pyc &lt;span class="o"&gt;(&lt;/span&gt;from python3-cupshelpers package&lt;span class="o"&gt;)&lt;/span&gt;
debsums: changed file /usr/lib/python3/dist-packages/cupshelpers/__pycache__/cupshelpers.cpython-35.pyc &lt;span class="o"&gt;(&lt;/span&gt;from python3-cupshelpers package&lt;span class="o"&gt;)&lt;/span&gt;
debsums: changed file /usr/lib/python3/dist-packages/cupshelpers/__pycache__/installdriver.cpython-35.pyc &lt;span class="o"&gt;(&lt;/span&gt;from python3-cupshelpers package&lt;span class="o"&gt;)&lt;/span&gt;
debsums: changed file /usr/lib/python3/dist-packages/cupshelpers/__pycache__/openprinting.cpython-35.pyc &lt;span class="o"&gt;(&lt;/span&gt;from python3-cupshelpers package&lt;span class="o"&gt;)&lt;/span&gt;
debsums: changed file /usr/lib/python3/dist-packages/cupshelpers/__pycache__/ppds.cpython-35.pyc &lt;span class="o"&gt;(&lt;/span&gt;from python3-cupshelpers package&lt;span class="o"&gt;)&lt;/span&gt;
debsums: changed file /usr/lib/python3/dist-packages/cupshelpers/__pycache__/xmldriverprefs.cpython-35.pyc &lt;span class="o"&gt;(&lt;/span&gt;from python3-cupshelpers package&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Moved on to re-installing the affected packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;debsums &lt;span class="nt"&gt;-s&lt;/span&gt; 2&amp;gt;&amp;amp;1 | &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-oE&lt;/span&gt; &lt;span class="s2"&gt;"from .* package"&lt;/span&gt; | &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nb"&gt;sort&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt; | &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="nb"&gt;read &lt;/span&gt;PKG&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PKG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; 2&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
code
gedit
python3-cupshelpers
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;aptitude reinstall code gedit python3-cupshelpers
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And checked (again):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;debsums &lt;span class="nt"&gt;-s&lt;/span&gt;
debsums: changed file /usr/share/applications/code-url-handler.desktop &lt;span class="o"&gt;(&lt;/span&gt;from code package&lt;span class="o"&gt;)&lt;/span&gt;
debsums: changed file /usr/share/applications/code.desktop &lt;span class="o"&gt;(&lt;/span&gt;from code package&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Uh. There's something at work that I don't fully understand (yet). Since I cannot justify the time spent chasing this down, I find out who to contact:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;apt-cache show code | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s2"&gt;"Maintainer"&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt;
     50 Maintainer: Microsoft Corporation &amp;lt;vscode-linux@microsoft.com&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I drop them a mail:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;From: Le Stephane
To: vscode-linux@microsoft.com
Subject: /usr/share/applications/code(-url-handler).desktop files always show up as modified in debsums

Dear VS Code maintainers, 

I get debsums errors on files belonging to your .deb package, even after re-installing it. Can you advise?

$ sudo debsums -s
debsums: changed file /usr/share/applications/code-url-handler.desktop (from code package)
debsums: changed file /usr/share/applications/code.desktop (from code package)

$ dpkg -l code
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                  Version                 Architecture            Description
+++-=====================================-=======================-=======================-===============================================================================
ii  code                                  1.29.1-1542309157       amd64                   Code editing. Redefined.

Best
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Takeaways (so far)
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Posting on dev.to is fun, I will do it again&lt;/li&gt;
&lt;li&gt;There's a &lt;em&gt;debsums&lt;/em&gt; command which is pretty cool&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;debsums&lt;/em&gt; + &lt;em&gt;aptitude reinstall&lt;/em&gt; makes my system fresh again... &lt;/li&gt;
&lt;li&gt;...except for a few files, for an unknown reason&lt;/li&gt;
&lt;li&gt;I don't need to find that reason just yet. But I can find out where to ask for help&lt;/li&gt;
&lt;li&gt;Similarly, I don't need to finish my article. Maybe someone in the audience will know why I'm experiencing this behaviour. If not, in time, the maintainer will probably point me to the reason. I can then amend the article.&lt;/li&gt;
&lt;li&gt;This article is my first, and just a start. I should also check which files currently present in my OS system directories does not belong to a package, if I'm serious about security.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>debian</category>
      <category>ubuntu</category>
      <category>debsums</category>
      <category>vscode</category>
    </item>
  </channel>
</rss>
