Skip to content
Snippets Groups Projects
Commit dbb9aa22 authored by Bruce Momjian's avatar Bruce Momjian
Browse files

Supress verbose stderr messages while trying to find my exec path.

Per report from Christopher.
parent 132d0905
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/exec.c,v 1.8 2004/05/18 20:18:59 momjian Exp $
* $PostgreSQL: pgsql/src/port/exec.c,v 1.9 2004/05/19 04:36:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -92,16 +92,10 @@ validate_exec(char *path)
* instead of the underlying file, you lose.
*/
if (stat(path, &buf) < 0)
{
fprintf(stderr, "could not stat \"%s\": %m", path);
return -1;
}
if ((buf.st_mode & S_IFMT) != S_IFREG)
{
fprintf(stderr, "\"%s\" is not a regular file", path);
return -1;
}
/*
* Ensure that we are using an authorized executable.
......@@ -123,8 +117,6 @@ validate_exec(char *path)
{
is_r = buf.st_mode & S_IRUSR;
is_x = buf.st_mode & S_IXUSR;
if (!(is_r && is_x))
fprintf(stderr, "\"%s\" is not user read/execute", path);
return is_x ? (is_r ? 0 : -2) : -1;
}
......@@ -152,8 +144,6 @@ validate_exec(char *path)
{
is_r = buf.st_mode & S_IRGRP;
is_x = buf.st_mode & S_IXGRP;
if (!(is_r && is_x))
fprintf(stderr, "\"%s\" is not group read/execute", path);
return is_x ? (is_r ? 0 : -2) : -1;
}
}
......@@ -161,8 +151,6 @@ validate_exec(char *path)
/* Check "other" bits */
is_r = buf.st_mode & S_IROTH;
is_x = buf.st_mode & S_IXOTH;
if (!(is_r && is_x))
fprintf(stderr, "\"%s\" is not other read/execute", path);
return is_x ? (is_r ? 0 : -2) : -1;
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment