Welcome, Guest! Registration

loc2log

Thursday, 2024-04-25

RedHat Package Manager (all well known rpm) can check integrity of installed components. It can indicate if there were any of installed files modified, or did somebody change a permission?

To run a basic and comprehensive install integrity check, you simply execute (preferably as root):

rpm -V rpm_name_to_check
or
rpm --verify rpm_name_to_check

If there are no issues, you'll get empty output and return code 0. That is:

$ rpm -V libusb
$ echo $?
0

For a modified deployed file you may see something like this:

$ rpm -V httpd
..?...... /usr/sbin/suexec
.....UG.. /var/www
.....UG.. /var/www/cgi-bin
.M...UG.. /var/www/html

In the case of a modified install the return code will be 1:

$ echo $? 1

httpd install test above translates as:

/var/www, /var/www/cgi-bin got their User ownership and Group memberships modified. And /var/www/html got Mode (chmod) changed in addition to the User and the Group.

The question mark in rpm -V output means a certain test could not have been performed. In our example above "..?...... /usr/sbin/suexec" means md5 sum can't be calculated for /usr/sbin/suexec.

That is often because rpm can not access a file being verified under current user account. To avoid "can't verify" question mark in the rpm -V output, just execute rpm as root:

$ sudo rpm -V httpd
.....UG.. /var/www
.....UG.. /var/www/cgi-bin
.M...UG.. /var/www/html

See that "..?...... /usr/sbin/suexec" gone? :-)

By default rpm performs a bunch of tests, each denoted by dot in the case of rpm metadata and installed item match, or "what's wrong" attribute otherwise:

  1. S - file Size differs
  2. M - Mode differs (includes permissions and file type)
  3. 5 - MD5 sum differs
  4. D - Device major/minor number mismatch
  5. L - readLink path mismatch
  6. U - User ownership differs
  7. G - Group ownership differs
  8. T - mTime differs
  9. P - caPabilities differ

The output can also have an attribute marker:

c %config configuration file.
d %doc documentation file.
g %ghost file (i.e. the file contents are not included in the package payload).
l %license license file.
r %readme readme file.
That is it from me, read man rpm for more info.
Views: 4267 | Added by: ep | Date: 2015-04-03 | Comments (0)

I did post What's inside rpm? on how to explore rpms via linux command line. That works well for single files, enough to create adhoc scripts.

I have started looking for some sort of web-based "Repo Browser", or "rpm Registry" software in a form of a web-app or a web-server to install on a local network and explore local and remote yum repositories. Unfortunately nothing did pop up in my searches.

Here is what I am looking for, my list of desired features:

  1. List rpms with selectable info fields such as Name, Version, release, Build Data, License, Signature components, Summary, etc
  2. Filter the list by the fields selected above
  3. Display lists of dependencies for a selected rpm
  4. Browse these dependencies if their repos are reachable,
  5. Indication if a dependency is reachable or not
  6. Compare selected rpms: see what are the differences in scripts, files, permissions, info.
  7. Export to MS Excel
  8. Ability to extend and add features: JSON or SOAP web services interface, plugins architecture

If someone knows a software product which satisfy most of these requirements, your input is very welcome in comments, or via the Contact form.

Views: 755 | Added by: ep | Date: 2015-01-02 | Comments (0)

Here is how to check what is inside rpm without install, or before you install:

General info on rpm (author, description)

rpm -qip your.rpm

Install / uninstall scripts:

rpm --scripts -qp your.rpm

List of rpm files and their attributes:

rpm -qlvp your.rpm

Check contents of files to be installed via the rpm package:

rpm2cpio your.rpm | more

Extract files from an rpm without install:

rpm2cpio your.rpm > your.cpio
cpio -idmv < your.cpio

Here is what you can do on already installed rpms (note, you most likely won't see target architecture and ".rpm" extensions on installed rpms):

Check if "your_rpm" is installed:

rpm -qa | grep your_rpm

General info on rpm (author, description)

rpm -qi your_rpm

Install / uninstall scripts of already installed rpm:

rpm --scripts -q your_rpm

List of installed rpm files and their attributes:

rpm -qlv your_rpm
Views: 1123 | Added by: ep | Date: 2013-05-20 | Comments (0)

Here are some ballpark figures for code inspection size and approximate time to keep the management happy.

Recommended size of code per inspection or review - 200 LOC/h; each inspection or review session shall be no longer than 90 minutes

Good reads:

Views: 900 | Added by: ep | Date: 2013-01-24 | Comments (1)

Have to count all records for a given month of a certain year in PostgreSQL table. The column being selected with is of type 'timestamp without time zone'. Let's call the column 'fdt', and count records for October 2012.

There are at least 3 solution options:

1.
SELECT COUNT(*) FROM table WHERE date_part('month', fdt) = 10 AND date_part('year', fdt) = 2012 ;
2.
SELECT COUNT(*) FROM table WHERE EXTRACT(MONTH FROM fdt) = 10 AND EXTRACT(YEAR FROM fdt) = 2012;
3.
SELECT COUNT(*) FROM table WHERE fdt >= '2012-10-01' AND fdt < '2012-11-01';

Third option is, in general, faster than the first two. For the same data options 1. and 2. count 22806 records in ~80 ms, and option 3 ~60ms.

Views: 6439 | Added by: ep | Date: 2012-11-04 | Comments (0)

jQuery “Add Bookmark” plugin – abookmark - seems like a decent jQuery plugin.

Using it with button is the same as with 'a' link:
<script type="text/javascript" src="http://YOUR_SITE/jquery.min.js"></script>
<script type="text/javascript" src="http://YOUR_SITE/jquery.abookmark.min.js"></script>
<input type="button" id="btn_bookmark" value="Bookmark" title="Save to browser's bookmarks."/>
<script>
$(document).ready(
function () {
$('#btn_bookmark').abookmark();
});
</script>
It is cool it understands button's "disabled" property.
Views: 1972 | Added by: loc2log | Date: 2012-06-24 | Comments (0)

Old good technology of HTML image maps + jQuery = totally awesome maps.

Totally awesome jQuery plugin maphilight: image map mouseover highlighting

Here is some info on the HTML map - HTML <map> Tag, Creating HTML Image Maps

Views: 1071 | Added by: loc2log | Date: 2012-06-24 | Comments (0)

« 1 2 ... 5 6 7 8 9 »