OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Thomas Lotterer
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   01-Jul-2004 22:29:04
  Branch: HEAD                             Handle: -NONE-

  Modified files:
    openpkg-src/openpkg-audit
                            audit-rpm.c

  Log:
    adjust/improve comments; fix typo; properly pass RPM exit code down to
    the caller

  Summary:
    Revision    Changes     Path
    1.2         +8  -8      openpkg-src/openpkg-audit/audit-rpm.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg-audit/audit-rpm.c
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 audit-rpm.c
  --- openpkg-src/openpkg-audit/audit-rpm.c     1 Jul 2004 16:30:26 -0000       1.1
  +++ openpkg-src/openpkg-audit/audit-rpm.c     1 Jul 2004 20:29:04 -0000       1.2
  @@ -23,10 +23,9 @@
   **  SUCH DAMAGE.
   */
   
  -/*  This is a small OpenPKG RPM command wrapper which provides minimal
  -    auditing/logging possibilities to an OpenPKG instance by writing
  -    a <prefix>/RPM/DB/Audit logfile containing the RPM commands which
  -    actually led to a RPM database change. */
  +/*  This OpenPKG RPM command wrapper provides minimal auditing/logging
  +    capabilities to an OpenPKG instance by writing a logfile containing
  +    all the RPM commands which actually led to a RPM database change.   */
   
   #include <stdio.h>
   #include <stdlib.h>
  @@ -198,7 +197,7 @@
       argv2[j++] = NULL;
   
       /* determine whether access to the RPM database is possible
  -       and it not, short-circuit processing */
  +       and if not, short-circuit processing */
       cp = mkstr(NULL, cpPrefix, "/", RPMDB_DIR, "/", RPMDB_files[0], NULL);
       if (access(cp, R_OK|W_OK) != 0) {
           /* pass-through execution to real OpenPKG RPM command */
  @@ -246,8 +245,9 @@
       /* determine command */
       cpCmd = mkstra(" ", &argv2[1]);
   
  -    /* optionally give up any root privileges to make sure
  -       the file is written with the OpenPKG RPM database user/group */
  +    /* drop excessive root privileges making sure the logfile is owned
  +       by musr/mgrp and receives exactly the permissions of the RPM DB.
  +       In case we are already musr/mgrp the setuid(2) calls are noops.  */
       cp = mkstr(NULL, cpPrefix, "/", RPMDB_DIR, "/", RPMDB_files[0], NULL);
       if (stat(cp, &sb) < 0)
           die("unable to stat the RPM database file %s", cp);
  @@ -274,6 +274,6 @@
       free(argv2);
       free(cpCmd);
   
  -    exit(0);
  +    exit(rv);
   }
   
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to