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_get
Allow use of wrapper exes for mount commands (such as sudo)
EEZE_DISK_MOUNTOPT_UTF8 = (1 << 2),
EEZE_DISK_MOUNTOPT_NOEXEC = (1 << 3),
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;
#include "config.h"
#endif
+#include <unistd.h>
+
#include <Ecore.h>
#include <Eeze.h>
#include <Eeze_Disk.h>
if (opts != disk->mount_opts)
disk->mount_cmd_changed = EINA_TRUE;
disk->mount_opts = opts;
+ if (opts & EEZE_DISK_MOUNTOPT_UID)
+ disk->uid = getuid();
return EINA_TRUE;
}
eina_strbuf_append(disk->mount_cmd, "nosuid,");
if (disk->mount_opts & EEZE_DISK_MOUNTOPT_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);
}
disk->mount_cmd_changed = EINA_FALSE;