Lines Matching refs:info
260 const struct devfsd_notify_struct *info; member
277 static void action_modload(const struct devfsd_notify_struct *info, const struct config_entry_struc…
712 struct devfsd_notify_struct info; in do_servicing() local
718 bytes = read(fd, (char *) &info, sizeof info); in do_servicing()
725 service_name(&info); in do_servicing()
737 static void service_name(const struct devfsd_notify_struct *info) in service_name() argument
747 if (ENABLE_DEBUG && info->overrun_count > 0) in service_name()
748 msg_logger(LOG_ERR, "lost %u events", info->overrun_count); in service_name()
751 if (info->type == DEVFSD_NOTIFY_LOOKUP in service_name()
752 && ((info->devname[0] == 'l' && info->devname[1] == 'o' in service_name()
753 && info->devname[2] == 'g' && !info->devname[3]) in service_name()
754 || (info->devname[0] == 'i' && info->devname[1] == 'n' in service_name()
755 && info->devname[2] == 'i' && info->devname[3] == 't' in service_name()
756 && info->devname[4] == 'c' && info->devname[5] == 't' in service_name()
757 && info->devname[6] == 'l' && !info->devname[7])) in service_name()
763 if (info->type != entry->action.when in service_name()
764 || regexec(&entry->preg, info->devname, MAX_SUBEXPR, mbuf, 0) != 0) in service_name()
771 action_permissions(info, entry); in service_name()
775 action_modload(info, entry); in service_name()
778 action_execute(info, entry, mbuf, n); in service_name()
781 action_copy(info, entry, mbuf, n); in service_name()
790 action_compat(info, entry->action.what); in service_name()
798 static void action_permissions(const struct devfsd_notify_struct *info, in action_permissions() argument
808 if (stat(info->devname, &statbuf) != 0 in action_permissions()
809 || chmod(info->devname, (statbuf.st_mode & S_IFMT) | (entry->u.permissions.mode & ~S_IFMT)) != 0 in action_permissions()
810 || chown(info->devname, entry->u.permissions.uid, entry->u.permissions.gid) != 0 in action_permissions()
812 error_logger(LOG_ERR, "Can't chmod or chown: %s", info->devname); in action_permissions()
815 static void action_modload(const struct devfsd_notify_struct *info, in action_modload() argument
829 argv[4] = concat_path_file("/dev", info->devname); /* device */ in action_modload()
836 static void action_execute(const struct devfsd_notify_struct *info, in action_execute() argument
853 gv_info.info = info; in action_execute()
854 gv_info.devname = info->devname; in action_execute()
855 snprintf(gv_info.devpath, sizeof(gv_info.devpath), "%s/%s", mount_point, info->devname); in action_execute()
868 static void action_copy(const struct devfsd_notify_struct *info, in action_copy() argument
888 if ((info->type == DEVFSD_NOTIFY_CHANGE) && S_ISLNK(info->mode)) in action_copy()
890 gv_info.info = info; in action_copy()
891 gv_info.devname = info->devname; in action_copy()
893 snprintf(gv_info.devpath, sizeof(gv_info.devpath), "%s/%s", mount_point, info->devname); in action_copy()
906 if (info->type == DEVFSD_NOTIFY_CREATE) in action_copy()
908 else if ((info->type == DEVFSD_NOTIFY_CHANGE) &&(dest_stat.st_mode & S_ISVTX)) in action_copy()
915 static void action_compat(const struct devfsd_notify_struct *info, unsigned int action) in action_compat() argument
924 const char *dest_name = info->devname; in action_compat()
949 compat_name = get_old_name(info->devname, info->namelen, compat_buf, info->major, info->minor); in action_compat()
953 ptr = bb_basename(info->devname); in action_compat()
954 i = scan_dev_name(info->devname, info->namelen, ptr); in action_compat()
960 …sscanf(info->devname + ((i < 6) ? 5 : 4), "host%d/bus%d/target%d/lun%d/", &host, &bus, &target, &l… in action_compat()
961 snprintf(dest_buf, sizeof(dest_buf), "../%s", info->devname + (( i > 5) ? 4 : 0)); in action_compat()
976 rewind_ = info->devname[info->namelen - 1]; in action_compat()
1206 static const char *get_variable(const char *variable, void *info) in get_variable() argument
1210 struct get_variable_info *gv_info = info; in get_variable()
1230 return auto_string(xasprintf("%u", gv_info->info->uid)); in get_variable()
1232 return auto_string(xasprintf("%u", gv_info->info->gid)); in get_variable()
1234 return auto_string(xasprintf("%o", gv_info->info->mode)); in get_variable()
1239 struct devfsd_notify_struct info; in service() local
1241 memset(&info, 0, sizeof info); in service()
1242 info.type = DEVFSD_NOTIFY_REGISTERED; in service()
1243 info.mode = statbuf.st_mode; in service()
1244 info.major = major(statbuf.st_rdev); in service()
1245 info.minor = minor(statbuf.st_rdev); in service()
1246 info.uid = statbuf.st_uid; in service()
1247 info.gid = statbuf.st_gid; in service()
1248 snprintf(info.devname, sizeof(info.devname), "%s", path + strlen(mount_point) + 1); in service()
1249 info.namelen = strlen(info.devname); in service()
1250 service_name(&info); in service()
1327 const char *(*get_variable_func)(const char *variable, void *info), in expand_expression() argument
1328 void *info, in expand_expression()
1348 if (!st_expr_expand(temp, STRING_LENGTH, input, get_variable_func, info)) in expand_expression()
1615 void *info), in st_expr_expand() argument
1616 void *info) in st_expr_expand()
1642 input = expand_variable(buffer, length, &out_pos, ++input, get_variable_func, info); in st_expr_expand()
1708 void *info), in expand_variable() argument
1709 void *info) in expand_variable()
1752 env = get_variable_v2(tmp, func, info); in expand_variable()
1776 ptr = expand_variable(buffer, length, out_pos, tmp, func, info); in expand_variable()
1813 env = get_variable_v2(tmp, func, info); in expand_variable()
1835 if (!st_expr_expand(tmp, STRING_LENGTH, tmp, func, info)) in expand_variable()
1851 const char *(*func)(const char *variable, void *info), in get_variable_v2() argument
1852 void *info) in get_variable_v2()
1864 value = (*func)(variable, info); in get_variable_v2()