https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237740
Bug ID: 237740
Summary: dd(1) always report false error about lseek(2) after
read(2) error with 'conv=noerror' / dd(1) wrongly
lseek(2)ed input file on read(2) error with
'conv=noerror'
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: [email protected]
Reporter: [email protected]
Created attachment 204204
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=204204&action=edit
fix-dd-noerror-lseek.diff
Reporting 2 bugs in the same place.
In the latest revision 341257 of 'dd.c', at
https://svnweb.freebsd.org/base/head/bin/dd/dd.c?view=log , line 420, the error
condition should be 'lseek(...) == -1'. The code:
if (in.flags & ISSEEK &&
lseek(in.fd, (off_t)in.dbsz, SEEK_CUR))
should be:
if (in.flags & ISSEEK &&
lseek(in.fd, (off_t)in.dbsz, SEEK_CUR) == -1)
Another bug is, when a read(2) error occurred, read(2) may actually read
something and change the file position then returning -1; when this happens the
later lseek(2) call will over seeking the current position, skipping data that
unrelated to the first read(2) error.
The attached patch fix both bug.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"