Cisco Secure Access Control System is based on CentOS. This post will show you how to access the Bash shell as root, and explores the underlying filesystem layout and utilities which make up this product..
|
||
Cisco Secure Access Control System is based on CentOS. This post will show you how to access the Bash shell as root, and explores the underlying filesystem layout and utilities which make up this product.. 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/ 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); |
||
Copyright © 2007-2024 Finnbarr P. Murphy. All Rights Reserved |