2001-12-24 Theodore Tso <tytso@valinux.com>
+ * ext2fs.h, openfs.c (ext2fs_open), initialize.c
+ (ext2fs_initialize), mkdir.c (ext2fs_mkdir): Add a new
+ field to struct_ext2_filsys, umask. This field is
+ initialize to 022, and affects ext2fs_mkdir in the obvious
+ way. (In the future umask should also affect new file
+ creation routines, but the fileio functions don't
+ currently support this yes.)
+
* ismounted.c (check_mntent_file): Stat all of the entries in
/etc/mtab and/or /proc/mounts in order to catch dim-witted
system administrators who might have created alias
__u32 stride; /* for mke2fs */
struct ext2_super_block * orig_super;
struct ext2_image_hdr * image_header;
+ __u32 umask;
/*
* Reserved for future expansion
*/
- __u32 reserved[9];
+ __u32 reserved[8];
/*
* Reserved for the use of the calling application.
memset(fs, 0, sizeof(struct struct_ext2_filsys));
fs->magic = EXT2_ET_MAGIC_EXT2FS_FILSYS;
fs->flags = flags | EXT2_FLAG_RW;
+ fs->umask = 022;
#ifdef WORDS_BIGENDIAN
fs->flags |= EXT2_FLAG_SWAP_BYTES;
#endif
* Create the inode structure....
*/
memset(&inode, 0, sizeof(struct ext2_inode));
- inode.i_mode = LINUX_S_IFDIR | 0755;
+ inode.i_mode = LINUX_S_IFDIR | (0777 & ~fs->umask);
inode.i_uid = inode.i_gid = 0;
inode.i_blocks = fs->blocksize / 512;
inode.i_block[0] = blk;
memset(fs, 0, sizeof(struct struct_ext2_filsys));
fs->magic = EXT2_ET_MAGIC_EXT2FS_FILSYS;
fs->flags = flags;
+ fs->umask = 022;
retval = manager->open(name, (flags & EXT2_FLAG_RW) ? IO_FLAG_RW : 0,
&fs->io);
if (retval)
+2001-12-24 Theodore Tso <tytso@valinux.com>
+
+ * mke2fs.c (create_lost_and_found): The lost+found directory is
+ now created with 0700 permissions, since files which get
+ dropped into that directory may have come from a protected
+ directory, and the system administrator may not deal with
+ immediately. (Addresses Debian bug #118443)
+
2001-12-23 Theodore Tso <tytso@valinux.com>
* Makefile.in, jfs_user.h: Move linux/jbd.h to
int i;
int lpf_size = 0;
+ fs->umask = 077;
retval = ext2fs_mkdir(fs, EXT2_ROOT_INO, 0, name);
if (retval) {
com_err("ext2fs_mkdir", retval,
_("while expanding /lost+found"));
exit(1);
}
- }
+ }
}
static void create_bad_block_inode(ext2_filsys fs, badblocks_list bb_list)