ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Mikhail Efremov <sem@altlinux.ru>
To: devel@lists.altlinux.org
Subject: Re: [devel] I: xorg-server, dbus: SELinux support breaks software
Date: Mon, 30 Aug 2010 15:16:02 +0400
Message-ID: <20100830151602.4bf2c7f5@sem.localdomain> (raw)
In-Reply-To: <4C7B883C.9030305@altlinux.ru>

On Mon, 30 Aug 2010 14:30:20 +0400 Alexey Gladkov wrote:
> > В коде is_selinux_enabled() нет проверки на невозможность прочитать.
> 
>   38         /* Drop back to detecting it the long way. */
>   39         fp = fopen("/proc/filesystems", "r");
>   40         if (!fp)
>   41                 return -1;
> 
> Здесь мы возвращаем -1. Зачем тут -1, почему не goto out; ?

Потому что на самом деле неизвестно, включен ли SELinux. И решать что
делать должен вызывающий код, эта функция не должна принимать таких
решений.

>   44         while ((num = getline(&buf, &len, fp)) != -1) {
>   45                 if (strstr(buf, "selinuxfs")) {
>   46                         enabled = 1;
>   47                         break;
>   48                 }
>   49         }
>   50
>   51         if (num < 0)
>   52                 goto out;
> 
> Дим, проверка есть и в этом случае вернётся 0.

Возможно тут тоже должно быть return -1.

> > Тем не менее, эта функция определена таким образом, что может давать
> > три вида ответа: "да", "нет" и "нет способа определить".
 
Да, и теперь это даже документировано. Раньше не было, коммит от 18
марта.

-- 
WBR, Mikhail Efremov


  reply	other threads:[~2010-08-30 11:16 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-29 22:11 ` [devel] Q: Xvfb: " Dmitry V. Levin
2010-08-30  6:28   ` Valery V. Ionozemtsev
2010-08-30  6:31     ` Valery V. Ionozemtsev
2010-08-30  8:02       ` Michael Shigorin
2010-08-30  9:52         ` Dmitry V. Levin
2010-08-30  8:07       ` Dmitry V. Levin
2010-08-30  8:16         ` Valery V. Ionozemtsev
2010-08-30  8:18         ` Dmitry V. Levin
2010-08-30  8:27           ` Valery V. Ionozemtsev
2010-08-30  9:51             ` [devel] I: xorg-server, dbus: " Dmitry V. Levin
2010-08-30 10:08               ` Valery V. Ionozemtsev
2010-08-30 10:13                 ` Dmitry V. Levin
2010-08-30 10:29                 ` Michael Shigorin
2010-08-30 10:09               ` Alexey Gladkov
2010-08-30 10:21                 ` Dmitry V. Levin
2010-08-30 10:30                   ` Alexey Gladkov
2010-08-30 11:16                     ` Mikhail Efremov [this message]
2010-08-30 11:30                       ` Alexey Gladkov
2010-08-30 13:16                         ` Dmitry V. Levin
2010-08-30 13:29                           ` Valery V. Ionozemtsev
2010-08-30 13:52                             ` Dmitry V. Levin
2010-08-30 14:05                               ` Valery V. Ionozemtsev
2010-08-30 15:32                                 ` Dmitry V. Levin
2010-08-31 12:17                                 ` Michael Shigorin
2010-08-31 12:25                                   ` Kirill A. Shutemov
2010-08-31 12:41                                     ` Igor Zubkov
2010-08-31 13:02                                   ` Dmitry V. Levin
2010-08-31 13:26                                     ` Alexey Gladkov
2010-08-31 13:41                                       ` Anton Farygin
2010-08-31 13:46                                       ` Valery V. Inozemtsev
2010-08-31 14:03                                         ` Dmitry V. Levin
2010-08-31 14:14                                           ` Michael Shigorin
2010-08-31 15:05                                             ` Dmitry V. Levin
2010-08-31 15:09                                             ` Dmitry V. Levin
2010-08-31 14:56                                           ` Anton Farygin
2010-08-31 15:03                                             ` Dmitry V. Levin
2010-08-31 17:06                                               ` Anton Farygin
2010-09-01  0:55                                             ` Денис Смирнов
2010-09-01  4:54                                               ` Anton Farygin
2010-09-01  5:05                                                 ` Денис Смирнов
2010-09-01 11:38                                                   ` Dmitry V. Levin
2010-08-30 13:41                           ` Alexey Gladkov
2010-08-30 13:09                     ` Dmitry V. Levin
2010-08-30 11:44                   ` Valery V. Ionozemtsev
2010-08-30 13:46                     ` Dmitry V. Levin
2010-08-30 13:57                       ` Valery V. Ionozemtsev
2010-08-30  8:27           ` [devel] Q: Xvfb: " Alexey Gladkov
2010-08-30 11:32             ` Mikhail Efremov
2010-08-30 11:39               ` Alexey Gladkov
2010-08-29 22:21 ` [devel] I: dbus: " Dmitry V. Levin
2010-08-30  6:25   ` Valery V. Ionozemtsev
2010-08-30  8:10     ` Mikhail Efremov
2010-08-30  8:14     ` Dmitry V. Levin
2010-08-30 14:21       ` Valery V. Ionozemtsev

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=20100830151602.4bf2c7f5@sem.localdomain \
    --to=sem@altlinux.ru \
    --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