on ‎2013 Oct 05 12:38 PM
Does xp_cmdshell access the Linux shell as well as the windows shell as appropriate depending on the base system? If so which linux shell is accessed and does this require configuration? I am attempting to run a privileged linux command (requiring SUDO) from a SQL Anywhere script running in ISQL. I am attempting to determine which version of askpass is required for the SUDO -A environment variable. OpenSuSE 12.3 installs the x11 version by default; it does not work or I have configured it improperly. I am running Gnome and there is a gnome (and kde3 I believe I do not need) version of askpass that could work; I will be trying the gnome version next.
I have read the DCX help and there was no discussion of specific linux actions.
Thanks
Request clarification before answering.
Yes, xp_cmdshell works on all platforms that SQL Anywhere is supported. On Linux and all Unix platforms xp_cmdshell emulates system(3): it spawns /bin/sh (/usr/bin/sh on some platforms) and passes the given command.
Note that your xp_cmdshell() request will be executed by the database server not ISQL and therefore xp_cmdshell command will be given the same permissions that are given to the server. Depending how you are running your server (e.g. running as a service / daemon?) the command may not have rights to interact with the terminal or console user - i.e. there may not be an attached TTY. I.e. in your specific case the 'askpass' program may not be able to ask the attached user for their password.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.