#include "includes.h"
#include "utils/net.h"
+#include "utils/net_afs.h"
+#include "secrets.h"
+#include "system/filesys.h"
+#include "lib/afs/afs_funcs.h"
+#include "lib/afs/afs_settoken.h"
+
+#ifdef WITH_FAKE_KASERVER
int net_afs_usage(struct net_context *c, int argc, const char **argv)
{
struct afs_keyfile keyfile;
if (argc != 2) {
- d_printf(_("Usage:")," net afs key <keyfile> cell\n");
+ d_printf("%s net afs key <keyfile> cell\n", _("Usage:"));
return -1;
}
}
if ((fd = open(argv[0], O_RDONLY, 0)) < 0) {
- d_fprintf(stderr, _("Could not open %s\n", argv[0]));
+ d_fprintf(stderr, _("Could not open %s\n"), argv[0]);
return -1;
}
if (read(fd, &keyfile, sizeof(keyfile)) != sizeof(keyfile)) {
d_fprintf(stderr, _("Could not read keyfile\n"));
+ close(fd);
return -1;
}
+ close(fd);
if (!secrets_store_afs_keyfile(argv[1], &keyfile)) {
d_fprintf(stderr, _("Could not write keyfile to secrets.tdb\n"));
char *token;
if (argc != 2) {
- fprintf(stderr, _("Usage:")," net afs impersonate <user> <cell>\n");
+ d_fprintf(stderr, "%s net afs impersonate <user> <cell>\n",
+ _("Usage:"));
exit(1);
}
return net_run_function(c, argc, argv, "net afs", func);
}
+#endif /* WITH_FAKE_KASERVER */