This makes umask, dmask and fmask options work out-of-the-box.
Signed-off-by: Helg Bredow <xx404@msn.com>
#endif
const char* default_options = "ro_fallback,allow_other,blkdev,big_writes,"
#endif
const char* default_options = "ro_fallback,allow_other,blkdev,big_writes,"
static void parse_options(struct exfat* ef, const char* options)
{
static void parse_options(struct exfat* ef, const char* options)
{
- int sys_umask = umask(0);
- umask(sys_umask); /* restore umask */
- opt_umask = get_int_option(options, "umask", 8, sys_umask);
- ef->dmask = get_int_option(options, "dmask", 8, opt_umask) & 0777;
- ef->fmask = get_int_option(options, "fmask", 8, opt_umask) & 0777;
+ opt_umask = get_int_option(options, "umask", 8, 0);
+ ef->dmask = get_int_option(options, "dmask", 8, opt_umask);
+ ef->fmask = get_int_option(options, "fmask", 8, opt_umask);
ef->uid = get_int_option(options, "uid", 10, geteuid());
ef->gid = get_int_option(options, "gid", 10, getegid());
ef->uid = get_int_option(options, "uid", 10, geteuid());
ef->gid = get_int_option(options, "gid", 10, getegid());