Comments (4)
It's @doug-gilbert's decision, but I don't like this idea much.
Changing the default behavior of a tool that has existed for decades is dangerous. sg3_utils
supports other OSes besides systemd-based Linux. There might be environments in which opening the device read-only would make the command fail (not sure about that).
Note that sg3_utils
ships with its own set of SCSI udev rules, which replace systemd's native ones. These are used on openSUSE, for example, and they try to avoid doing I/O on the device. It would be interesting to figure out if the issue is also observed if the sg3_utils udev rule set is used.
from sg3_utils.
In Linux, scsi_cmd_allowed allows START_STOP command on read-only fds. How about sg_start
defaults to read-only on Linux, and defaults to read-write on other OSes?
from sg3_utils.
I suggest you create a PR and let @doug-gilbert decide.
from sg3_utils.
I thought there are many more utilities from sg3_utils could open device in read-only mode rather than read-write mode under Linux. I tried that on sg_sat_identify as well. But upon reading sg3_utils source code, I found something like this:
pr2serr("If %s is a sg device, need read+write "
"permissions, even to read it!\n", inf);
and
static int
sg_in_open(const char * fnp, struct flags_t * flagp, int bs, int bpt)
{
int flags = O_RDWR;
These code pieces make me feel not confident about changing the default open flag from O_RDWR to O_RDONLY. It should work on normal SCSI disks, but may or may not work on SCSI generic devices or other SCSI device types.
Closing this issue as my proposed modification may cause breaking changes.
from sg3_utils.
Related Issues (16)
- Identify device output for SATA on big endian HOT 11
- The sorting order of the output numeric part is out of order HOT 3
- shared library SONAME HOT 2
- rescan_scsi_bus.sh: Why it's pointless to do a target scan on FC ? HOT 3
- rescan-scsi-bus.sh: function "findremapped" is too slow when there is 1K luns on server,is there any way to solve it? HOT 5
- rescan-scsi-bus.sh: when there is a logical lun-0, testonline will spend 30s to retry-check it HOT 6
- Strange behavior of sg_inq -HH option HOT 2
- invalid VPD response; probably a STANDARD INQUIRY response HOT 2
- Regression in sgp_dd command HOT 4
- Input parameter handling for sg_wr_mode fails... HOT 3
- sg_logs: output for Device Statistics page (14h), serial numbers should be strings? HOT 5
- rescan-scsi-bus.sh: -r flag unmounts active root disk HOT 3
- Something weird happened in windows... please help me understand. HOT 3
- sg_ses: order of low_crit and low_warn thresholds is mixed for `--get` command
- mmap IO example mistake
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sg3_utils.