Hi tech@,

Maybe a error check of fchmod is necessary. Sorry if I am wrong, thanks!

Index: ldconfig.c
===================================================================
RCS file: /cvs/src/libexec/ld.so/ldconfig/ldconfig.c,v
retrieving revision 1.37
diff -u -p -r1.37 ldconfig.c
--- ldconfig.c  26 Apr 2018 12:42:50 -0000      1.37
+++ ldconfig.c  7 Jun 2018 07:04:45 -0000
@@ -386,7 +386,11 @@ buildhints(void)
                warn("%s", tmpfilenam);
                goto out;
        }
-       fchmod(fd, 0444);
+
+       if (fchmod(fd, 0444) == -1) {
+               warn("%s", tmpfilenam);
+               goto out;
+       }

        if (write(fd, &hdr, sizeof(struct hints_header)) !=
            sizeof(struct hints_header)) {

-- 
Best Regards
Nan Xiao

Reply via email to