X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fchdir-safer.c;h=09b2738ffa1d68113cbe7a935ebdb0c81686d8d4;hb=cb07569c0de7172006a6dcf94adc5658fdaa523c;hp=b41123014c8863388b0f25e6ff98665a27954dac;hpb=14bf04a59fbfa9ae7a9b55f7885ed96a5f0341ac;p=gnulib.git diff --git a/lib/chdir-safer.c b/lib/chdir-safer.c index b41123014..09b2738ff 100644 --- a/lib/chdir-safer.c +++ b/lib/chdir-safer.c @@ -18,9 +18,7 @@ /* written by Jim Meyering */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include "chdir-safer.h" @@ -30,18 +28,7 @@ #include #include #include - -#ifndef O_DIRECTORY -# define O_DIRECTORY 0 -#endif - -#ifndef O_NOFOLLOW -# define O_NOFOLLOW 0 -#endif - -#define SAME_INODE(Stat_buf_1, Stat_buf_2) \ - ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \ - && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev) +#include "same-inode.h" /* Like chdir, but fail if DIR is a symbolic link to a directory (or similar funny business), or if DIR is not readable. This avoids a