ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
* Re: [sisyphus] unreal ircd
@ 2005-05-27 14:19 Vitaly Smirnov
  2005-05-27 14:29 ` Dmitry Lebkov
  2005-05-27 14:49 ` Led
  0 siblings, 2 replies; 5+ messages in thread
From: Vitaly Smirnov @ 2005-05-27 14:19 UTC (permalink / raw)
  To: ALT Linux Sisyphus discussion list

Ну хотя вообще-то не всё так страшно там ;)
Есть кусок кода, за это отвечающий:

>#if defined(IRC_UID) && defined(IRC_GID)
>        if ((int)getuid() == 0) {
>                if ((IRC_UID == 0) || (IRC_GID == 0)) {
>                        (void)fprintf(stderr,
>                            "ERROR: SETUID and SETGID have not been set
properly"
>                            "\nPlease read your
documentation\n(HINT:SETUID or SETGID can not be 0)\n");
>                       exit(-1);
>                } else {
>                        /*
>                         * run as a specified user
>                         */
>
>                        (void)fprintf(stderr,
>                            "WARNING: ircd invoked as root\n");
>                        (void)fprintf(stderr, "         changing to uid
%d\n",
>                            IRC_UID);
>                        (void)fprintf(stderr, "         changing to gid
%d\n",
>                            IRC_GID);
>                        (void)setgid(IRC_GID); // Вот тут и надо
получить gid из "uircd"
>                        (void)setuid(IRC_UID); // тут uid ;)
>                }
>        }
>#endif

В качестве решения можно просто в хидерном файле вместо gid/uid
прописать "uircd" а в коде доставать gid/uid по имени.
Вот только вопрос, какой функцией достать gid/uid ?

-- 
С уважением, Виталий Смирнов.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-05-27 14:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-27 14:19 [sisyphus] unreal ircd Vitaly Smirnov
2005-05-27 14:29 ` Dmitry Lebkov
2005-05-27 14:45   ` Vitaly Smirnov
2005-05-27 14:52     ` Led
2005-05-27 14:49 ` Led

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