Page MenuHomeFreeBSD

libsa: replace remaining _write callbacks by null_write
ClosedPublic

Authored by tsoome on Feb 26 2018, 4:44 PM.

Details

Summary

There are some _write callbacks left only returning EROFS, replace them
by null_write. return EROFS from null_write().

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tsoome created this revision.Feb 26 2018, 4:44 PM
imp accepted this revision.Feb 26 2018, 4:46 PM
This revision is now accepted and ready to land.Feb 26 2018, 4:46 PM
kan accepted this revision.Feb 26 2018, 4:47 PM
kan added a subscriber: kan.

... looks ok.

lidl added a subscriber: lidl.Feb 26 2018, 5:01 PM
lidl added inline comments.
stand/libsa/tftp.c
81 ↗(On Diff #39758)

From a technical standpoint, there's nothing that prevents the tftp code from having write method. I don't know that it would be terribly useful (except maybe for 'nextboot' type support).

Perhaps a comment is warranted here, to note that it could be done, it's just a SMOP (small matter of programming).

tsoome added inline comments.Feb 26 2018, 5:50 PM
stand/libsa/tftp.c
81 ↗(On Diff #39758)

Yes, same for other filesystems too, except that it is rather confusing for user, unfortunately.

Also specifically for tftp, it is quite common practice to keep tftpboot tree read only and tftpd service running with minimal rights... So it is not just about having the code not written, but we would rather keep it not written.

cem added inline comments.Feb 26 2018, 6:17 PM
stand/libsa/tftp.c
81 ↗(On Diff #39758)

Not necessarily all other filesystems. iso9660 is probably exclusively RO.

cem accepted this revision.Feb 26 2018, 6:18 PM

No objection. I don't think these error codes actually trickle into anywhere user visible (or to any process that cares, other than != 0).

This revision was automatically updated to reflect the committed changes.