Pivot user for launching sqlplus

Gabriel Menini <[email protected]>
Newsgroups gmane.comp.tools.sudo.user
Message-ID <OF520A58B4.E432EF2F-ON03258423.00714E4E-03258423.00714E7B@ose.com.uy>
Hi, there.


I managed to create a ``superora'' user to be invoked using sudo. The ``superora'' user will have to inherit some Oracle needed environment variables or, in case it can't, at least be able to load the .profile where such variables are being exported.
Also, there is an alias in /home/superora/.profile which points to the correct sqlplus binary.


This is what I have in sudoers file:


User_Alias    SUPERORA = user1, user2


Cmnd_Alias SQLPLUSBIN = /path/to/bin/sqlplus *
Cmnd_Alias LOADPROFILE = /usr/bin/sh .profile
Cmnd_Alias MYENVIRONMENT    = /usr/bin/env


SUPERORA ALL=(superora) SQLPLUSBIN, LOADPROFILE, MYENVIRONMENT






I run the command and it seems the binary is OK but environment variables aren't being loaded:


(user1@orahost) /home/user1> sudo -u superora sqlplus
Password: 
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
(user1@orahost) /home/user1> 




Any hints will be appreciated.
Thanks.


Regards,
--
Gabriel Menini
El presente correo y cualquier posible archivo adjunto están dirigidos únicamente al destinatario del mensaje y contiene información que puede ser confidencial. Si Ud. no es el destinatario correcto por favor notifique al remitente respondiendo anexando este mensaje y elimine inmediatamente el e-mail y los posibles archivos adjuntos al mismo de su sistema. Está prohibida cualquier utilización, difusión o copia de este e-mail por cualquier persona o entidad que no sean las específicas destinatarias del mensaje. OSE no acepta ninguna responsabilidad con respecto a cualquier comunicación que haya sido emitida incumpliendo nuestra Política de Seguridad de la Información y la Ley de Protección de Datos y Acción de Habeas Data Nº 18.331.

This e-mail and any attachment are confidential and are intended solely for the addressee(s). If you are not intended recipient please inform the sender immediately, answering this e-mail and delete it as well as the attached files. Any use, circulation or copy of this e-mail by any person or entity that is not the specific addressee(s) is prohibited. OSE is not responsible for any communication emitted without respecting our Information Security Policy and the Data Protection Act and Habeas Data Action No. 18.331.
____________________________________________________________
sudo-users mailing list <[email protected]>
For list information, options, or to unsubscribe, visit:
https://www.sudo.ws/mailman/listinfo/sudo-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.