Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Is there a way with IPC::Run to hide command options from process table?

by DeadPoet (Scribe)
on Jul 23, 2013 at 13:19 UTC ( [id://1045857]=perlquestion: print w/replies, xml ) Need Help??

DeadPoet has asked for the wisdom of the Perl Monks concerning the following question:

Just wondering if anyone has a good example, using IPC::Run, of hiding command options from the UNIX process table.

I know that in a script one can normally set the $0 option to another value to hide that scripts options. But how would that be accomplished with IPC::Run, when IPC::Run is running a native system command?

Thanks in advance for any and all responses.

--poet

Replies are listed 'Best First'.
Re: Is there a way with IPC::Run to hide command options from process table?
by BrowserUk (Patriarch) on Jul 23, 2013 at 13:36 UTC

    I'd love to see your legitimisation for this.

    1. If this is to run on a system you 'own'; why would you need to hide this from yourself.
    2. And if you don't 'own' the system; what right or reason do you have to hide this from the owner.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Browser, I always love and respect your comments, as well as the guidance that you provide. However, there are cases where data need not be displayed in the process table. Let us take a simple usermod example to illustrate the point. Would one really want to display in the process table?

      Linux: /usr/sbin/usermod -p <value> account HP-UX: /usr/sam/lbin/usermod.sam -p <value> account

      The point is that there are cases where one is just better off not displaying every command argument in the process table regardless of device ownership.

        IIRC, you are still able to get that information by inspecting the information associated with the process table entry. This will only give a false sense of security.

        That being said, it is sometimes helpful to set what shows in the process table (with default ps options) to something that actually means something to the viewer, such as what Sendmail does (sendmail: accepting connections on port....)

        --MidLifeXis

        Hm. You mean that information is visible to other users? Sounds like a security flaw in *nix.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Is there a way with IPC::Run to hide command options from process table?
by Anonymous Monk on Jul 23, 2013 at 13:23 UTC
    no, $0 has nothing to do with hiding command options, you can't hide those

      Not to derail the question at hand, but the following does hide the script options:

      #!/usr/bin/perl -lw $0 = q{test.pl}; qx(sleep $ARGV[0]); exit 0;

      Without $0 set:

      user 30221 27990 0 08:36 pts/51 00:00:00 /usr/bin/perl -lw ./test.p +l 10

      With $0 set:

      user 30385 27990 0 08:36 pts/51 00:00:00 test.pl

      The question remains as to how something similar can be accomplished via IPC::Run.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1045857]
Approved by NetWallah
Front-paged by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-19 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found