From owner-freebsd-questions Sun Jul 14 12:32:40 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 136E637B400 for ; Sun, 14 Jul 2002 12:32:37 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 855C343E67 for ; Sun, 14 Jul 2002 12:32:36 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.5/8.12.5) id g6EJWZCK009678; Sun, 14 Jul 2002 14:32:35 -0500 (CDT) (envelope-from dan) Date: Sun, 14 Jul 2002 14:32:35 -0500 From: Dan Nelson To: uwi mAn Cc: questions@FreeBSD.ORG Subject: Re: weird things happening here Message-ID: <20020714193235.GE63064@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Jul 14), uwi mAn said: > uwiman* pwd && id > /usr/stuff/3/packages/All > uid=0(root) gid=0(wheel) groups=0(wheel), 2(kmem), 3(sys), 4(tty), > 5(operator), 20(staff), 31(guest) > uwiman* cp drm-kmod-0.9.5_1.tgz test | exec mkdir test > mkdir: test: File exists > uwiman# id > uid=777(uwiman) gid=0(wheel) groups=0(wheel) > uwiman# > > > uwiman* cp drm-kmod-0.9.5_1.tgz | exec mkdir test > usage: cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target > cp [-R [-H | -L | -P]] [-f | -i] [-pv] src1 ... srcN directory > uwiman# id > uid=777(uwiman) gid=0(wheel) groups=0(wheel) > uwiman# > > As you might have already noticed, me [root] suddenly becomes a regular > mortal [user]. Why? Because you probably became root by running "su", right? The "exec mkdir test" command tells the shell to exec() mkdir, which means that the shell process disappears and is replaced by mkdir. When mkdir exits, control returns to the parent process (i.e. the shell you ran su from). Try logging in as root from a console screen and try the same commands. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message