Changeset 115 for trunk/src/sh_hash.c
- Timestamp:
- Aug 21, 2007, 10:22:59 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_hash.c
r114 r115 1054 1054 memcpy( &(*p).theFile, &ft, sizeof(sh_filestore_t) ); 1055 1055 1056 p->fflags = 0; 1057 1056 /* init fflags, such that suid files in 1057 * database are recognized as such 1058 */ 1059 { 1060 mode_t mode = (mode_t) ft.mode; 1061 1062 if (S_ISREG(mode) && 1063 (0 !=(S_ISUID & mode) || 1064 #if defined(HOST_IS_LINUX) 1065 (0 !=(S_ISGID & mode) && 1066 0 !=(S_IXGRP & mode)) 1067 #else 1068 0 !=(S_ISGID & mode) 1069 #endif 1070 ) 1071 ) 1072 p->fflags = SH_FFLAG_SUIDCHK; 1073 1074 else 1075 p->fflags = 0; 1076 } 1077 1058 1078 p->modi_mask = 0L; 1059 1079 p->fullpath = fullpath; … … 1812 1832 sh_file_t * p; 1813 1833 1814 SL_ENTER(_("sh_hash_have_it "));1834 SL_ENTER(_("sh_hash_have_it_int")); 1815 1835 1816 1836 if (newname == NULL) 1817 SL_RETURN( (NULL), _("sh_hash_have_it "));1837 SL_RETURN( (NULL), _("sh_hash_have_it_int")); 1818 1838 1819 1839 if (IsInit != 1) … … 1824 1844 p = hashsearch ( sh_tiger_hash(newname, TIGER_DATA, sl_strlen(newname)) ); 1825 1845 if (p == NULL) 1826 SL_RETURN( (NULL), _("sh_hash_have_it "));1846 SL_RETURN( (NULL), _("sh_hash_have_it_int")); 1827 1847 /* 1828 1848 if (p->allignore == S_FALSE && … … 1831 1851 SL_RETURN( (1), _("sh_hash_have_it")); 1832 1852 */ 1833 SL_RETURN( (p), _("sh_hash_have_it "));1853 SL_RETURN( (p), _("sh_hash_have_it_int")); 1834 1854 } 1835 1855 … … 1860 1880 return 0; 1861 1881 } 1862 1882 1883 int sh_hash_getflags (char * filename) 1884 { 1885 sh_file_t * p = sh_hash_have_it_int (filename); 1886 if (!p) 1887 return (-1); 1888 return (p->fflags); 1889 } 1890 1891 int sh_hash_setflags (char * filename, int flags) 1892 { 1893 sh_file_t * p = sh_hash_have_it_int (filename); 1894 if (!p) 1895 return (-1); 1896 p->fflags = flags; 1897 return 0; 1898 } 1899 1900 /* needs lock to be threadsafe 1901 */ 1902 void sh_hash_addflag (char * filename, int flag_to_set) 1903 { 1904 int fflags = sh_hash_getflags(filename); 1905 1906 if (fflags >= 0) 1907 { 1908 fflags |= flag_to_set; 1909 sh_hash_setflags(filename, fflags); 1910 } 1911 return; 1912 } 1863 1913 1864 1914 /***************************************************************** … … 2106 2156 2107 2157 memcpy( &(*fp).theFile, &p, sizeof(sh_filestore_t) ); 2108 fp->fflags = 0; 2158 fp->fflags = 0; /* init fflags */ 2109 2159 fp->modi_mask = 0L; 2110 2160
Note:
See TracChangeset
for help on using the changeset viewer.