Bug? "fstat64(f, &sb) < 0 && S_ISREG(sb.st_mode)"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



                /* Take care of noclobber mode. */
                if (Cflag) {
                        fname = redir->nfile.expfname;
                        if (stat64(fname, &sb) < 0) {
                                if ((f = open64(fname,
O_WRONLY|O_CREAT|O_EXCL, 0666)) < 0)
                                        goto ecreate;
                        } else if (!S_ISREG(sb.st_mode)) {
                                if ((f = open64(fname, O_WRONLY, 0666)) < 0)
                                        goto ecreate;
                                if (fstat64(f, &sb) < 0 &&
S_ISREG(sb.st_mode)) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
was it meant to be "fstat64(f, &sb) < 0 || S_ISREG(sb.st_mode)" ?

                                        close(f);
                                        errno = EEXIST;
                                        goto ecreate;
                                }
                        } else {
                                errno = EEXIST;
                                goto ecreate;
                        }
                        break;
                }
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux