Re: #! and argv[0]: the path is removed before invoking the interpreter

From: H. Peter Anvin (hpa@transmeta.com)
Date: Wed Feb 16 2000 - 23:17:51 EST


Followup to: <20000216190003.A30262@animx.eu.org>
By author: Wakko Warner <wakko@animx.eu.org>
In newsgroup: linux.dev.kernel
>
> Question: I wrote a few programs that would check it's own executable to
> determin if it was set[ug]id. If it was, it would assume something bad is
> happening and not run. Is there a way to get that information (I don't want
> to test euid and uid, they could be different but the program not suid)
> without using /proc? I foolishly tryied opening argv[0] and aborting if it
> wasn't openable.
>

No.

        -hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:17 EST