ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Vladimir Lettiev" <thecrux@gmail.com>
To: "ALT Linux Team development discussions" <devel@lists.altlinux.org>
Subject: [devel] Q: рабочий ли PolicyKit?
Date: Mon, 22 Sep 2008 17:49:59 +0400
Message-ID: <3b8491740809220649j6be406fdgf1b0f7feb183c113@mail.gmail.com> (raw)

Для примера возьмём polkit-gnome-authorization из пакета PolicyKit-gnome.
При выполнении каких-либо задач, требующих определённых привилегий у
пользователя должна запрашиваться авторизация, для этого через dbus
вызывается приложение /usr/libexec/PolicyKit/polkit-gnome-manager,
которое затем вызывает (execve) sgid'ный хелпер
/usr/libexec/PolicyKit/polkit-grant-helper.

Первая проблема в том, что выполнить это хелпер может только root или
пользователь входящий в группу _polkit. Исправить это вобщем-то легко.
Вторая проблема, что несмотря на то, что файл вроде бы sgid и
эффективная группа при запуске становится _polkit, но тем не менее
хелпер вываливается с ошибкой: "polkit-grant-helper: needs to be
setgid _polkit" (дамп strace)
Код выглядит так:

        /* check that we are setgid polkituser */
        egid = getegid ();
        group = getgrgid (egid);
        if (group == NULL) {
                fprintf (stderr, "polkit-grant-helper: cannot lookup
group info for gid %d\n", egid);
                goto out;
        }
        if (strcmp (group->gr_name, POLKIT_GROUP) != 0) {
                fprintf (stderr, "polkit-grant-helper: needs to be
setgid " POLKIT_GROUP "\n");
                goto out;
        }

теоретически должно работать...

-- 
Vladimir Lettiev aka crux <theCrux@gmail.com>

             reply	other threads:[~2008-09-22 13:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22 13:49 Vladimir Lettiev [this message]
2008-09-23  7:57 ` Ildar Mulyukov
2008-09-23  9:04   ` Vladimir Lettiev
2008-09-23  9:50     ` Ildar Mulyukov

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=3b8491740809220649j6be406fdgf1b0f7feb183c113@mail.gmail.com \
    --to=thecrux@gmail.com \
    --cc=devel@lists.altlinux.org \
    /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 Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/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 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

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


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