Changeset 412 for trunk/src/sh_calls.c


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

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

File:
1 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)
Note: See TracChangeset for help on using the changeset viewer.