Lines Matching refs:inname
2032 -file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unused)),
2034 +file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const void *buf,
2048 - if ((m = file_zmagic(ms, fd, inname, ubuf, nb)) != 0) {
2049 + if ((m = file_zmagic(ms, stream, inname, ubuf, nb)) != 0) {
2395 - return file_or_fd(ms, inname, STDIN_FILENO);
2396 + return file_or_stream(ms, inname, NULL);
2408 -file_or_fd(struct magic_set *ms, const char *inname, int fd)
2409 +file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
2419 + if (!inname && !stream) {
2435 - switch (file_fsmagic(ms, inname, &sb)) {
2436 + switch (file_fsmagic(ms, inname, &sb, stream)) {
2444 - if (inname == NULL) {
2451 - if (stat(inname, &sb) == 0 && S_ISFIFO(sb.st_mode)) {
2454 + if (!stream && inname) {
2457 + stream = php_stream_open_wrapper((char *)inname, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
2459 + stream = php_stream_open_wrapper((char *)inname, "rb", REPORT_ERRORS, NULL);
2466 - if ((fd = open(inname, flags)) < 0) {
2467 - if (unreadable_info(ms, sb.st_mode, inname) == -1)
2471 + if (unreadable_info(ms, sb.st_mode, inname) == -1)
2501 - if (unreadable_info(ms, sb.st_mode, inname) == -1)
2509 - file_error(ms, errno, "cannot read `%s'", inname);
2513 + file_error(ms, errno, "cannot read `%s'", inname);
2518 - if (file_buffer(ms, fd, inname, buf, (size_t)nbytes) == -1)
2519 + if (file_buffer(ms, stream, inname, buf, (size_t)nbytes) == -1)
2524 - close_and_restore(ms, inname, fd, &sb);
2531 + close_and_restore(ms, inname, 0, &sb);