projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into next
[paraslash.git]
/
attribute.c
diff --git
a/attribute.c
b/attribute.c
index 4784aee96caef2cf6f2a2e809b4998bcc446aa69..cfb7dde0d0c1bc83160f6698bbe304d27007444b 100644
(file)
--- a/
attribute.c
+++ b/
attribute.c
@@
-5,9
+5,14
@@
*/
/** \file attribute.c Attribute handling functions. */
*/
/** \file attribute.c Attribute handling functions. */
+
+#include <regex.h>
+#include <openssl/rc4.h>
#include <osl.h>
#include <osl.h>
+
#include "para.h"
#include "error.h"
#include "para.h"
#include "error.h"
+#include "crypt.h"
#include "string.h"
#include "afh.h"
#include "afs.h"
#include "string.h"
#include "afh.h"
#include "afs.h"
@@
-172,7
+177,7
@@
static void com_lsatt_callback(int fd, const struct osl_object *query)
free(laad.pb.buf);
}
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)};
{
unsigned flags = 0;
struct osl_object options = {.data = &flags, .size = sizeof(flags)};
@@
-200,12
+205,12
@@
int com_lsatt(int fd, int argc, char * const * const argv)
}
}
ret = send_option_arg_callback_request(&options, argc - i, argv + i,
}
}
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)
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)
} 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;
}
return ret;
}
@@
-273,7
+278,7
@@
out:
PARA_NOTICE_LOG("%s\n", para_strerror(-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;
{
if (argc < 3)
return -E_ATTR_SYNTAX;
@@
-354,16
+359,16
@@
out:
free(pb.buf);
}
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,
{
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)
if (ret < 0)
-
send_va_buffer(fd
, "%s\n", para_strerror(-ret));
+
rc4_send_va_buffer(rc4c
, "%s\n", para_strerror(-ret));
return ret;
}
return ret;
}
@@
-397,16
+402,16
@@
out:
free(pb.buf);
}
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,
{
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)
if (ret < 0)
-
send_va_buffer(fd
, "%s\n", para_strerror(-ret));
+
rc4_send_va_buffer(rc4c
, "%s\n", para_strerror(-ret));
return ret;
}
return ret;
}
@@
-469,16
+474,16
@@
static void com_rmatt_callback(int fd, const struct osl_object *query)
free(raad.pb.buf);
}
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,
{
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)
if (ret < 0)
-
send_va_buffer(fd
, "%s\n", para_strerror(-ret));
+
rc4_send_va_buffer(rc4c
, "%s\n", para_strerror(-ret));
return ret;
}
return ret;
}
@@
-587,7
+592,7
@@
static int attribute_open(const char *dir)
return ret;
}
attribute_table = NULL;
return ret;
}
attribute_table = NULL;
- if (ret >= 0 ||
is_errno(-ret, E
NOENT))
+ if (ret >= 0 ||
ret == -OSL_ERRNO_TO_PARA_ERROR(E_OSL_
NOENT))
return 1;
return ret;
}
return 1;
return ret;
}
@@
-605,7
+610,6
@@
static int attribute_create(const char *dir)
*/
void attribute_init(struct afs_table *t)
{
*/
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;
t->open = attribute_open;
t->close = attribute_close;
t->create = attribute_create;