This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fopen a special characterfile on vfat.


Hi Paul,

On Tue, Apr 17, 2012 at 10:10 AM, Paul Pluzhnikov
<ppluzhnikov@google.com> wrote:
> On Tue, Apr 17, 2012 at 6:32 AM, devendra.aaru <devendra.aaru@gmail.com> wrote:
>
>> i am facing a strange situation where fopen fails on a vfat file
>> system , the same works for the ext2 file system.
>
> Run your program under 'strace' and see with what arguments gllibc
> passed to the open system call.
>
strace performed on the file, which gave me a nice crash. attached is
the trace. it fails with EINVAL.
i am running as root and i am able to access the vfat file system at
/mnt/usbdrive/.

even more digging, the file name "test" is opened and was able to
write. it seems that the vfat doesn't accept that special chars.

Thanks,
dev.
> --
> Paul Pluzhnikov
#include <stdio.h>

main()
{
	FILE *fp;
	char str[1000];
	
	strcpy(str, "/mnt/usbdrive/0x12_1_2001-02-01T00:01:02Z");
	fp = fopen(str, "w");
	if (fp < 0) {
		printf("failed \n");
		return -1;
	}
	fclose(fp);
}

Attachment: trace
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]