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"
/* /*
@@ -178,14 +137,12 @@ realm_of_cell(char *cell)
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){
fgets(buf, 1024, F); if(fgets(buf, sizeof(buf), F) == NULL)
if(feof(F))
break; break;
addr = ip_aton(buf); addr = ip_aton(buf);
if(addr == 0) if(addr == 0)
@@ -198,9 +155,8 @@ realm_of_cell(char *cell)
break; break;
} }
} }
if(F)
fclose(F); fclose(F);
}
if(realm == NULL){ if(realm == NULL){
if(dns_find_cell(cell, buf) == 0) if(dns_find_cell(cell, buf) == 0)
realm = krb_realmofhost(buf); realm = krb_realmofhost(buf);

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,