add EEZE_DISK_MOUNTOPT_NODEV

yes, I realize we're in a freeze, but this is trivial and important


SVN revision: 74564
This commit is contained in:
Mike Blumenkrantz 2012-07-30 09:49:05 +00:00
parent d995e25c80
commit ba567e440e
5 changed files with 10 additions and 1 deletions

View File

@ -110,3 +110,7 @@
* Add yet another libmount backend for eeze_disk to handle current
setups which do not have mtab and instead use /proc/self/mountinfo
2012-07-30 Mike Blumenkrantz
* Add EEZE_DISK_MOUNTOPT_NODEV option for disabling device nodes on mount

View File

@ -63,7 +63,8 @@ typedef enum
EEZE_DISK_MOUNTOPT_NOEXEC = (1 << 3),
EEZE_DISK_MOUNTOPT_NOSUID = (1 << 4),
EEZE_DISK_MOUNTOPT_REMOUNT = (1 << 5),
EEZE_DISK_MOUNTOPT_UID = (1 << 6) /**< use current user's uid */
EEZE_DISK_MOUNTOPT_UID = (1 << 6), /**< use current user's uid */
EEZE_DISK_MOUNTOPT_NODEV = (1 << 7) /**< @since 1.7 */
} Eeze_Mount_Opts;

View File

@ -29,6 +29,7 @@ static struct libmnt_optmap eeze_optmap[] =
{ "nosuid", EEZE_DISK_MOUNTOPT_NOSUID, 0 },
{ "remount", EEZE_DISK_MOUNTOPT_REMOUNT, 0 },
{ "uid[=]", EEZE_DISK_MOUNTOPT_UID, 0 },
{ "nodev", EEZE_DISK_MOUNTOPT_NODEV, 0 },
{ NULL, 0, 0 }
};
typedef struct libmnt_table libmnt_table;

View File

@ -32,6 +32,7 @@ static struct libmnt_optmap eeze_optmap[] =
{ "nosuid", EEZE_DISK_MOUNTOPT_NOSUID, 0 },
{ "remount", EEZE_DISK_MOUNTOPT_REMOUNT, 0 },
{ "uid[=]", EEZE_DISK_MOUNTOPT_UID, 0 },
{ "nodev", EEZE_DISK_MOUNTOPT_NODEV, 0 },
{ NULL, 0, 0 }
};
typedef struct libmnt_table libmnt_table;

View File

@ -348,6 +348,8 @@ eeze_disk_mount(Eeze_Disk *disk)
}
if (disk->mount_opts & EEZE_DISK_MOUNTOPT_NOEXEC)
eina_strbuf_append(disk->mount_cmd, "noexec,");
if (disk->mount_opts & EEZE_DISK_MOUNTOPT_NODEV)
eina_strbuf_append(disk->mount_cmd, "nodev,");
if (disk->mount_opts & EEZE_DISK_MOUNTOPT_NOSUID)
eina_strbuf_append(disk->mount_cmd, "nosuid,");
if (disk->mount_opts & EEZE_DISK_MOUNTOPT_REMOUNT)