diff options
-rw-r--r-- | ChangeLog.txt | 1 | ||||
-rwxr-xr-x | makewrappers | 2 | ||||
-rw-r--r-- | ports/linux/wrapfuncs.in | 4 |
3 files changed, 4 insertions, 3 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 36a1927..d6e3fca 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,7 @@ calls to diag() and debug(). * (seebs) Fix a lurking stray slash that could happen while resolving absolute symlinks. + * (seebs) fix mishandled flags for symlink following. 2018-04-02: * (seebs) Change default copyright notice in guts to diff --git a/makewrappers b/makewrappers index ff08ba0..fa514ba 100755 --- a/makewrappers +++ b/makewrappers @@ -275,7 +275,7 @@ class Function: self.specific_dirfds[arg.name[:-5]] = True self.dirfd = 'dirfd' elif arg.name == 'flags': - self.flags = 'flags' + self.flags = '(flags & AT_SYMLINK_NOFOLLOW)' elif arg.name.endswith('path'): self.paths_to_munge.append(arg.name) diff --git a/ports/linux/wrapfuncs.in b/ports/linux/wrapfuncs.in index 9be6505..e47acc3 100644 --- a/ports/linux/wrapfuncs.in +++ b/ports/linux/wrapfuncs.in @@ -5,8 +5,8 @@ int __lxstat(int ver, const char *path, struct stat *buf); /* flags=AT_SYMLINK_N int __fxstat(int ver, int fd, struct stat *buf); int lchown(const char *path, uid_t owner, gid_t group); /* flags=AT_SYMLINK_NOFOLLOW */ int __fxstatat(int ver, int dirfd, const char *path, struct stat *buf, int flags); -int openat(int dirfd, const char *path, int flags, ...{mode_t mode}); -int __openat_2(int dirfd, const char *path, int flags); +int openat(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=0 */ +int __openat_2(int dirfd, const char *path, int flags); /* flags=0 */ int mknod(const char *path, mode_t mode, dev_t dev); /* real_func=pseudo_mknod */ int mknodat(int dirfd, const char *path, mode_t mode, dev_t dev); /* real_func=pseudo_mknodat */ int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev); /* flags=AT_SYMLINK_NOFOLLOW */ |