projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
09260b4
)
The file is safe if it doesn't exist.
author
Ivo Timmermans
<ivo@lychnis.net>
Thu, 30 Nov 2000 21:11:03 +0000
(21:11 +0000)
committer
Ivo Timmermans
<ivo@lychnis.net>
Thu, 30 Nov 2000 21:11:03 +0000
(21:11 +0000)
src/conf.c
patch
|
blob
|
history
diff --git
a/src/conf.c
b/src/conf.c
index
11a9ca0
..
8282e2f
100644
(file)
--- a/
src/conf.c
+++ b/
src/conf.c
@@
-19,7
+19,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: conf.c,v 1.9.4.2
7 2000/11/30 00:24:1
3 zarq Exp $
+ $Id: conf.c,v 1.9.4.2
8 2000/11/30 21:11:0
3 zarq Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-356,12
+356,14
@@
int is_safe_path(const char *file)
}
*p = '/';
}
*p = '/';
- if(stat(file, &s) < 0)
+ if(stat(file, &s) < 0
&& errno != ENOENT
)
{
fprintf(stderr, _("Couldn't stat `%s': %m\n"),
file);
return 0;
}
{
fprintf(stderr, _("Couldn't stat `%s': %m\n"),
file);
return 0;
}
+ if(errno == ENOENT)
+ return 1;
if(s.st_uid != geteuid())
{
fprintf(stderr, _("`%s' is owned by UID %d instead of %d.\n"),
if(s.st_uid != geteuid())
{
fprintf(stderr, _("`%s' is owned by UID %d instead of %d.\n"),