diff options
-rw-r--r-- | ChangeLog.txt | 5 | ||||
-rw-r--r-- | pseudo_util.c | 7 | ||||
-rw-r--r-- | pseudo_wrappers.c | 9 |
3 files changed, 13 insertions, 8 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index a2a0d5c..cf098ed 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,8 @@ +2015-09-01: + * (seebs) use PSEUDO_STATBUF and base_lstat in path resolution, because + plain lstat can fail on XFS if an inode number is out of the 32-bit + range. + 2015-08-24: * (seebs) drop unused/unimplemented "picky_fchmodat", since I currently have no systems which implement it, and the implementation diff --git a/pseudo_util.c b/pseudo_util.c index 7142670..c81df5a 100644 --- a/pseudo_util.c +++ b/pseudo_util.c @@ -83,8 +83,7 @@ static struct pseudo_variables pseudo_env[] = { static int pseudo_util_initted = -1; /* Not yet run */ /* bypass wrapper logic on path computations */ -int (*pseudo_real_lstat)(const char *path, struct stat *buf) = lstat; -int (*pseudo_real_fstat)(int, struct stat *buf) = fstat; +int (*pseudo_real_lstat)(const char *path, PSEUDO_STATBUF *buf) = NULL; #if 0 static void @@ -473,7 +472,7 @@ pseudo_append_element(char *newpath, char *root, size_t allocated, char **pcurre static int link_recursion = 0; size_t curlen; char *current; - struct stat buf; + PSEUDO_STATBUF buf; if (!newpath || !pcurrent || !*pcurrent || !root || !element) { @@ -516,7 +515,7 @@ pseudo_append_element(char *newpath, char *root, size_t allocated, char **pcurre /* if lstat fails, that's fine -- nonexistent files aren't symlinks */ if (!leave_this) { int is_link; - is_link = (pseudo_real_lstat(newpath, &buf) != -1) && S_ISLNK(buf.st_mode); + is_link = (pseudo_real_lstat) && (pseudo_real_lstat(newpath, &buf) != -1) && S_ISLNK(buf.st_mode); if (link_recursion >= PSEUDO_MAX_LINK_RECURSION && is_link) { pseudo_diag("link recursion too deep, not expanding path '%s'.\n", newpath); is_link = 0; diff --git a/pseudo_wrappers.c b/pseudo_wrappers.c index 7920f9e..34d7f23 100644 --- a/pseudo_wrappers.c +++ b/pseudo_wrappers.c @@ -92,8 +92,10 @@ extern ssize_t (*pseudo_real_fgetxattr)(int, const char *, void *, size_t); extern int (*pseudo_real_lsetxattr)(const char *, const char *, const void *, size_t, int); extern int (*pseudo_real_fsetxattr)(int, const char *, const void *, size_t, int); #endif -extern int (*pseudo_real_lstat)(const char *, struct stat *); -extern int (*pseudo_real_fstat)(int, struct stat *); +/* later, the init code can change these to refer to the real calls and + * skip the wrappers. + */ +extern int (*pseudo_real_lstat)(const char *path, PSEUDO_STATBUF *buf); static void _libpseudo_init(void) { @@ -175,8 +177,7 @@ pseudo_init_wrappers(void) { pseudo_real_lsetxattr = real_lsetxattr; pseudo_real_fsetxattr = real_fsetxattr; #endif - pseudo_real_lstat = real_lstat; - pseudo_real_fstat = real_fstat; + pseudo_real_lstat = base_lstat; /* Once the wrappers are setup, we can now use open... so * setup the logfile, if necessary... |