Changeset 516 for trunk/src/sh_suidchk.c


Ignore:
Timestamp:
Oct 31, 2016, 8:31:24 PM (8 years ago)
Author:
katerina
Message:

Fix for ticket #409 and #410 (unprivileged suidcheck and gcc 6.2 compiler warnings).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_suidchk.c

    r483 r516  
    997997 * by longjmp' warning. And no, 'volatile' proved insufficient.
    998998 */
    999 static void * sh_dummy_dirlist = NULL;
    1000 static void * sh_dummy_itmp    = NULL;
     999void * sh_dummy_idirlist = NULL;
     1000void * sh_dummy_itmp     = NULL;
    10011001
    10021002
     
    10281028   * Avoids the 'clobbered by longjmp' warning.
    10291029   */
    1030   sh_dummy_dirlist = (void*) &dirlist;
    1031   sh_dummy_itmp    = (void*) &tmp;
     1030  sh_dummy_idirlist = (void*) &dirlist;
     1031  sh_dummy_itmp     = (void*) &tmp;
    10321032
    10331033  if (iname == NULL)
     
    11461146                                    ShSuidchkFps) , 0);
    11471147      }
    1148              
     1148
    11491149    status = (int) retry_lstat(FIL__, __LINE__, tmpcat, &buf);
    11501150
     
    11861186             */
    11871187            fs = filesystem_type (tmpcat, tmpcat, &buf);
     1188
    11881189            if (fs != NULL
    11891190#ifndef SH_SUIDTESTDIR
     
    15201521  status = sh_suidchk_check_internal (SH_SUIDTESTDIR);
    15211522#else
     1523  #error
    15221524  status = sh_suidchk_check_internal ("/");
    15231525#endif
     
    22112213  current_dev = statp->st_dev;
    22122214  current_fstype = filesystem_type_uncached (path, relpath, statp);
     2215 
    22132216  return current_fstype;
    22142217}
     
    22322235#endif
    22332236
    2234 #ifdef FSTYPE_MNTENT            /* 4.3BSD, SunOS, HP-UX, Dynix, Irix.  */
     2237#ifdef FSTYPE_MNTENT            /* 4.3BSD, SunOS, HP-UX, Dynix, Irix,Linux  */
    22352238  char *table = MOUNTED;
    22362239  FILE *mfp;
     
    22942297              volatile int  elevel = SH_ERR_ERR;
    22952298              size_t tlen = strlen(mnt->mnt_dir);
    2296 
     2299             
    22972300              if (tlen >= 6 && 0 == strcmp(&((mnt->mnt_dir)[tlen-6]), _("/.gvfs")))
    22982301                elevel = SH_ERR_NOTICE;
    22992302              else if (tlen >= 5 && 0 == strcmp(&((mnt->mnt_dir)[tlen-5]), _("/gvfs")))
    23002303                elevel = SH_ERR_NOTICE;
    2301 
     2304              else if (0 == strcmp (mnt->mnt_type, _("tracefs")))
     2305                elevel = SH_ERR_NOTICE;
     2306             
    23022307              sl_snprintf(errmsg, sizeof(errmsg), _("stat(%s) failed"),
    23032308                          mnt->mnt_dir);
     
    23072312                               _("filesystem_type_uncached") );
    23082313              SH_MUTEX_UNLOCK(mutex_thread_nolog);
    2309               return NULL;
     2314              continue;
    23102315            }
    23112316          dev = disk_stats.st_dev;
Note: See TracChangeset for help on using the changeset viewer.