aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeebs <seebs@seebs.net>2019-08-01 12:20:04 -0500
committerSeebs <seebs@seebs.net>2019-08-01 12:20:04 -0500
commit097ca3e245200c4a4333964af59a106c42ff3bca (patch)
tree3e65c992b1391ec18e6fa0e4c00e0354c3338fc2
parent996bead0d8503b9abd40b49e23cc308fc645e1ff (diff)
downloadpseudo-097ca3e245200c4a4333964af59a106c42ff3bca.tar.gz
pseudo-097ca3e245200c4a4333964af59a106c42ff3bca.tar.bz2
pseudo-097ca3e245200c4a4333964af59a106c42ff3bca.zip
handle O_NOFOLLOW in flags for open/openat
Did you know that, similar to AT_SYMLINK_NOFOLLOW, there's an O_NOFOLLOW available in flags for open/openat? I didn't.
-rw-r--r--ChangeLog.txt3
-rw-r--r--ports/linux/wrapfuncs.in12
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 81e3584..329b262 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,6 @@
+2019-08-01:
+ * (seebs) Pass flags|O_NOFOLLOW on when resolving paths with openat.
+
2019-05-15:
* (RP) Add SDPX license headers to source files.
diff --git a/ports/linux/wrapfuncs.in b/ports/linux/wrapfuncs.in
index a129eba..4cdbc9c 100644
--- a/ports/linux/wrapfuncs.in
+++ b/ports/linux/wrapfuncs.in
@@ -1,12 +1,12 @@
-int open(const char *path, int flags, ...{mode_t mode}); /* flags=0 */
+int open(const char *path, int flags, ...{mode_t mode}); /* flags=flags|O_NOFOLLOW */
char *get_current_dir_name(void);
int __xstat(int ver, const char *path, struct stat *buf);
int __lxstat(int ver, const char *path, struct stat *buf); /* flags=AT_SYMLINK_NOFOLLOW */
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}); /* flags=0 */
-int __openat_2(int dirfd, const char *path, int flags); /* flags=0 */
+int openat(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=flags|O_NOFOLLOW */
+int __openat_2(int dirfd, const char *path, int flags); /* flags=flags|O_NOFOLLOW */
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 */
@@ -15,9 +15,9 @@ int fcntl(int fd, int cmd, ...{struct flock *lock});
# just so we know the inums of symlinks
char *canonicalize_file_name(const char *filename);
int eaccess(const char *path, int mode);
-int open64(const char *path, int flags, ...{mode_t mode}); /* flags=0 */
-int openat64(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=0 */
-int __openat64_2(int dirfd, const char *path, int flags); /* flags=0 */
+int open64(const char *path, int flags, ...{mode_t mode}); /* flags=flags|O_NOFOLLOW */
+int openat64(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=flags|O_NOFOLLOW */
+int __openat64_2(int dirfd, const char *path, int flags); /* flags=flags|O_NOFOLLOW */
int creat64(const char *path, mode_t mode);
int stat(const char *path, struct stat *buf); /* real_func=pseudo_stat */
int lstat(const char *path, struct stat *buf); /* real_func=pseudo_lstat, flags=AT_SYMLINK_NOFOLLOW */