- 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;
- for_each_matching_row(&pmd);
- if (laad.pb.offset)
- pass_buffer_as_shm(fd, SBD_OUTPUT, laad.pb.buf, laad.pb.offset);
- free(laad.pb.buf);
-}
-
-int com_lsatt(struct command_context *cc)
-{
- unsigned flags = 0;
- struct osl_object options = {.data = &flags, .size = sizeof(flags)};
- int ret, i;
-
- for (i = 1; i < cc->argc; i++) {
- const char *arg = cc->argv[i];
- if (arg[0] != '-')
- break;
- if (!strcmp(arg, "--")) {
- i++;
- break;
- }
- if (!strcmp(arg, "-i")) {
- flags |= LSATT_FLAG_SORT_BY_ID;
- continue;
- }
- if (!strcmp(arg, "-l")) {
- flags |= LSATT_FLAG_LONG;
- continue;
- }
- if (!strcmp(arg, "-r")) {
- flags |= LSATT_FLAG_REVERSE;
- continue;
- }
- }
- ret = send_option_arg_callback_request(&options, cc->argc - i, cc->argv + i,
- com_lsatt_callback, afs_cb_result_handler, cc);
- if (ret < 0)
- send_strerror(cc, -ret);
- else if (ret == 0 && cc->argc > 1)
- ret = cc->use_sideband?
- send_sb_va(&cc->scc, SBD_ERROR_LOG, "no matches\n")
- :
- sc_send_va_buffer(&cc->scc, "no matches\n");
- return ret;
-}
-
-static void com_setatt_callback(__a_unused int fd, const struct osl_object *query)
-{
- char *p;
- uint64_t add_mask = 0, del_mask = 0;
- int ret;
- size_t len;
- struct osl_object obj;
- struct osl_row *row;