-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify quotes in changes.csv #768
Comments
Here is the investigation result from @oxisto: CSV QuotingThe relevant section for quoting is RFC 4180, Section 2. Support of Quoted FieldsSection 2 Paragraph 5 states "Each field may or may not be enclosed in double quotes" Mandatory QuotesFurthermore, it states "If fields are not enclosed with double quotes, then double quotes may not appear inside the fields.". Similarly, Section 2 Paragraph 6 states "Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes.". This means that in addition to above, also values containing line breaks and commas must be quoted. Section 2 Paragraph 7 states "If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote.". Example: State of ImplementationGoGo has the package Java/KotlinKotlin has a third-party library (https://github.com/jsoizo/kotlin-csv), it supports a "quote.mode" of PythonThe RustRust has a community crate BashBash has no out-of-the box support for reading CSV, but it can be achieved with a multitude of different tools, such as Note: In general, direct usage of bash reading input from an external source should always be discouraged because of the possibility of CSV injection attacks! Instead, a programming language should be used in order to avoid direct injection of shell commands. Pro vs. ConCon Always Quoted
Pro Always Quoted
|
Suggested phrasingfor https://docs.oasis-open.org/csaf/csaf/v2.0/os/csaf-v2.0-os.html#7113-requirement-13-changescsv
potentially for more verbosity or a rational:
alternatively to the previous sentence:
Note for implementors: |
- addresses parts of oasis-tcs#768 - change changes.csv to non-quoted - clarify wording - add normative reference to RFC 4180
- addresses parts of oasis-tcs#768 - change changes.csv to non-quoted - clarify wording - add normative reference to RFC 4180
Currently, it is not clear whether quotes are mandatory in the changes.csv or not. We should have a clear statement about that.
Currently, I tend to say: "All fields SHOULD be quoted." However, we need to check whether that is allowed by the csv-RFC.
The text was updated successfully, but these errors were encountered: