This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug locale/22089] [PATCH] locale: Call fchmod() before calling link()


https://sourceware.org/bugzilla/show_bug.cgi?id=22089

--- Comment #3 from Dmitry V. Levin <ldv at sourceware dot org> ---
(In reply to Colin from comment #0)
> Currently rpm-ostree will run all scripts, such as glibc's
> `build-locale-archive` with an rofiles-fuse mount active. This fails
> because we call `fchmod()` *after* calling `link()`, and `rofiles-fuse`
> rejects writes to files with multiple links.

What the current code does is essentially the following:
 fd = mkstemp (fname);
 link (fname, archivefname);
 unlink (fname);
 fchmod (fd, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);

How could this lead to creation of a file with multiple links?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]