debugfs.c (do_write): Check to see if the filename exists before

creating it, and give an error if so.  Addresses
	Sourceforge bug #478195.
bitmap-optimize
Theodore Ts'o 2002-10-31 11:53:49 -05:00
parent 9ed06a1eb9
commit 1dd090faa0
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2002-10-31 Theodore Ts'o <tytso@mit.edu>
* debugfs.c (do_write): Check to see if the filename exists before
creating it, and give an error if so. Addresses
Sourceforge bug #478195.
2002-10-30 Theodore Ts'o <tytso@mit.edu>
* Makefile.in (install): Search all compression extensions when

View File

@ -1097,6 +1097,13 @@ void do_write(int argc, char *argv[])
return;
}
retval = ext2fs_namei(current_fs, root, cwd, argv[2], &newfile);
if (retval == 0) {
com_err(argv[0], 0, "The file '%s' already exists\n", argv[2]);
close(fd);
return;
}
retval = ext2fs_new_inode(current_fs, cwd, 010755, 0, &newfile);
if (retval) {
com_err(argv[0], retval, "");