on 2024 Feb 16 3:46 AM
Hello,
we have a web application that imports client files into a sybase 12 database.
We are migrating the database to version 17, but the application can no longer read client file.
What changed from 12 to 17 version?
Thanks,
Simona
Request clarification before answering.
Is the read_client_file() call issued by the client as a separate statement, or is it part of a stored procedure or other code block? I'm asking because even with version 12, the database server would require additional verification for client file access when the call appeared not directly, but within a stored procedure or the like. Cf. the SA_REGISTER_VALIDATE_FILE_TRANSFER_CALLBACK ODBC extended attribute.
AFAIK, the handling has not been changed in v17 comapred to v12 – except for the changes by the role-based security model added with v16 as mentioned by Mark.
A note to your error message: It seems you are using an older ODBC Driver because of the "Sybase" brand, I would suggest to use a SQL Anywhere 17 driver, as well.
With that, you might check whether different settings of the new connection parameter "ClientFileValidator(CFV)" could help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The read_file_client() is called from a stored procedure. We don't remember using the SA_REGISTER_VALIDATE_FILE_TRANSFER_CALLBACK ODBC extended attribute. How can I control if we used the SA_REGISTER_VALIDATE_FILE_TRANSFER_CALLBACK on the v12? It's quite strange, we are using the SQL Anywhere 17 driver, I don't know why the error shows the 'Sybase' brand. I looked at the v17 ODBC, but I didn't find the connection parameter 'ClientFielValidator': should it be included in the additional ones?
How can I control if we used the SA_REGISTER_VALIDATE_FILE_TRANSFER_CALLBACK on the v12?
Well, the attribute SA_REGISTER_VALIDATE_FILE_TRANSFER_CALLBACK would have to be set in the (web) application code as part of a ODBC SQLSetConnectAttr() call.
Does it work to read a client file from within the web application directly, i.e. outside a stored procedure call? (Because if so, I guess it would really point to the SA_REGISTER_VALIDATE_FILE_TRANSFER_CALLBACK feature, if not, it would be a different issue.)
Yes, the "ClientFileValidator" connection parameter would be to be configured as an additional parameter on the "Advanced" tab, yes. But I don't expect it to really help as the possible values seem to further restrict the pre-configured connection specific permissions - there is no "Allow always" setting...
Client application does not allow transfer of data
That error message (with SQLCODE -1200) has the following description:
The client application reported a permissions error while attempting to access the object for a data transfer request from the server. The client application likely does not have the necessary operating system authorization required to access the object.
Just as a wild guess: Could it be the problem is a missing permission per OS instead of per database?
My question was related to the machine on which you checked the read_client_file() call via DBISQL. Is that the same machine the web server runs on, and do you use the same OS account for DBISQL and the web server? – I'm just asking to find out whether both "tests" (DBISQL vs. web server) use the same DSNs, drivers and OS permissions...
Well, if the DBISQL client itself has to ask for persmission to read a client file, then IMHO this strongly suggests that the web server really would need to register the according callback mentioned in my answer - because the question within DBISQL is part of DBISQL's own according callback...
Another approach might be to modify the according stored procedure so the read_file_client() call is used directly against the database server, say by putting its return value in a connection-specific variable or in a local temporary table just before the procedure is called, and the procedure would then access that variable/table contents. That way the database engine won't ask for permission because the client file access is then treated as "direct". A similar question and solution has been discussed here.
Aside: Otherwise, I'm out of my wits, and you might hope for other folks to answer or ask for official SAP support...
IIRC in order to use read_client_file in v17, you must enable the system privilege READ CLIENT FILE on the current connection. See the Privileges section on this page in the SQLA reference section. I'm not sure when this was added but likely didn't exist in v12.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We have migrated the SQLAnywhere 12 database and the user we use for the connection has the SYS_AUTH_READFILECLIENT_ROLE and the database has the allow_read_file_client property on. We have added the READ_CLIENT_FILE system privilege to the user, but when we try to upload a file from a client we have the application error 'Microsoft OLE DB Provider for ODBC Drivers: [Sybase][ODBC Driver][SQL Anywhere]Client application does not allow transfer of data'. The same web application with a SQLAnywhere 12 database has no issues with the allow_read_file_client database property on and the 'Read client file' authority for the user.
User | Count |
---|---|
87 | |
9 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.