ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Igor Homyakov <homyakov@ramax.spb.ru>
To: ALT Linux Sisyphus <sisyphus@altlinux.ru>
Cc: ldv@altlinux.ru
Subject: [sisyphus] [procps] wrong process UID
Date: Tue, 19 Nov 2002 15:21:38 +0300
Message-ID: <20021119122138.GE27615@kadath.pm.ramax.spb.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

Утилита ps не правильно отображает UID процесса, точнее она показвает его 
EUID вместо UID. Приложен простенький тест, процесс запускаеться 
и меняет свой эфеективный ID после чего выводит значения UID и EUID.
Как видно ps показывает одинаковые значения.


$ sudo ./a.out 
running: pid 28854, uid 0, euid 113

$ ps -axo pid,uid,euid | grep 28854
28854   113   113


--
Igor Homyakov
<homyakov at altlinux dot ru>
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=190141

[-- Attachment #2: euid_test.c --]
[-- Type: text/plain, Size: 562 bytes --]

/*  -*- C -*-
 *
 *  $Id$
 *
 *  Author: Igor Homyakov <homyakov@ramax.spb.ru>
 *
 *  Created: Tue Nov 19 15:02:05 2002
 *
 *  Comments: stupid test
 *
 */

#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <errno.h>

int 
main (int argc, char* argv[])
{
   uid_t euid = 113;
   unsigned int timeout = 30;
   
   if ( seteuid( euid ) == -1 ) {
      perror("seteuid err:");
      exit(1);
   } else {
      (void)printf( "running: pid %d, uid %d, euid %d\n", getpid(), getuid(), geteuid());
      (void)sleep( timeout );
   }
   return 0;
}

                 reply	other threads:[~2002-11-19 12:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021119122138.GE27615@kadath.pm.ramax.spb.ru \
    --to=homyakov@ramax.spb.ru \
    --cc=ldv@altlinux.ru \
    --cc=sisyphus@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git