forked from enlightenment/efl
add a mountopt flag for automatically adding uid
SVN revision: 59427
This commit is contained in:
parent
ad7a0d33b0
commit
1856a909e3
|
@ -1,4 +1,7 @@
|
||||||
2011-05-15 Mike Blumenkrantz (discomfitor/zmike)
|
2011-05-15 Mike Blumenkrantz (discomfitor/zmike)
|
||||||
|
+EEZE_DISK_MOUNTOPT_UID
|
||||||
|
Add a uid=%i mount option using getuid, NOT geteuid
|
||||||
|
--------------------------------------
|
||||||
+eeze_disk_mount_wrapper_set
|
+eeze_disk_mount_wrapper_set
|
||||||
+eeze_disk_mount_wrapper_get
|
+eeze_disk_mount_wrapper_get
|
||||||
Allow use of wrapper exes for mount commands (such as sudo)
|
Allow use of wrapper exes for mount commands (such as sudo)
|
||||||
|
|
|
@ -48,7 +48,8 @@ typedef enum
|
||||||
EEZE_DISK_MOUNTOPT_UTF8 = (1 << 2),
|
EEZE_DISK_MOUNTOPT_UTF8 = (1 << 2),
|
||||||
EEZE_DISK_MOUNTOPT_NOEXEC = (1 << 3),
|
EEZE_DISK_MOUNTOPT_NOEXEC = (1 << 3),
|
||||||
EEZE_DISK_MOUNTOPT_NOSUID = (1 << 4),
|
EEZE_DISK_MOUNTOPT_NOSUID = (1 << 4),
|
||||||
EEZE_DISK_MOUNTOPT_REMOUNT = (1 << 5)
|
EEZE_DISK_MOUNTOPT_REMOUNT = (1 << 5),
|
||||||
|
EEZE_DISK_MOUNTOPT_UID = (1 << 6) /**< use current user's uid */
|
||||||
} Eeze_Mount_Opts;
|
} Eeze_Mount_Opts;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <Ecore.h>
|
#include <Ecore.h>
|
||||||
#include <Eeze.h>
|
#include <Eeze.h>
|
||||||
#include <Eeze_Disk.h>
|
#include <Eeze_Disk.h>
|
||||||
|
@ -154,6 +156,8 @@ eeze_disk_mountopts_set(Eeze_Disk *disk, unsigned long opts)
|
||||||
if (opts != disk->mount_opts)
|
if (opts != disk->mount_opts)
|
||||||
disk->mount_cmd_changed = EINA_TRUE;
|
disk->mount_cmd_changed = EINA_TRUE;
|
||||||
disk->mount_opts = opts;
|
disk->mount_opts = opts;
|
||||||
|
if (opts & EEZE_DISK_MOUNTOPT_UID)
|
||||||
|
disk->uid = getuid();
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,6 +269,8 @@ eeze_disk_mount(Eeze_Disk *disk)
|
||||||
eina_strbuf_append(disk->mount_cmd, "nosuid,");
|
eina_strbuf_append(disk->mount_cmd, "nosuid,");
|
||||||
if (disk->mount_opts & EEZE_DISK_MOUNTOPT_REMOUNT)
|
if (disk->mount_opts & EEZE_DISK_MOUNTOPT_REMOUNT)
|
||||||
eina_strbuf_append(disk->mount_cmd, "remount,");
|
eina_strbuf_append(disk->mount_cmd, "remount,");
|
||||||
|
if (disk->mount_opts & EEZE_DISK_MOUNTOPT_UID)
|
||||||
|
eina_strbuf_append_printf(disk->mount_cmd, "uid=%i,", (int)disk->uid);
|
||||||
eina_strbuf_append_printf(disk->mount_cmd, " UUID=%s %s", disk->cache.uuid, disk->mount_point);
|
eina_strbuf_append_printf(disk->mount_cmd, " UUID=%s %s", disk->cache.uuid, disk->mount_point);
|
||||||
}
|
}
|
||||||
disk->mount_cmd_changed = EINA_FALSE;
|
disk->mount_cmd_changed = EINA_FALSE;
|
||||||
|
|
|
@ -55,6 +55,7 @@ struct _Eeze_Disk
|
||||||
const char *mount_point;
|
const char *mount_point;
|
||||||
const char *mount_wrapper;
|
const char *mount_wrapper;
|
||||||
unsigned long mount_opts;
|
unsigned long mount_opts;
|
||||||
|
uid_t uid;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue