Use kafs_locl.h
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1607 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -36,51 +36,10 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "protos.h"
|
||||
#include "kafs_locl.h"
|
||||
|
||||
RCSID("$Id$");
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_FILIO_H
|
||||
#include <sys/filio.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
#endif
|
||||
#ifdef HAVE_RESOLV_H
|
||||
#include <resolv.h>
|
||||
#endif
|
||||
|
||||
#include <krb.h>
|
||||
#include <kafs.h>
|
||||
|
||||
#include <resolve.h>
|
||||
|
||||
#include "afssysdefs.h"
|
||||
|
||||
#define AUTH_SUPERUSER "afs"
|
||||
|
||||
/*
|
||||
@@ -172,40 +131,37 @@ dns_find_cell(char *cell, char *dbserver)
|
||||
static char*
|
||||
realm_of_cell(char *cell)
|
||||
{
|
||||
FILE *F;
|
||||
char buf[1024];
|
||||
u_int32_t addr;
|
||||
struct hostent *hp;
|
||||
char *realm = NULL;
|
||||
FILE *F;
|
||||
char buf[1024];
|
||||
u_int32_t addr;
|
||||
struct hostent *hp;
|
||||
char *realm = NULL;
|
||||
|
||||
F = fopen(_PATH_CELLSERVDB, "r");
|
||||
while(F && !feof(F)){
|
||||
fgets(buf, 1024, F);
|
||||
if(buf[0] != '>')
|
||||
continue;
|
||||
if(strncmp(buf+1, cell, strlen(cell)) == 0){
|
||||
fgets(buf, 1024, F);
|
||||
if(feof(F))
|
||||
break;
|
||||
addr = ip_aton(buf);
|
||||
if(addr == 0)
|
||||
break;
|
||||
hp = gethostbyaddr((char*)&addr, 4, AF_INET);
|
||||
if(hp == NULL)
|
||||
break;
|
||||
strcpy(buf, hp->h_name);
|
||||
realm = krb_realmofhost(buf);
|
||||
break;
|
||||
if((F = fopen(_PATH_CELLSERVDB, "r"))){
|
||||
while(fgets(buf, sizeof(buf), F)){
|
||||
if(buf[0] != '>')
|
||||
continue;
|
||||
if(strncmp(buf + 1, cell, strlen(cell)) == 0){
|
||||
if(fgets(buf, sizeof(buf), F) == NULL)
|
||||
break;
|
||||
addr = ip_aton(buf);
|
||||
if(addr == 0)
|
||||
break;
|
||||
hp = gethostbyaddr((char*)&addr, 4, AF_INET);
|
||||
if(hp == NULL)
|
||||
break;
|
||||
strcpy(buf, hp->h_name);
|
||||
realm = krb_realmofhost(buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(F);
|
||||
}
|
||||
}
|
||||
if(F)
|
||||
fclose(F);
|
||||
|
||||
if(realm == NULL){
|
||||
if(dns_find_cell(cell, buf) == 0)
|
||||
realm = krb_realmofhost(buf);
|
||||
}
|
||||
return realm;
|
||||
if(realm == NULL){
|
||||
if(dns_find_cell(cell, buf) == 0)
|
||||
realm = krb_realmofhost(buf);
|
||||
}
|
||||
return realm;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -40,14 +40,9 @@
|
||||
* This file is only used with AIX
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
RCSID("$Id$");
|
||||
#endif
|
||||
#include "kafs_locl.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "kafs.h"
|
||||
#include "afssysdefs.h"
|
||||
RCSID("$Id$");
|
||||
|
||||
int
|
||||
aix_pioctl(char *a_path,
|
||||
|
@@ -36,39 +36,10 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "protos.h"
|
||||
#include "kafs_locl.h"
|
||||
|
||||
RCSID("$Id$");
|
||||
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_FILIO_H
|
||||
#include <sys/filio.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SYSCALL_H
|
||||
#include <sys/syscall.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#include <kafs.h>
|
||||
|
||||
#include "afssysdefs.h"
|
||||
|
||||
/* Magic to get AIX syscalls to work */
|
||||
#ifdef _AIX
|
||||
|
||||
@@ -77,8 +48,7 @@ static int (*Setpag)(void);
|
||||
|
||||
#include "dlfcn.h"
|
||||
|
||||
static
|
||||
int
|
||||
static int
|
||||
isSuid()
|
||||
{
|
||||
int uid = getuid();
|
||||
@@ -88,8 +58,7 @@ isSuid()
|
||||
return (uid != euid) || (gid != egid);
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
static int
|
||||
aix_setup(void)
|
||||
{
|
||||
#ifdef STATIC_AFS_SYSCALLS
|
||||
@@ -124,6 +93,7 @@ aix_setup(void)
|
||||
#define UNKNOWN_ENTRY_POINT 6
|
||||
static int afs_entry_point = UNKNOWN_ENTRY_POINT;
|
||||
|
||||
|
||||
int
|
||||
k_pioctl(char *a_path,
|
||||
int o_opcode,
|
||||
|
Reference in New Issue
Block a user