mirror of
https://github.com/samba-team/samba.git
synced 2025-03-29 02:50:28 +03:00
s3:lib/afs move afs_settoken.c to common lib dir
Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
89961ca297
commit
558850c495
@ -28,6 +28,7 @@
|
||||
#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>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Unix SMB/CIFS implementation.
|
||||
* Generate AFS tickets
|
||||
* Copyright (C) Volker Lendecke 2004
|
||||
@ -7,17 +7,18 @@
|
||||
* 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
|
||||
|
||||
@ -27,7 +28,7 @@
|
||||
|
||||
#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>
|
||||
@ -92,7 +93,7 @@ static bool afs_decode_token(const char *string, char **cell,
|
||||
DEBUG(10, ("sscanf AuthHandle failed\n"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
|
||||
DEBUG(10, ("strtok_r failed\n"));
|
||||
return false;
|
||||
@ -120,7 +121,7 @@ static bool afs_decode_token(const char *string, char **cell,
|
||||
DEBUG(10, ("sscanf ViceId failed\n"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
|
||||
DEBUG(10, ("strtok_r failed\n"));
|
||||
return false;
|
||||
@ -130,7 +131,7 @@ static bool afs_decode_token(const char *string, char **cell,
|
||||
DEBUG(10, ("sscanf BeginTimestamp failed\n"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
|
||||
DEBUG(10, ("strtok_r failed\n"));
|
||||
return false;
|
||||
@ -140,7 +141,7 @@ static bool afs_decode_token(const char *string, char **cell,
|
||||
DEBUG(10, ("sscanf EndTimestamp failed\n"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
|
||||
DEBUG(10, ("strtok_r failed\n"));
|
||||
return false;
|
||||
@ -166,7 +167,7 @@ static bool afs_decode_token(const char *string, char **cell,
|
||||
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,
|
||||
@ -235,8 +236,9 @@ bool afs_settoken_str(const char *token_string)
|
||||
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);
|
||||
|
21
lib/afs/afs_settoken.h
Normal file
21
lib/afs/afs_settoken.h
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* 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);
|
@ -4,3 +4,7 @@ bld.SAMBA3_SUBSYSTEM('LIBAFS',
|
||||
source='afs_funcs.c',
|
||||
deps='samba-util LIBAFS_SETTOKEN')
|
||||
|
||||
bld.SAMBA3_SUBSYSTEM('LIBAFS_SETTOKEN',
|
||||
source='afs_settoken.c',
|
||||
deps='samba-util')
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#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
|
||||
|
@ -35,11 +35,6 @@ bool allow_access(const char **deny_list,
|
||||
|
||||
/* 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);
|
||||
|
@ -24,6 +24,7 @@
|
||||
#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
|
||||
|
@ -23,6 +23,7 @@
|
||||
#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)
|
||||
{
|
||||
|
@ -468,10 +468,6 @@ bld.SAMBA3_SUBSYSTEM('LIBADS_PRINTER',
|
||||
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''',
|
||||
|
Loading…
x
Reference in New Issue
Block a user