Changeset 412 for trunk/src


Ignore:
Timestamp:
Sep 1, 2012, 4:25:30 PM (12 years ago)
Author:
katerina
Message:

Enhancements for ticket #312 (logrotate) and #313 (--enable-suid).

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_calls.c

    r361 r412  
    696696  SL_ENTER(_("aud_open"));
    697697
     698#ifdef USE_SUID
     699  if (0 == strcmp(pathname, "/usr/bin/sudo"))
     700    {
     701      uid_t ruid; uid_t euid; uid_t suid;
     702      getresuid(&ruid, &euid, &suid);
     703    }
     704  if (privs == SL_YESPRIV)
     705    sl_set_suid();
     706#else
     707  /*@-noeffect@*/
     708  (void) privs; /* fix compiler warning */
     709  /*@+noeffect@*/
     710#endif
     711
    698712  val_return = open (pathname, *o_noatime|flags, mode);
     713
     714#ifdef USE_SUID
     715  if (privs == SL_YESPRIV)
     716    sl_unset_suid();
     717#endif
     718
    699719  if ((val_return < 0) && (*o_noatime != 0))
    700720    {
     
    704724    }
    705725  error = errno;
    706   /*@-noeffect@*/
    707   (void) privs; /* fix compiler warning */
    708   /*@+noeffect@*/
    709726
    710727  if (val_return < 0)
     
    736753  SL_ENTER(_("aud_open"));
    737754
    738   val_return = open (pathname, flags, mode);
    739   error = errno;
     755#ifdef USE_SUID
     756  if (privs == SL_YESPRIV)
     757    sl_set_suid();
     758#else
    740759  /*@-noeffect@*/
    741760  (void) privs; /* fix compiler warning */
    742761  /*@+noeffect@*/
     762#endif
     763
     764  val_return = open (pathname, flags, mode);
     765
     766#ifdef USE_SUID
     767  if (privs == SL_YESPRIV)
     768    sl_unset_suid();
     769#endif
     770
     771  error = errno;
    743772
    744773  if (val_return < 0)
  • trunk/src/sh_database.c

    r362 r412  
    17641764
    17651765/* recursively enter linked list of messages into database, last first
     1766 * - last is client (if this is a client message received by client)
    17661767 */
    17671768long sh_database_insert_rec (dbins * curr, int depth, char * host)
  • trunk/src/slib.c

    r395 r412  
    15351535  SL_REQUIRE (sl_save_uids() == SL_ENONE, _("sl_save_uids() == SL_ENONE"));
    15361536
     1537#ifndef SH_ALLOW_SUID
    15371538  if (euid != ruid || egid != rgid)
    15381539    {
     
    15561557#endif
    15571558    }
     1559#endif
    15581560  SL_IRETURN(SL_ENONE, _("sl_policy_get_user"));
    15591561}
Note: See TracChangeset for help on using the changeset viewer.