ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
From: Denis Klimov <klimov.d.e@gmail.com>
To: ALT Linux sysadmin discuss <sysadmins@lists.altlinux.org>
Subject: Re: [Sysadmins] auth-katrin.c - buffer owerflow
Date: Mon, 13 Apr 2009 21:40:08 +0600
Message-ID: <49E35CD8.70401@altlinux.org> (raw)
In-Reply-To: <49E35120.2040901@nevod.ru>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13.04.2009 20:50, Шигапов Ринат wrote:
> Заметил 2 assert'a в auth-katrin.c для предотвращения переполнения
> буфера. Не лучше ли делать strncpy вместо комбинации assert+strcpy?
> 
Да, можно заменить, но надо учитывать не приведет ли такое копирование в
дальнейшем к трудноотлаживаемому падению демона. Если нет, например
копируется пароль, то просто не пройдет авторизация, но в случае если
копируется не вся строка, то нужно в лог писать варнинг о том что было
скопировано не все. Если неполное копирование критично для работы
демона, то лучше оставить assert.

 Я думаю это будет налучший алгоритм.

- -- 
Климов Денис Евгеньевич
Технический директор
ООО "Свободные решения"
kde@spo.tyumen.ru
http://spo.tyumen.ru
jabber: zver@altlinux.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknjXNcACgkQ/2RPAjBLeBrOCACfQtNlbUiSbts77SGxxw6Gh8Uy
eMsAn3lcKMx4XWdJ9fev5tJgsqmilYL8
=jb1h
-----END PGP SIGNATURE-----


      reply	other threads:[~2009-04-13 15:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-13 14:50 Шигапов Ринат
2009-04-13 15:40 ` Denis Klimov [this message]

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=49E35CD8.70401@altlinux.org \
    --to=klimov.d.e@gmail.com \
    --cc=sysadmins@lists.altlinux.org \
    --cc=zver@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 sysadmins discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/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 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
		sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
	public-inbox-index sysadmins

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


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