From: Alexey Gladkov <legion@altlinux.ru> To: sisyphus@lists.altlinux.org Subject: Re: [sisyphus] Вопрос по os-release Date: Thu, 28 Feb 2013 15:30:34 +0400 Message-ID: <512F3FDA.3010703@altlinux.ru> (raw) In-Reply-To: <512F3D38.8060702@etersoft.ru> 28.02.2013 15:19, Pavel Vainerman wrote: > 28.02.2013 15:15, Alexey Gladkov пишет: >> 28.02.2013 14:29, Michael Shigorin wrote: >>> On Thu, Feb 28, 2013 at 02:25:12PM +0400, Alexey Gladkov wrote: >>>> Тот кто положил в этот файл такой мусор сломал всех кто хочет >>>> использовать этот файл. >>> >>> Видимо, всё-таки source-ить придётся с обработкой ошибок. >> >> Видимо, заполнять его нужно с обработкой ошибок. Вот выдержка: The basic file format of os-release is a newline-separated list of environment-like shell-compatible variable assignments. It is possible to source the configuration from shell scripts. > Вроде общее правило в "безопасном программировании" - "не доверяй > ВХОДНЫМ данным" У паранои должны быть пределы иначе можно перестать доверять выводу системных утилит и содержимому конфигов. В данном случае речь идёт о конфигурационном файле. Если конфигурационный файл некорректный, то его нельзя прочитать и выполнение программы может быть прекращено (зависит от важности конфигурации). В данном случае произошло прекращение выполнения. Я могу добавить красочное сообщение о том, что конфигурация битая, но сути это не изменит и то что не работает работать не начнёт. > Логичнее всё-таки сделать обработку ошибок в том месте, где он > используется/парситься, т.к. в общем случая я так понимаю этот файл, > может создавать "кто угодно" и править его в ручную в том числе.. Логичнее не писать фигню в конфиги. Даже если программы их использующие продолжат работу, они будут действовать возможно не так как ожидаете (выбор за ними). -- Rgrds, legion
next prev parent reply other threads:[~2013-02-28 11:30 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-02-28 5:30 Sergei Epiphanov 2013-02-28 7:11 ` Alexey Gladkov 2013-02-28 8:12 ` Vladimir Lettiev 2013-02-28 10:26 ` Андрей Черепанов 2013-02-28 10:06 ` Sergei Epiphanov 2013-02-28 10:25 ` Alexey Gladkov 2013-02-28 10:29 ` Michael Shigorin 2013-02-28 11:15 ` Alexey Gladkov 2013-02-28 11:19 ` Pavel Vainerman 2013-02-28 11:30 ` Alexey Gladkov [this message] 2013-02-28 11:35 ` Pavel Vainerman 2013-02-28 11:59 ` Alexey Gladkov 2013-02-28 12:03 ` Pavel Vainerman 2013-02-28 12:26 ` Alexey Gladkov 2013-02-28 12:57 ` Pavel Vainerman 2013-03-01 16:50 ` Dmitry V. Levin 2013-02-28 12:16 ` Michael Shigorin 2013-02-28 11:52 ` Aleksey Novodvorsky 2013-02-28 13:35 ` Sergei Epiphanov 2013-02-28 13:34 ` Sergei Epiphanov
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=512F3FDA.3010703@altlinux.ru \ --to=legion@altlinux.ru \ --cc=sisyphus@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 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