lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100309160547.60641bc5@schatten.dmk.lab>
Date:	Tue, 9 Mar 2010 16:05:47 +0100
From:	Florian Mickler <florian@...kler.org>
To:	linux-kernel@...r.kernel.org
Subject: Re: opendir() on a file???

On Tue, 09 Mar 2010 04:26:57 -0500
Jon Masters <jonathan@...masters.org> wrote:

> Folks,
> 
> Now I might be missing something, and I know I'm behind on LKML[0], but
> the following isn't supposed to work in my book:
> 
> /*
>  * Weird kernel test
>  */
> 
> #include <sys/types.h>
> #include <dirent.h>
> #include <stdio.h>
> 
> int main(int argc, char **argv)
> {
>         DIR *dir;
> 
>         dir = opendir("foo.conf");
> 
>         if (dir)
>                 printf("WTF?\n");
> 
>         return 0;
> }
> 
> This is on an ext4 filesystem, whereas on a box with an older kernel
> this test correctly does not print "WTF?". I know some filesystems
> experiment with streams and treating files as directories, etc. but I
> wasn't aware that anything particular had changed recently?
> 
> The box is running almost an upstream kernel, and I can poke if I'm told
> this not intended: 2.6.34-0.8.rc0.git11.fc14.x86_64.
> 
> What am I missing?
> 
> Jon.
> 
> [0] The podcast isn't dead, I'm just suffering from a cold and will be
> taking a day off to recover and catch up with that sometime today.
> 
> 

perhaps you are missing this patch: 
commit 781b16775ba0bb55fac0e1757bf0bd87c8879632
Author: Al Viro <viro@...IV.linux.org.uk>
Date:   Sat Mar 6 18:41:07 2010 +0000

    Fix a dumb typo - use of & instead of &&
    
    We managed to lose O_DIRECTORY testing due to a stupid typo in commit
    1f36f774b2 ("Switch !O_CREAT case to use of do_last()")
    
    Reported-by: Walter Sheets <w41ter@...il.com>
    Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
    Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>


but this is only a guess...

cheers,
Flo


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ