#include "passdb.h"
#include "auth.h"
#include "../librpc/gen_ndr/ndr_netlogon.h"
+#include "lib/afs/afs_settoken.h"
#include <afs/param.h>
#include <afs/stds.h>
-/*
+/*
* Unix SMB/CIFS implementation.
* Generate AFS tickets
* Copyright (C) Volker Lendecke 2004
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
+#include "lib/afs/afs_settoken.h"
#ifdef WITH_FAKE_KASERVER
#include <afs/param.h>
#include <afs/stds.h>
-#include <afs/afs.h>
+#include <afs/afs_args.h>
#include <afs/auth.h>
#include <afs/venus.h>
#include <asm/unistd.h>
DEBUG(10, ("sscanf AuthHandle failed\n"));
return false;
}
-
+
if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
DEBUG(10, ("strtok_r failed\n"));
return false;
DEBUG(10, ("sscanf ViceId failed\n"));
return false;
}
-
+
if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
DEBUG(10, ("strtok_r failed\n"));
return false;
DEBUG(10, ("sscanf BeginTimestamp failed\n"));
return false;
}
-
+
if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
DEBUG(10, ("strtok_r failed\n"));
return false;
DEBUG(10, ("sscanf EndTimestamp failed\n"));
return false;
}
-
+
if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
DEBUG(10, ("strtok_r failed\n"));
return false;
This is currently highly Linux and OpenAFS-specific. The correct API
call for this would be ktc_SetToken. But to do that we would have to
import a REALLY big bunch of libraries which I would currently like
- to avoid.
+ to avoid.
*/
static bool afs_settoken(const char *cell,
if (!afs_decode_token(token_string, &cell, &ticket, &ct))
return false;
- if (geteuid() != sec_initial_uid())
- ct.ViceId = getuid();
+ if (geteuid() != 0) {
+ ct.ViceId = geteuid();
+ }
result = afs_settoken(cell, &ct, ticket);
--- /dev/null
+/*
+ * Unix SMB/CIFS implementation.
+ * Generate AFS tickets
+ * Copyright (C) Volker Lendecke 2004
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+int afs_syscall(int subcall, const char *path, int cmd, char *cmarg, int follow);
+bool afs_settoken_str(const char *token_string);
source='afs_funcs.c',
deps='samba-util LIBAFS_SETTOKEN')
+bld.SAMBA3_SUBSYSTEM('LIBAFS_SETTOKEN',
+ source='afs_settoken.c',
+ deps='samba-util')
+
#include "lib/popt/popt.h"
#include "../libcli/auth/libcli_auth.h"
#include "lib/cmdline/popt_common.h"
+#include "lib/afs/afs_settoken.h"
#ifdef DBGC_CLASS
#undef DBGC_CLASS
/* The following definitions come from lib/adt_tree.c */
-/* The following definitions come from lib/afs_settoken.c */
-
-int afs_syscall(int subcall, const char *path, int cmd, char *cmarg, int follow);
-bool afs_settoken_str(const char *token_string);
-
/* The following definitions come from lib/audit.c */
const char *audit_category_str(uint32 category);
#include "../libcli/security/security.h"
#include "../libcli/security/dom_sid.h"
#include "passdb.h"
+#include "lib/afs/afs_settoken.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS
#include "secrets.h"
#include "system/filesys.h"
#include "lib/afs/afs_funcs.h"
+#include "lib/afs/afs_settoken.h"
int net_afs_usage(struct net_context *c, int argc, const char **argv)
{
source='libads/ldap_printer.c',
deps='samba-util krb5samba')
-bld.SAMBA3_SUBSYSTEM('LIBAFS_SETTOKEN',
- source='lib/afs_settoken.c',
- deps='samba-util')
-
bld.SAMBA3_LIBRARY('smbconf',
source='''lib/smbconf/smbconf_init.c
lib/smbconf/smbconf_reg.c''',