Bug 3996 - glob doesn't treat escaped stars correctly
Summary: glob doesn't treat escaped stars correctly
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-07 15:46 UTC by Pierre Habouzit
Modified: 2015-01-29 13:39 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Habouzit 2007-02-07 15:46:50 UTC
the test case is here:

==================================================
#!/bin/sh
set -e
mkdir /tmp/tst-$$
cd /tmp/tst-$$

mkdir '*'
touch '*/x'

cat > a.c <<'EOF'
#include <glob.h>
#include <stdio.h>

int main() {
    glob_t pglob;
    puts(glob("\\*/*", 0, 0, &pglob) ? "failure" : "works");
    return 0;
}
EOF

gcc -Wall -W -o a a.c && ./a

cd /tmp
rm -rf tst-$$
==================================================
Comment 1 Jakub Jelinek 2007-02-07 16:21:03 UTC
Testing a patch.
Comment 2 Jakub Jelinek 2007-02-15 12:52:16 UTC
Should be fixed in CVS:
http://sources.redhat.com/ml/glibc-cvs/2007-q1/msg00238.html