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:
Johan Danielsson
1997-04-20 13:21:28 +00:00
parent 264f68f294
commit f23cb831bb
3 changed files with 36 additions and 115 deletions

View File

@@ -36,51 +36,10 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include "config.h" #include "kafs_locl.h"
#include "protos.h"
RCSID("$Id$"); 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" #define AUTH_SUPERUSER "afs"
/* /*
@@ -172,40 +131,37 @@ dns_find_cell(char *cell, char *dbserver)
static char* static char*
realm_of_cell(char *cell) realm_of_cell(char *cell)
{ {
FILE *F; FILE *F;
char buf[1024]; char buf[1024];
u_int32_t addr; u_int32_t addr;
struct hostent *hp; struct hostent *hp;
char *realm = NULL; char *realm = NULL;
F = fopen(_PATH_CELLSERVDB, "r"); if((F = fopen(_PATH_CELLSERVDB, "r"))){
while(F && !feof(F)){ while(fgets(buf, sizeof(buf), F)){
fgets(buf, 1024, F); if(buf[0] != '>')
if(buf[0] != '>') continue;
continue; if(strncmp(buf + 1, cell, strlen(cell)) == 0){
if(strncmp(buf+1, cell, strlen(cell)) == 0){ if(fgets(buf, sizeof(buf), F) == NULL)
fgets(buf, 1024, F); break;
if(feof(F)) addr = ip_aton(buf);
break; if(addr == 0)
addr = ip_aton(buf); break;
if(addr == 0) hp = gethostbyaddr((char*)&addr, 4, AF_INET);
break; if(hp == NULL)
hp = gethostbyaddr((char*)&addr, 4, AF_INET); break;
if(hp == NULL) strcpy(buf, hp->h_name);
break; realm = krb_realmofhost(buf);
strcpy(buf, hp->h_name); break;
realm = krb_realmofhost(buf); }
break; }
fclose(F);
} }
} if(realm == NULL){
if(F) if(dns_find_cell(cell, buf) == 0)
fclose(F); realm = krb_realmofhost(buf);
}
if(realm == NULL){ return realm;
if(dns_find_cell(cell, buf) == 0)
realm = krb_realmofhost(buf);
}
return realm;
} }
/* /*

View File

@@ -40,14 +40,9 @@
* This file is only used with AIX * This file is only used with AIX
*/ */
#ifdef HAVE_CONFIG_H #include "kafs_locl.h"
#include <config.h>
RCSID("$Id$");
#endif
#include <sys/types.h> RCSID("$Id$");
#include "kafs.h"
#include "afssysdefs.h"
int int
aix_pioctl(char *a_path, aix_pioctl(char *a_path,

View File

@@ -36,39 +36,10 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include "config.h" #include "kafs_locl.h"
#include "protos.h"
RCSID("$Id$"); 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 */ /* Magic to get AIX syscalls to work */
#ifdef _AIX #ifdef _AIX
@@ -77,8 +48,7 @@ static int (*Setpag)(void);
#include "dlfcn.h" #include "dlfcn.h"
static static int
int
isSuid() isSuid()
{ {
int uid = getuid(); int uid = getuid();
@@ -88,8 +58,7 @@ isSuid()
return (uid != euid) || (gid != egid); return (uid != euid) || (gid != egid);
} }
static static int
int
aix_setup(void) aix_setup(void)
{ {
#ifdef STATIC_AFS_SYSCALLS #ifdef STATIC_AFS_SYSCALLS
@@ -124,6 +93,7 @@ aix_setup(void)
#define UNKNOWN_ENTRY_POINT 6 #define UNKNOWN_ENTRY_POINT 6
static int afs_entry_point = UNKNOWN_ENTRY_POINT; static int afs_entry_point = UNKNOWN_ENTRY_POINT;
int int
k_pioctl(char *a_path, k_pioctl(char *a_path,
int o_opcode, int o_opcode,