09-12-2011
Capture the original user
in our environment role ids are created in unix to which user does su.
say my individual id is drout and a role is devid.
i will login to drout
the su - devid
password : <nothing > password less role id
then i will login to devid.
can i write a function and pass it in a script while i logged in to devid which will say my original user id drout.
say orig_user_id=function() ..
function() should return my user id and assign to the vvaribale which can be used at different places.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I've got one I haven't been able to figure out.
1. A shell script exists- /junk/junk1/junk2/junk3.sh
2. From within the above named shell script, I want to know the full path of the above named shell script. Even if I execute the shell script from a directory other than the one it resides in,... (5 Replies)
Discussion started by: therealtiger
5 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
I want to sort a file based on the number in the 9th column
I've tried both of the following commands
sort -k 9,9n file_to_sort.dat
sort +8 -n file_to_sort.dat
both resulting in the same output which does sort col 9 nummerically
but it doesn't output the lines in the original... (2 Replies)
Discussion started by: olga
2 Replies
3. Shell Programming and Scripting
Hi all,
I have a problem which needs to be solved soon because it affects auditing capabilities.
There is an application id that has to be used by other users for the purpose of production support.
The application user id uses C shell.
We allow users to switch to the application user id based... (1 Reply)
Discussion started by: s_saran
1 Replies
4. UNIX for Dummies Questions & Answers
sorry for my English
We'll report about Unix in my school, for Operating Systems subject...
with Installation demo....
I'm wondering if System V, which is from original developers AT&T still exist
and downloadable? because I cant find it anywhere...
then i found out that Solaris, MacOS... (4 Replies)
Discussion started by: slowchem
4 Replies
5. UNIX for Advanced & Expert Users
I have to write a script (not C based) that allows to capture of all commands issued by the user “root”.
First, I tried to monitor the .bash_history but the commands are written in chunk after the .bash_history is closed.
How can I capture the commands in Real-Time without waiting root to... (4 Replies)
Discussion started by: elieifrah@gmail
4 Replies
6. UNIX for Dummies Questions & Answers
BSD, AFAIK, Linux, etc are developed/based upon UNIX... but they are not UNIX...
I'm wandering where can I obtain a original copy of UNIX(without flavor) (1 Reply)
Discussion started by: laduch
1 Replies
7. Shell Programming and Scripting
I want to copy a file from another user to my owner directory, and want to change the ownership to my account.
in jung's directory:
-rwxr-xr-x 1 jung smart 23 Dec 1 2005 .runme
cp /home/jung/runme .
under my directory:
-rwxr-xr-x 1 jung smart 23 Dec 1... (1 Reply)
Discussion started by: freelong
1 Replies
8. HP-UX
Hi
I want to know how capture all user command line output and save this commands and outputs to text files?
if you have script for this subject please give me.:o
please help me
thank you (6 Replies)
Discussion started by: amvhd
6 Replies
9. Emergency UNIX and Linux Support
Can someone please help me with a way to generate a user list on a system along with the group to which the id belongs? (8 Replies)
Discussion started by: ggayathri
8 Replies
10. UNIX for Beginners Questions & Answers
Hi Team,
Please help me with the below question.
SunOS 5.10
Shell: -bash
I am trying to find the original user who executed a command on my development server.
In my dev server users login using their personal id and sudo to a common id using 'sudo -u commonid -i'. Once logged in as... (6 Replies)
Discussion started by: sam99
6 Replies
LEARN ABOUT OPENSOLARIS
ldi_get_dev
ldi_get_dev(9F) Kernel Functions for Drivers ldi_get_dev(9F)
NAME
ldi_get_dev, ldi_get_otyp, ldi_get_devid, ldi_get_minor_name - Extract information from a layered handle
SYNOPSIS
#include <sys/sunldi.h>
int ldi_get_dev(ldi_handle_t lh, dev_t *devp);
int ldi_get_otyp(ldi_handle_t lh, int *otyp);
int ldi_get_devid(ldi_handle_t lh, ddi_devid_t *devid);
int ldi_get_minor_name(ldi_handle_t lh, char **minor_name);
PARAMETERS
lh Layered handle
otyp Indicates on which interface the driver was opened. Valid settings are:
OTYP_BLK Open device block interface.
OTYP_CHR Open device character interface.
devp Pointer to a device number.
devid Device ID.
minor_name Minor device node name.
DESCRIPTION
The ldi_get_dev() function retrieves the dev_t associated with a layered handle.
The ldi_get_otyp() retrieves the open flag that was used to open the device associated with the layered handle.
The ldi_get_devid() function retrieves a devid for the device associated with the layered handle. The caller should use ddi_devid_free()
to free the devid when done with it.
The ldi_get_minor_name() function retrieves the name of the minor node opened for the device associated with the layered handle.
ldi_get_minor_name() allocates a buffer containing the minor node name and returns it via the minor_name parameter. The caller should use
kmem_free() to release the buffer when done with it.
RETURN VALUES
The ldi_get_dev(), ldi_get_otyp(), ldi_get_devid(), and ldi_get_devid() functions return 0 upon success.
In case of an error, the following values may be returned:
EINVAL Invalid input parameters.
ENOTSUP The operation is not supported for this device.
CONTEXT
These functions may be called from user or kernel context.
SunOS 5.11 3 June 2003 ldi_get_dev(9F)