*/
/** \file attribute.c Attribute handling functions. */
+
+#include <regex.h>
+#include <openssl/rc4.h>
#include <osl.h>
+
#include "para.h"
#include "error.h"
+#include "crypt.h"
#include "string.h"
#include "afh.h"
#include "afs.h"
free(laad.pb.buf);
}
-int com_lsatt(int fd, int argc, char * const * const argv)
+int com_lsatt(struct rc4_context *rc4c, int argc, char * const * const argv)
{
unsigned flags = 0;
struct osl_object options = {.data = &flags, .size = sizeof(flags)};
}
}
ret = send_option_arg_callback_request(&options, argc - i, argv + i,
- com_lsatt_callback, send_result, &fd);
+ com_lsatt_callback, rc4_send_result, rc4c);
if (!ret) {
if (argc > 1)
- ret = send_va_buffer(fd, "no matches\n");
+ ret = rc4_send_va_buffer(rc4c, "no matches\n");
} else if (ret < 0)
- send_va_buffer(fd, "%s\n", para_strerror(-ret));
+ rc4_send_va_buffer(rc4c, "%s\n", para_strerror(-ret));
return ret;
}
PARA_NOTICE_LOG("%s\n", para_strerror(-ret));
}
-int com_setatt(__a_unused int fd, int argc, char * const * const argv)
+int com_setatt(__a_unused struct rc4_context *rc4c, int argc, char * const * const argv)
{
if (argc < 3)
return -E_ATTR_SYNTAX;
free(pb.buf);
}
-int com_addatt(int fd, int argc, char * const * const argv)
+int com_addatt(struct rc4_context *rc4c, int argc, char * const * const argv)
{
int ret;
if (argc < 2)
return -E_ATTR_SYNTAX;
ret = send_standard_callback_request(argc - 1, argv + 1, com_addatt_callback,
- send_result, &fd);
+ rc4_send_result, rc4c);
if (ret < 0)
- send_va_buffer(fd, "%s\n", para_strerror(-ret));
+ rc4_send_va_buffer(rc4c, "%s\n", para_strerror(-ret));
return ret;
}
free(pb.buf);
}
-int com_mvatt(int fd, int argc, char * const * const argv)
+int com_mvatt(struct rc4_context *rc4c, int argc, char * const * const argv)
{
int ret;
if (argc != 3)
return -E_ATTR_SYNTAX;
ret = send_standard_callback_request(argc - 1, argv + 1, com_mvatt_callback,
- send_result, &fd);
+ rc4_send_result, rc4c);
if (ret < 0)
- send_va_buffer(fd, "%s\n", para_strerror(-ret));
+ rc4_send_va_buffer(rc4c, "%s\n", para_strerror(-ret));
return ret;
}
free(raad.pb.buf);
}
-int com_rmatt(int fd, int argc, char * const * const argv)
+int com_rmatt(struct rc4_context *rc4c, int argc, char * const * const argv)
{
int ret;
if (argc < 2)
return -E_ATTR_SYNTAX;
ret = send_standard_callback_request(argc - 1, argv + 1, com_rmatt_callback,
- send_result, &fd);
+ rc4_send_result, rc4c);
if (ret < 0)
- send_va_buffer(fd, "%s\n", para_strerror(-ret));
+ rc4_send_va_buffer(rc4c, "%s\n", para_strerror(-ret));
return ret;
}
*
* \sa osl_close_table().
*/
-void attribute_close(void)
+static void attribute_close(void)
{
osl_close_table(attribute_table, OSL_MARK_CLEAN);
attribute_table = NULL;
return ret;
}
attribute_table = NULL;
- if (ret >= 0 || is_errno(-ret, ENOENT))
+ if (ret >= 0 || ret == -OSL_ERRNO_TO_PARA_ERROR(E_OSL_NOENT))
return 1;
return ret;
}
*/
void attribute_init(struct afs_table *t)
{
- t->name = attribute_table_desc.name;
t->open = attribute_open;
t->close = attribute_close;
t->create = attribute_create;