Whamcloud - gitweb
debugfs.c (do_write): Mask off the file type bits, and OR in the
authorTheodore Ts'o <tytso@mit.edu>
Sun, 7 Dec 2003 21:31:45 +0000 (16:31 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 7 Dec 2003 21:31:45 +0000 (16:31 -0500)
regular file information.  (Addresses Debian Bug: #217456)

debugfs/ChangeLog
debugfs/debugfs.c

index 319da69..0e3a5ef 100644 (file)
@@ -1,5 +1,8 @@
 2003-12-07  Theodore Ts'o  <tytso@mit.edu>
 
+       * debugfs.c (do_write): Mask off the file type bits, and OR in the
+               regular file information.  (Addresses Debian Bug: #217456)
+
        * util.c (open_pager): Search for the pager to use, starting with
                'pager', and then falling back to 'less' and then 'more'.
                (Addresses Debian Bug: #221977)
index 2c13e4f..2173c13 100644 (file)
@@ -1117,7 +1117,7 @@ void do_write(int argc, char *argv[])
                com_err(argv[0], 0, "Warning: inode already set");
        ext2fs_inode_alloc_stats2(current_fs, newfile, +1, 0);
        memset(&inode, 0, sizeof(inode));
-       inode.i_mode = statbuf.st_mode;
+       inode.i_mode = (statbuf.st_mode & ~LINUX_S_IFMT) | LINUX_S_IFREG;
        inode.i_atime = inode.i_ctime = inode.i_mtime = time(NULL);
        inode.i_links_count = 1;
        inode.i_size = statbuf.st_size;