Bug 25197 - Поломан /usr/bin/[
Summary: Поломан /usr/bin/[
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: coreutils (show other bugs)
Version: unstable
Hardware: all Linux
: P3 major
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-06 01:25 MSK by Kirill A. Shutemov
Modified: 2011-03-07 05:13 MSK (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kirill A. Shutemov 2011-03-06 01:25:42 MSK
$  cat test.c
#include <unistd.h>

int main(int argc, char **argv)
{
        char *newargv[] = { "[", "1", "=", "1", "]", NULL};
        char *newenviron[] = { NULL };

        return execve("/usr/bin/[", newargv, newenviron);
}
$ gcc -Wall test.c -o test
$ ./test
[: extra argument `]'

В Федоре не воспроизводится.
Comment 1 Kirill A. Shutemov 2011-03-06 01:44:53 MSK
В Федоре /usr/bin/[ не симлин, в отличии от Альта:

$ ls -l /usr/bin/[ /usr/bin/test
-rwxr-xr-x 1 root root 33632 Feb 17 18:22 /usr/bin/[
-rwxr-xr-x 1 root root 30616 Feb 17 18:22 /usr/bin/test
Comment 2 Kirill A. Shutemov 2011-03-06 01:45:10 MSK
В Федоре /usr/bin/[ не симлинк, в отличии от Альта:

$ ls -l /usr/bin/[ /usr/bin/test
-rwxr-xr-x 1 root root 33632 Feb 17 18:22 /usr/bin/[
-rwxr-xr-x 1 root root 30616 Feb 17 18:22 /usr/bin/test
Comment 3 Dmitry V. Levin 2011-03-06 01:47:24 MSK
Ясно как белый день.  Мы, видимо, экономили место на диске.
Comment 4 Dmitry V. Levin 2011-03-06 02:32:10 MSK
http://git.altlinux.org/repo/39879/
Comment 5 Kirill A. Shutemov 2011-03-06 02:52:49 MSK
Да, помогло.
Comment 6 Sergey Vlasov 2011-03-06 10:51:21 MSK
На самом деле эта ошибка висела уже очень давно:

https://bugzilla.altlinux.org/show_bug.cgi?id=10170

(просто там testcase делался под zsh, где command блокирует использование и встроенных команд).
Comment 7 Repository Robot 2011-03-07 05:13:27 MSK
coreutils-8.10-alt2 -> sisyphus:

* Sun Mar 06 2011 Dmitry V. Levin <ldv@altlinux> 8.10-alt2
- Resurrected /usr/bin/dir, /usr/bin/vdir, and /usr/bin/[
  executables instead of symlinks (closes: #25197).