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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 30 Apr 2014 10:06:57 -0400
From:	Theodore Ts'o <tytso@....edu>
To:	Lukáš Czerner <lczerner@...hat.com>
Cc:	Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 4/7] mke2fs: create a regular file if necessary

On Wed, Apr 30, 2014 at 02:21:46PM +0200, Lukáš Czerner wrote:
> > +	fd = open(device, fl, 0666);
> > +	if (fd < 0) {
> > +		fprintf(stderr, _("Could not open %s: %s\n"),
> >  			device, error_message(errno));
> >  		if (errno == ENOENT)
> >  			fputs(_("\nThe device apparently does not exist; "
> >  				"did you specify it correctly?\n"), stderr);
> >  		exit(1);
> >  	}
> > +
> > +	if (ext2fs_fstat(fd, &s) < 0) {
> > +		perror("stat");
> 
> Maybe we can leave the old error printing code for consistency ?
> 
> 	fprintf(stderr, _("Could not stat %s --- %s\n"),
> 		device, error_message(errno));
> 
> Otherwise it looks good.

Well, it's very rare that ext2fs_fstat() would fail in
practice.  Previously the most common situation where ext2fs_stat()
would fail would be due to the file not existing or if there was a
permission denied error.

So I had modified the "Could not stat..." message to "Could not open",
since it would now be the open that failed, and if the file doesn't
exist, we're going to try to create the file first.

Hmm, it occurs to me if the user typo's the file name in and the user
specifies the size explicitly (i.e., "mke2fs /dev/scd3 2T) , it could
result in the the root file system filling up.  I'm not sure that's
big of a deal, since the user can always control-C the mke2fs and then
delete the typo'ed file name.  Do we think this is a real problem?
I'm not too worried...

    	    				- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ