Re: [BUGS] COPY when 'filename' is a directory
От | Tom Lane |
---|---|
Тема | Re: [BUGS] COPY when 'filename' is a directory |
Дата | |
Msg-id | 27606.1014514067@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: [BUGS] COPY when 'filename' is a directory (Bruce Momjian <pgman@candle.pha.pa.us>) |
Ответы |
Re: [BUGS] COPY when 'filename' is a directory
Re: [BUGS] COPY when 'filename' is a directory |
Список | pgsql-patches |
Bruce Momjian <pgman@candle.pha.pa.us> writes: > { > + struct stat st; > fp = AllocateFile(filename, PG_BINARY_R); > ! > ! if (fp == NULL) > elog(ERROR, "COPY command, running in backend with " > "effective uid %d, could not open file '%s' for " > "reading. Errno = %s (%d).", > (int) geteuid(), filename, strerror(errno), errno); > + > + fstat(fileno(fp),&st); > + if( S_ISDIR(st.st_mode) ){ > + fclose(fp); > + elog(ERROR,"COPY: %s is a directory.",filename); > + } This coding is WRONG. You do not use fclose() to release a file opened with AllocateFile. [ several other instances of same error in patch... ] regards, tom lane
В списке pgsql-patches по дате отправления: