static void handle_makedev(struct blob_attr *msg, struct blob_attr *data)
{
+ unsigned int oldumask = umask(0);
static struct blobmsg_policy mkdev_policy[2] = {
{ .type = BLOBMSG_TYPE_STRING },
{ .type = BLOBMSG_TYPE_STRING },
m | strtoul(blobmsg_data(tb[1]), NULL, 8),
makedev(atoi(major), atoi(minor)));
}
+ umask(oldumask);
}
static void handle_rm(struct blob_attr *msg, struct blob_attr *data)
static void make_dev(const char *path, bool block, int major, int minor)
{
+ unsigned int oldumask = umask(0);
unsigned int _mode = mode | (block ? S_IFBLK : S_IFCHR);
+
DEBUG(2, "Creating %s device %s(%d,%d)\n",
block ? "block" : "character",
path, major, minor);
mknod(path, _mode, makedev(major, minor));
+ umask(oldumask);
}
static void find_devs(bool block)