This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/14578] fchmodat(..., AT_SYMLINK_NOFOLLOW) returns ENOTSUP on non-symlinks
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Thu, 13 Sep 2012 23:09:00 +0000
- Subject: [Bug libc/14578] fchmodat(..., AT_SYMLINK_NOFOLLOW) returns ENOTSUP on non-symlinks
- Auto-submitted: auto-generated
- References: <bug-14578-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=14578
--- Comment #5 from Rich Felker <bugdal at aerifal dot cx> 2012-09-13 23:09:00 UTC ---
I seem to have a solution. In pseudo-code:
if (flags & AT_SYMLINK_NOFOLLOW) {
tmpfd = openat(fd, pathname, O_PATH|O_NOFOLLOW);
if (tmpfd < 0) {
errno = ENOTSUPP;
return -1;
}
int ret = fchmod(tmpfd, mode);
close(tmpfd);
return ret;
}
Obviously this needs some fixes for glibc, like avoiding cancellation points.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.