Git Product home page Git Product logo

apt-check.sh's People

Contributors

errm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

apt-check.sh's Issues

Don't forget /etc/apt/sources.list.d

The security list is not necessarily configured in /etc/apt/sources.list. It can (and probably should) also be in a file under /etc/apt/sources.list.d/

capitalisation error

in the security_upgrades function, Dir::Etc::Sourcelist should be Dir::Etc::SourceList

Insecure use of temp file

You use a predictable filename for $SECURITY_LIST which is expected not to already exist, but there is no checking for that.

Any user can generate a symlink at /tmp/apt-check.sh-fs6s6dfsf-security.list, with the result that the linked file will first be overwritten, and then deleted using root permissions.

I suggest you use something like:

SECURITY_LIST=`tempfile --suffix=-apt-check.sh-security.list`

Fails on ubuntu 14.04

On Ubuntu 14.04 (at least) the format of the output from apt-get upgrade does not match the expected format, with the result that the parsing for the list of upgrades that are outstanding fails.

mc0e@mc0e-laptop ~ $ sudo apt-get upgrade -oDir::Etc::Sourcelist=$SECURITY_LIST -s
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  adobe-flash-properties-gtk adobe-flashplugin ansible bind9-host
  distro-info-data dnsutils firefox firefox-locale-en libbind9-90 libdns100
  libfreetype6 libfreetype6:i386 libisc95 libisccc90 libisccfg90 liblwres90
  virtualbox-5.1
17 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
[... etc ...]

count_upgrades fails because it simply greps for upgraded,, whereas in the output above, we see that there is a : instead of a ',', and the package list is on the following line.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.