Changeset 134 for trunk/src/trustfile.c


Ignore:
Timestamp:
Oct 26, 2007, 12:20:10 AM (17 years ago)
Author:
rainer
Message:

More thread-safety changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/trustfile.c

    r131 r134  
    507507#endif
    508508
     509  int retval = SL_FALSE;
     510
    509511  SL_ENTER(_("onlytrustedingrp"));
    510512
     
    603605  /* now check ALL users for their GID !!!
    604606   */
     607  SH_MUTEX_LOCK(mutex_pwent);
     608
    605609  while (NULL != (w = sh_getpwent()))
    606610    {
     
    643647#endif
    644648              tf_baduid = w->pw_uid;
    645               SL_IRETURN(SL_FALSE, _("onlytrustedingrp"));
     649              retval = SL_FALSE;
     650              goto out;
     651              /* SL_IRETURN(SL_FALSE, _("onlytrustedingrp")); */
    646652            }
    647653        }
    648654    }
     655  retval = SL_TRUE;
     656
     657 out:
    649658
    650659#ifdef HAVE_ENDPWENT
    651660  sh_endpwent();
    652661#endif
     662
     663  SH_MUTEX_UNLOCK(mutex_pwent);
     664
    653665  /* TEST_ONLY */
    654666#endif
    655 
    656667  /* #ifdef HAVE_GETPWENT */
    657668#endif
    658669
    659670#ifdef TRUST_DEBUG
    660   fprintf(stderr,
    661           "trustfile: group %ld:  all members are trusted users --> OK\n",
    662           (UID_CAST)grp);
     671  if (retval == SL_TRUE)
     672    fprintf(stderr,
     673            "trustfile: group %ld:  all members are trusted users --> OK\n",
     674            (UID_CAST)grp);
    663675#endif
    664676  /* all found
    665677   */
    666   SL_IRETURN(SL_TRUE, _("onlytrustedingrp"));
     678  SL_IRETURN(retval, _("onlytrustedingrp"));
    667679}
    668680
Note: See TracChangeset for help on using the changeset viewer.