Re: почему глючит ls

2016-01-24 Пенетрантность yuri . nefedov

On Sun, 24 Jan 2016, Alex Kicelew wrote:


On 01/24/16 00:55, dimas wrote:

да уж, прикол... а кто-нибудь может объяснить, почему в случае с touch "-l"
аргумент в кавычках все равно парсится как ключ?


Кавычки видит шелл. если сказать touch "-1 -2", шелл передаст тачу один
параметр с пробелом посередине. А тач уже увидит один параметр безо
всяких кавычек, начинающийся с дефиса, и начнет его по этой причине
парсить как флаг.



 Могу еще добавить для тех кто С немножко знает.
 Посмотрите
 > man 3 getopt

 В секции EXAMPLE есть работающие программы с примером
 разбора аргументов.
 На практике, обычно эти функции и используют для анализа
 опций командной строки.
 Можно скомпилировать, поиграться и разобраться,
 что делает шелл и что видит программа на входе.

Ю.


[DONE] wml://security/2009/dsa-1{856,943,884,955,916,923,825,772,738,947,734,876,948,719,841}.wml

2016-01-24 Пенетрантность Lev Lamberov
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

- --- english/security/2009/dsa-1719.wml2014-04-30 13:16:18.0 
+0600
+++ russian/security/2009/dsa-1719.wml  2016-01-24 13:16:46.360007984 +0500
@@ -1,24 +1,25 @@
- -design flaw
+#use wml::debian::translation-check translation="1.3" maintainer="Lev Lamberov"
+ошибка разработки
 
- -Martin von Gagern discovered that GNUTLS, an implementation of the
- -TLS/SSL protocol, handles verification of X.509 certificate chains
- -incorrectly if a self-signed certificate is configured as a trusted
- -certificate.  This could cause clients to accept forged server
- -certificates as genuine.  (https://security-tracker.debian.org/tracker/CVE-2008-4989;>CVE-2008-4989)
+Мартин фон Гагерн обнаружил, что GNUTLS, 
реализация протокола
+TLS/SSL, некорректно выполняет проверку 
цепочек сертификатов
+X.509 в случае, если самозаверенный 
сертификат указан как доверенный
+сертификат.  Это может приводить к тому, 
что клиенты будут принимать поддельные 
серверные
+сертификаты за настоящие.  (https://security-tracker.debian.org/tracker/CVE-2008-4989;>CVE-2008-4989)
 
- -In addition, this update tightens the checks for X.509v1 certificates
- -which causes GNUTLS to reject certain certificate chains it accepted
- -before.  (In certificate chain processing, GNUTLS does not recognize
- -X.509v1 certificates as valid unless explicitly requested by the
- -application.)
+Кроме того, данное обновление улучшает 
проверки сертификатов X.509v1,
+что приводит к тому, что GNUTLS отклоняет 
определённые цепочки сертификатов, 
принимаемых
+ранее.  (В коде обработки цепочек 
сертификатов GNUTLS не распознаёт сертификаты
+X.509v1 как правильные сертификаты до тех пор, 
пока об этом не поступит явный запрос от
+приложения.)
 
- -For the stable distribution (etch), this problem has been fixed in
- -version 1.4.4-3+etch3.
+В стабильном выпуске (etch) эта проблема 
была исправлена в
+версии 1.4.4-3+etch3.
 
- -For the unstable distribution (sid), this problem has been fixed in
- -version 2.4.2-3 of the gnutls26 package.
+В нестабильном выпуске (sid) эта проблема 
была исправлена в
+версии 2.4.2-3 пакета gnutls26.
 
- -We recommend that you upgrade your gnutls13 packages.
+Рекомендуется обновить пакеты gnutls13.
 
 
 # do not modify the following line
- --- english/security/2009/dsa-1734.wml2009-03-06 20:04:30.0 
+0500
+++ russian/security/2009/dsa-1734.wml  2016-01-24 12:49:36.911508456 +0500
@@ -1,25 +1,26 @@
- -programming error
+#use wml::debian::translation-check translation="1.1" maintainer="Lev Lamberov"
+ошибка 
программирования
 
- -b.badrignans discovered that OpenSC, a set of smart card utilities,
- -could stores private data on a smart card without proper access
- -restrictions.
- -
- -Only blank cards initialised with OpenSC are affected by this problem.
- -This update only improves creating new private data objects, but cards
- -already initialised with such private data objects need to be
- -modified to repair the access control conditions on such cards.
- -Instructions for a variety of situations can be found at the OpenSC
- -web site: http://www.opensc-project.org/security.html
- -
- -The oldstable distribution (etch) is not affected by this problem.
+b.badrignans обнаружил, что OpenSC, набор утилит 
для работы со смарт-картами,
+может хранить личные данные на смарт-карте 
без должного ограничения прав
+доступа.
+
+Этой проблеме подвержен только пустые 
карты, инициализированные с помощью OpenSC.
+Данное обновление лишь улучшает создание 
новых объектов с личными данными, карты,
+которые уже были инициализированы, должны 
быть
+изменены с целью исправления условий 
управления доступом.
+Инструкции к действию в различных 
ситуациях можно найти на веб-сайте
+OpenSC: http://www.opensc-project.org/security.html
+
+Предыдущий стабильный выпуск (etch) не 
подвержен 

Re: почему глючит ls

2016-01-24 Пенетрантность Alex Kuklin


On 21.01.2016 23:15, Melleus wrote:

Не могу понять, что происходит.

1. Так - работает:

me@machine:~/Загрузки/ > ls 0*.pdf
0470568135.pdf 0521191130 2.pdf 055-059.pdf 05.pdf 065-067.pdf

2. А так - не работает:

me@machine:~/Загрузки/ > ls *.pdf
ls: неверный ключ — «��
По команде «ls --help» можно получить дополнительную информацию.

Что я делаю не так? Спасибо заранее.


потому что есть файл, имя которого начинается с -.
писать ls -- *.pdf, -- прекращает обработку ключей.




Re: почему глючит ls

2016-01-24 Пенетрантность Oleksandr Gavenko
On 2016-01-23, dimas wrote:

> да уж, прикол... а кто-нибудь может объяснить, почему в случае с touch "-l"
> аргумент в кавычках все равно парсится как ключ?

Откройте POSIX:

  http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
 2. Shell Command Language

  The shell operates according to the following general overview of
  operations. The specific details are included in the cited sections of this
  chapter.

  The shell reads its input from a file (see sh), from the -c option or
  from the system() and popen() functions defined in the System Interfaces
  volume of IEEE Std 1003.1-2001. If the first line of a file of shell
  commands starts with the characters "#!", the results are unspecified.

  The shell breaks the input into tokens: words and operators; see Token
  Recognition.

  The shell parses the input into simple commands (see Simple Commands)
  and compound commands (see Compound Commands).

  The shell performs various expansions (separately) on different parts of
  each command, resulting in a list of pathnames and fields to be treated
  as a command and arguments; see Word Expansions.

  The shell performs redirection (see Redirection) and removes redirection
  operators and their operands from the parameter list.

  The shell executes a function (see Function Definition Command),
  built-in (see Special Built-In Utilities), executable file, or script,
  giving the names of the arguments as positional parameters numbered 1 to
  n, and the name of the command (or in the case of a function within a
  script, the name of the script) as the positional parameter numbered 0
  (see Command Search and Execution).

  The shell optionally waits for the command to complete and collects the
  exit status (see Exit Status for Commands).

Т.е. при разборе строки происходит несколько шагов. С ``touch "-l"`` мы на шаге:


  The shell breaks the input into tokens: words and operators; see Token
  Recognition.

Смотрим по ссылке:

  2.3 Token Recognition

If the current character is backslash, single-quote, or double-quote (
'\', '", or ' )' and it is not quoted, it shall affect quoting for
subsequent characters up to the end of the quoted text. The rules for
quoting are as described in Quoting. During token recognition no
substitutions shall be actually performed, and the result token shall
contain exactly the characters that appear in the input (except for
 joining), unmodified, including any embedded or enclosing quotes
or substitution operators, between the quote mark and the end of the
quoted text. The token shall not be delimited by the end of the quoted
field.

If the current character is an unquoted , any token containing the
previous character is delimited and the current character shall be
discarded.

If the previous character was part of a word, the current character shall
be appended to that word.

Вот и обьяснение. Кавычки попадают в shell, обрабатываются и не доходят до
команды. Т.е. кавычки - это особенность shell, команда вообще ни при чем.


В разных контекстах выполняются разные шаги. Стоит раз разобраться.

Например ``Parameter Expansion`` не делается в одинарных кавычках.

Для проверки на пустоту важно взять параметер в двойные кавычки. built-in Bash
test как то отрабатывает:

  $ [ -z -a -z ]
  $ x=
  $ [ -z $x -a -z $x ]


В GNU coreutils это не срабатывает:

  bash# /usr/bin/\[ -z -a -z ]
  /usr/bin/[: extra argument ‘-z’

  bash# /usr/bin/\[ -z $x -a -z $x ]
  /usr/bin/[: extra argument ‘-z’

В FreeBSD sh также не позволяет:

  $ [ -z -a -z ]
  [: -a: unexpected operator
  $ [ -z $x -a -z $x ]
  [: -a: unexpected operator

Расширение Bash работает двояко:

  $ [[ -z ]]
  bash: unexpected argument `]]' to conditional unary operator
  bash: syntax error near `]]'

тогда как это сработает:

  bash# [[ -z $x ]]

Признаюсь что у меня нет 100% гарантии с обьяснения мануала почему оно
работает. Прямо так не сказано. bash(1):

  [[ expression ]]

 Return a status of 0 or 1 depending on the evaluation of the
 conditional expression expression. Expressions are composed of the
 primaries described below under CONDITIONAL EXPRESSIONS. Word
 splitting and pathname expansion are not performed on the words
 between the [[ and ]]; tilde expansion, parameter and variable
 expansion, arithmetic expansion, command substitution, process
 substitution, and quote removal are performed. Conditional operators
 such as -f must be unquoted to be recog‐ nized as primaries.

   See the description of the test builtin command (section SHELL BUILTIN
   COMMANDS below) for the handling of parameters (i.e. missing
   parameters).

Т.е. сделается пустая подстановка вместо $x, но место быдет считаться занятым
потому что не происходит Word splitting?

Переносимый 

Tidy validation failed

2016-01-24 Пенетрантность Debian Webmaster
*** /srv/www.debian.org/www/blends/index.ru.html
line 112 column 5 - Warning:  attribute "href" lacks value
line 119 column 5 - Warning:  attribute "href" lacks value
line 126 column 5 - Warning:  attribute "href" lacks value
line 133 column 5 - Warning:  attribute "href" lacks value

--
 You received this mail for the language code ru.
 Please edit webwml/english/devel/website/validation.data if this is not 
accurate.
 Please also update webwml/english/devel/website/ with the new coordinator(s) 
data.