Translate

Image of Operating System Concepts
Image of Linux Kernel Development (3rd Edition)
Image of Modern Operating Systems (3rd Edition)
Image of Advanced Programming in the UNIX Environment, Second Edition (Addison-Wesley Professional Computing Series)

Accessing Cisco Secure ACS 5.X Internals

Cisco does not hide the fact that Cisco Secure Access Control System (Secure ACS) 5.X is based on CentOS but provides no way to get to a Linux shell. Instead, when you log into Secure ACS you are presented with a Cisco IOS-like shell. This post will show you how to access the bash shell as root, and explores the underlying filesystem layout and utilities which make up Secure ACS. For the purposes of this blog, I am using Secure ACS VM 5.2. There may be slight variations in filesystem layout and utilities in later versions of Secure ACS. So

Set up local RPM Installation Repository

There are a number of ways of installing additional RPM packages from installation media. However, if your network is fast and you are installing the same packages on a number of systems, it sometimes is easier to set up a simple local package repository and use yum to install the packages from there. This post shows you how to do this. Copy the new packages, or even the contents of an entire distribution to a suitable subdirectory on a local webserver. For example, if you are using an Apache webserver on RHEL or Fedora, suitable locations would probably be /var/www/html/repos/rhel6/

List packages in RPM Database using C

Here is one way of listing installed RPM packages. It works with all versions of CentOS 5, RHEL5 and up to Fedora 14. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <rpm/rpmlib.h> #include <rpm/header.h> #include <rpm/rpmdb.h> int main(int argc, char *argv[]) { rpmdbMatchIterator mi; int type, count; char *name; rpmdb db; Header h; rpmReadConfigFiles( NULL, NULL ); if (rpmdbOpen( "", &db, O_RDONLY, 0644 ) != 0) { fprintf( stderr, "ERROR: Cannot open RPM databasen"); exit(1); } mi = rpmdbInitIterator(db, RPMDBI_PACKAGES, NULL, 0); while ((h = rpmdbNextIterator(mi))) { headerGetEntry(h, RPMTAG_NAME, &type, (void **) &name, &count); printf("%sn", name);