Changeset 55 for trunk/src/sh_suidchk.c


Ignore:
Timestamp:
Aug 17, 2006, 10:31:24 PM (18 years ago)
Author:
rainer
Message:

Fix for bug with SuidCheckExclude (ticket #30)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_suidchk.c

    r34 r55  
    519519          if (/*@-usedef@*/S_ISDIR(buf.st_mode)/*@+usedef@*/ &&
    520520              (ShSuidchkExclude == NULL ||
    521               0 != strncmp(tmpcat, ShSuidchkExclude, (size_t) ExcludeLen)))
     521               0 != strcmp(tmpcat, ShSuidchkExclude)))
    522522            {
    523523              /* fs is a STATIC string
     
    11181118    SH_FREE(ShSuidchkExclude);
    11191119
    1120   /* 1.8.1 add trailing slash
    1121    */
    11221120  ExcludeLen       = (int) sl_strlen(c);
    1123   if (c[ExcludeLen-1] != '/')
    1124     {
    1125       ExcludeLen++;
    1126       if ((ExcludeLen <= 0) || (ExcludeLen+1 <= 0)) /* may overflow */
    1127         {
    1128           SL_RETURN(-1, _("sh_suidchk_set_exclude"));
    1129         }
     1121  if (c[ExcludeLen-1] == '/')
     1122    {
     1123      c[ExcludeLen-1] = '\0';
     1124      ExcludeLen--;
    11301125    }
    11311126  ShSuidchkExclude = SH_ALLOC((size_t) ExcludeLen + 1);
    11321127  (void) sl_strlcpy(ShSuidchkExclude, c, (size_t)(ExcludeLen + 1));
    1133   ShSuidchkExclude[ExcludeLen-1] = '/';
    11341128
    11351129  SL_RETURN(0, _("sh_suidchk_set_exclude"));
Note: See TracChangeset for help on using the changeset viewer.