Sponsored Content
Top Forums Programming Hiding commnd line arguments in ps command on Linux Post 302905098 by achenle on Monday 9th of June 2014 02:54:35 PM
Old 06-09-2014
A bit late, but I'll toss it out there anyway:

Some OS's also make a copy of the initial command line arguments. For example, Solaris keeps a copy the first 80 characters of the initial command line arguments. In kernel space.

So even if you can write over the copy of the command line arguments passed into your program, that may not be the only copy.
 

10 More Discussions You Might Find Interesting

1. Programming

command line arguments

Hi How to pass multi line text as a command line argument to a program. (i.e) ./a.out hi this is sample 0 file1 where hi this is sample should be stored in argv 0 in argv and so on... (3 Replies)
Discussion started by: bankpro
3 Replies

2. UNIX for Dummies Questions & Answers

arguments in command line

Hi all, How many arguments can we pass while testing a prgm at command line.. I encountered an issue while passing 10 arguments. For $10 its taking argument passed for $1 followed by 'zero'. can we pass more than 9 arguments /Is there any other way. Thanks, rrs (6 Replies)
Discussion started by: rrs
6 Replies

3. Shell Programming and Scripting

i want to list all command line arguments except

Hi all i want to list out all command line arguments except $1 i have passed to a script. Ex: sh cmdline.sh one two three four five o/p: two three four five (3 Replies)
Discussion started by: naree
3 Replies

4. Shell Programming and Scripting

command line arguments

-------------------------------------------------------------------------------- I have this while loop and at the end I am trying to get it to tell me the last argument I entered. And with it like this all I get is the sentence with no value for $1. Now I tried moving done after the sentence... (1 Reply)
Discussion started by: skooly5
1 Replies

5. Shell Programming and Scripting

Getting error in command line arguments

Hi, When i am running the following script 1.sh (without giving the command line arguments) then i am getting the following error. if then echo "UID and PWD are correct" elif then echo "Either UID or PWD is wrong. Please check your UID and PWD" else echo "UID and PWD can't be blank"... (9 Replies)
Discussion started by: sunitachoudhury
9 Replies

6. UNIX for Dummies Questions & Answers

Command line arguments.

I am working on a script wherein i need the user to enter the Build ID for eg:the command line will show enter the build ID Now on entering the build ID it should be assigned to @ARGV. How can this be done.? (1 Reply)
Discussion started by: Varghese
1 Replies

7. Shell Programming and Scripting

Hiding processes / process arguments

Is there a way of hiding a process, or at the very least, process arguments? I'm writing a hosting panel (PHP), and I need to be able to adduser and do other tasks in which I do not want the arguments shown on the termnial for other users of the system. Thanks (0 Replies)
Discussion started by: jaymac407
0 Replies

8. UNIX for Dummies Questions & Answers

getopts - command line arguments

Hi, I'm having problems with a script where I wanted every single option specified in the command line to have an argument taken with it, but for some reason only d works in the code I will be showing below. For example if I did ./thisfile -a something it would come up with "a chosen with " as... (2 Replies)
Discussion started by: IceX
2 Replies

9. UNIX for Dummies Questions & Answers

command line arguments

hi, can someone how to accept command line arguments as a variable using in script? like: ./scriptname arguments by accept arguments, I can use it in my script? thx! (1 Reply)
Discussion started by: ikeQ
1 Replies

10. Shell Programming and Scripting

command line arguments

hi,,,, I want to create a command prompt, for example "prompt>", so my prompt need to handle commands, for example "prompt>cmd", so i want to know how to get arguments for my own commands cmd, i.e. default argc should contain arguments count and argv should point to the argument vector i.e, for... (2 Replies)
Discussion started by: vins_89
2 Replies
kvm_getu(3KVM)						    Kernel VM Library Functions 					    kvm_getu(3KVM)

NAME
kvm_getu, kvm_getcmd - get the u-area or invocation arguments for a process SYNOPSIS
cc [ flag... ] file... -lkvm [ library...] #include <kvm.h> #include <sys/param.h> #include <sys/user.h> #include <sys/proc.h> struct user *kvm_getu(kvm_t *kd, struct proc *proc); int kvm_getcmd(kvm_t *kd, struct proc *proc, struct user *u, char ***arg, char ***env); DESCRIPTION
The kvm_getu() function reads the u-area of the process specified by proc to an area of static storage associated with kd and returns a pointer to it. Subsequent calls to kvm_getu() will overwrite this static area. The kd argument is a pointer to a kernel descriptor returned by kvm_open(3KVM). The proc argument is a pointer to a copy in the current process's address space of a proc structure, obtained, for instance, by a prior kvm_nextproc(3KVM) call. The kvm_getcmd() function constructs a list of string pointers that represent the command arguments and environment that were used to ini- tiate the process specified by proc. The kd argument is a pointer to a kernel descriptor returned by kvm_open(3KVM). The u argument is a pointer to a copy in the current process's address space of a user structure, obtained, for instance, by a prior kvm_getu() call. If arg is not NULL, the command line argu- ments are formed into a null-terminated array of string pointers. The address of the first such pointer is returned in arg. If env is not NULL, the environment is formed into a null-terminated array of string pointers. The address of the first of these is returned in env. The pointers returned in arg and env refer to data allocated by malloc() and should be freed by a call to free() when no longer needed. See malloc(3C). Both the string pointers and the strings themselves are deallocated when freed. Since the environment and command line arguments might have been modified by the user process, there is no guarantee that it will be possi- ble to reconstruct the original command at all. The kvm_getcmd() function will make the best attempt possible, returning -1 if the user process data is unrecognizable. RETURN VALUES
On success, kvm_getu() returns a pointer to a copy of the u-area of the process specified by proc. On failure, it returns NULL. The kvm_getcmd() function returns 0 on success and -1 on failure. If -1 is returned, the caller still has the option of using the command line fragment that is stored in the u-area. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
kvm_nextproc(3KVM), kvm_open(3KVM), kvm_kread(3KVM), malloc(3C), libkvm(3LIB), attributes(5) NOTES
On systems that support both 32-bit and 64-bit processes, the 64-bit implementation of libkvm ensures that the arg and env pointer arrays for kvm_getcmd() are translated to the same form as if they were 64-bit processes. Applications that wish to access the raw 32-bit stack directly can use kvm_uread(). See kvm_read(3KVM). SunOS 5.10 2 May 2002 kvm_getu(3KVM)
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy