7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $PostgreSQL: pgsql/src/port/exec.c,v 1.8 2004/05/18 20:18:59 momjian Exp $
10
+ * $PostgreSQL: pgsql/src/port/exec.c,v 1.9 2004/05/19 04:36:33 momjian Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -92,16 +92,10 @@ validate_exec(char *path)
92
92
* instead of the underlying file, you lose.
93
93
*/
94
94
if (stat (path , & buf ) < 0 )
95
- {
96
- fprintf (stderr , "could not stat \"%s\": %m" , path );
97
95
return -1 ;
98
- }
99
96
100
97
if ((buf .st_mode & S_IFMT ) != S_IFREG )
101
- {
102
- fprintf (stderr , "\"%s\" is not a regular file" , path );
103
98
return -1 ;
104
- }
105
99
106
100
/*
107
101
* Ensure that we are using an authorized executable.
@@ -123,8 +117,6 @@ validate_exec(char *path)
123
117
{
124
118
is_r = buf .st_mode & S_IRUSR ;
125
119
is_x = buf .st_mode & S_IXUSR ;
126
- if (!(is_r && is_x ))
127
- fprintf (stderr , "\"%s\" is not user read/execute" , path );
128
120
return is_x ? (is_r ? 0 : -2 ) : -1 ;
129
121
}
130
122
@@ -152,17 +144,13 @@ validate_exec(char *path)
152
144
{
153
145
is_r = buf .st_mode & S_IRGRP ;
154
146
is_x = buf .st_mode & S_IXGRP ;
155
- if (!(is_r && is_x ))
156
- fprintf (stderr , "\"%s\" is not group read/execute" , path );
157
147
return is_x ? (is_r ? 0 : -2 ) : -1 ;
158
148
}
159
149
}
160
150
161
151
/* Check "other" bits */
162
152
is_r = buf .st_mode & S_IROTH ;
163
153
is_x = buf .st_mode & S_IXOTH ;
164
- if (!(is_r && is_x ))
165
- fprintf (stderr , "\"%s\" is not other read/execute" , path );
166
154
return is_x ? (is_r ? 0 : -2 ) : -1 ;
167
155
168
156
#endif
0 commit comments