@@ -132,25 +132,32 @@ private function RecurseDir($dir)
132
132
133
133
$ this ->Log (sprintf ('Searching directory %1$s ' , $ dir ));
134
134
135
+ if (!GitPHP_Util::IsWindows () && (fileperms ($ dir ) & 0111 ) == 0 ) {
136
+ $ this ->Log (sprintf ('Folder %1$s is protected... mode %2$o ' , $ dir , fileperms ($ dir )));
137
+ }
138
+
135
139
if ($ dh = opendir ($ dir )) {
136
140
$ trimlen = strlen (GitPHP_Util::AddSlash ($ this ->projectRoot )) + 1 ;
137
141
while (($ file = readdir ($ dh )) !== false ) {
138
142
$ fullPath = $ dir . '/ ' . $ file ;
139
-
140
143
if (!GitPHP_Util::IsDir ($ fullPath ) || $ file == '. ' || $ file == '.. ' )
141
144
continue ;
142
-
143
- elseif ( $ this ->repoSupport and $ file == '.repo ' )
145
+ elseif ($ this ->repoSupport && $ file == '.repo ' )
144
146
; // check subfolders
145
-
146
- elseif ( substr ($ file ,-4 ) != '.git ' ) {
147
+ elseif (substr ($ file ,-4 ) != '.git ' ) {
147
148
// working copy repositories (git clone)
148
149
if ( !$ this ->bareOnly && GitPHP_Util::IsDir ($ fullPath . '/.git ' ) )
149
150
$ fullPath .= '/.git ' ;
150
151
elseif ($ this ->curlevel >= $ this ->sublevels or substr ($ file ,0 ,1 ) == '. ' )
151
152
continue ;
152
153
}
153
154
155
+ // check +x access on .git folder
156
+ if (!GitPHP_Util::IsWindows () && (fileperms ($ fullPath .'/. ' ) & 0111 ) == 0 ) {
157
+ $ this ->Log (sprintf ('Folder %1$s is protected... mode %2$o ' ,
158
+ $ fullPath , fileperms ($ fullPath )));
159
+ }
160
+
154
161
if (is_file ($ fullPath . '/HEAD ' ) || is_file ($ fullPath . '/ORIG_HEAD ' )) {
155
162
$ projectPath = substr ($ fullPath , $ trimlen );
156
163
if (!isset ($ this ->projects [$ projectPath ])) {
0 commit comments