1
/*********************************************************
2
* Copyright (C) 2003 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License as published
6
* by the Free Software Foundation version 2.1 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
11
* License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
*********************************************************/
22
* Header file shared by impersonate code
25
#ifndef _IMPERSONATE_INT_H_
26
#define _IMPERSONATE_INT_H_
30
#include "impersonate.h"
33
//#define IMP_VERBOSE 1
34
#define INVALID_PTHREAD_KEY_VALUE (-1)
36
#define IMPWARN(x) Warning x
41
typedef struct ImpersonationState {
42
const char *impersonatedUser; // the user we are currently impersonating
43
int refCount; // # of times we are impersonating as same user
46
HANDLE impersonatedToken; // the access token currently impersonated with
47
Bool forceRoot; // are we temporarily switching back to root?
51
void ImpersonateInit(void);
52
ImpersonationState *ImpersonateGetTLS(void);
53
Bool ImpersonateRunas(const char *cfg, const char *caller, AuthToken callerToken);
54
Bool ImpersonateOwner(const char *file);
55
Bool ImpersonateDo(const char *user, AuthToken token);
56
Bool ImpersonateUndo(void);
57
Bool ImpersonateForceRoot(void);
58
Bool ImpersonateUnforceRoot(void);
60
#endif // ImpersonateInt.h