+ struct lsatt_action_data laad = {.flags = *(unsigned *) query->data};
+ struct pattern_match_data pmd = {
+ .table = attribute_table,
+ .loop_col_num = ATTCOL_BITNUM,
+ .match_col_num = ATTCOL_NAME,
+ .patterns = {.data = (char *)query->data + sizeof(laad.flags),
+ .size = query->size - sizeof(laad.flags)},
+ .pm_flags = PM_NO_PATTERN_MATCHES_EVERYTHING,
+ .data = &laad,
+ .action = print_attribute
+ };
+ int ret;
+
+ if (laad.flags & LSATT_FLAG_SORT_BY_ID)
+ pmd.loop_col_num = ATTCOL_NAME;
+ if (laad.flags & LSATT_FLAG_REVERSE)
+ pmd.pm_flags |= PM_REVERSE_LOOP;
+ ret = for_each_matching_row(&pmd);
+ if (ret < 0)
+ para_printf(&laad.pb, "%s\n", PARA_STRERROR(-ret));
+ if (!laad.pb.buf)
+ return 0;
+ result->data = laad.pb.buf;
+ result->size = laad.pb.size;
+ return 1;
+}
+
+int com_lsatt(int fd, int argc, char * const * const argv)
+{
+ unsigned flags = 0;
+ struct osl_object options = {.data = &flags, .size = sizeof(flags)},
+ result;
+ int ret, i;