#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
#ifdef _WIN32
#define CAN_COPY_VA_LIST
(*(OUT) = getpwuid(UID), *(OUT) == NULL ? -1 : 0)
#endif
+/* Ensure, if possible, that the indicated file descriptor won't be
+ kept open if we exec another process (e.g., launching a ccapi
+ server). If we don't know how to do it... well, just go about our
+ business. Probably most callers won't check the return status
+ anyways. */
+
+#if 0
+static inline int
+set_cloexec_fd(int fd)
+{
+#if defined(F_SETFD)
+# ifdef FD_CLOEXEC
+ if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0)
+ return errno;
+# else
+ if (fcntl(fd, F_SETFD, 1) != 0)
+ return errno;
+# endif
+#endif
+ return 0;
+}
+
+static inline int
+set_cloexec_file(FILE *f)
+{
+ return set_cloexec_fd(fileno(f));
+}
+#else
+/* Macros make the Sun compiler happier, and all variants of this do a
+ single evaluation of the argument, and fcntl and fileno should
+ produce reasonable error messages on type mismatches, on any system
+ with F_SETFD. */
+#ifdef F_SETFD
+# ifdef FD_CLOEXEC
+# define set_cloexec_fd(FD) (fcntl((FD), F_SETFD, FD_CLOEXEC) ? errno : 0)
+# else
+# define set_cloexec_fd(FD) (fcntl((FD), F_SETFD, 1) ? errno : 0)
+# endif
+#else
+# define set_cloexec_fd(FD) ((FD),0)
+#endif
+#define set_cloexec_file(F) set_cloexec_fd(fileno(F))
+#endif
+
+
+
/* Since the original ANSI C spec left it undefined whether or
how you could copy around a va_list, C 99 added va_copy.
For old implementations, let's do our best to fake it.
#define mkstemp krb5int_mkstemp
#endif
+
+
#endif /* K5_PLATFORM_H */
krb5_klog_close(context);
exit(1);
}
+ set_cloexec_fd(s);
if ((schpw = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
const char *e_txt = krb5_get_error_message (context, ret);
krb5_klog_close(context);
exit(1);
}
+ set_cloexec_fd(schpw);
#ifdef SO_REUSEADDR
/* the old admin server turned on SO_REUSEADDR for non-default
krb5_klog_close(context);
exit(1);
}
+ set_cloexec_fd(s2);
if (connect(s2, (struct sockaddr *) &from, sizeof(from)) < 0) {
krb5_klog_syslog(LOG_ERR, "chpw: Couldn't connect to client: %s",
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0)
perrorexit("Couldn't create socket");
+ set_cloexec_fd(s);
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = 0;
paddr(addr));
return -1;
}
+ set_cloexec_fd(sock);
if (sock > FD_SETSIZE) {
close(sock);
com_err(data->prog, 0, "TCP socket fd number %d (for %s) too high",
port, haddrbuf);
return 1;
}
+ set_cloexec_fd(sock);
#ifdef KRB5_USE_INET6
if (addr->sa_family == AF_INET6) {
#ifdef IPV6_V6ONLY
s = accept(conn->fd, addr, &addrlen);
if (s < 0)
return;
+ set_cloexec_fd(s);
if (s > FD_SETSIZE) {
close(s);
return;
/*
- * Copyright (C) 2002 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2002, 2007 by the Massachusetts Institute of Technology.
* All rights reserved.
*
* Export of this software from the United States of America may
com_err(whoami, errno, "creating main socket");
cleanup_and_exit(1, context);
}
+ set_cloexec_fd(s);
if ((ret = bind(s, (struct sockaddr *) &saddr,
sizeof(struct sockaddr_in))) < 0) {
com_err(whoami, errno, "binding main socket");
/*
- * Copyright (C) 2001, 2002, 2004 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2001, 2002, 2004, 2007 by the Massachusetts Institute of Technology.
* All rights reserved.
*
*
fd = open (device, O_RDONLY);
if (fd == -1)
return 0;
- if (fstat (fd, &sb) == -1)
- return 0;
- if (S_ISREG(sb.st_mode)) {
- close(fd);
- return 0;
+ set_cloexec_fd(fd);
+ if (fstat (fd, &sb) == -1 || S_ISREG(sb.st_mode)) {
+ close(fd);
+ return 0;
}
for (bp = &buf, left = sizeof (buf); left > 0;) {
if (cp[4] == ':' || cp[4] == '=') {
f = fopen(&cp[5], (cp[4] == ':') ? "a+" : "w");
if (f) {
+ set_cloexec_file(f);
log_control.log_entries[i].lfu_filep = f;
log_control.log_entries[i].log_type = K_LOG_FILE;
log_control.log_entries[i].lfu_fname = &cp[5];
log_control.log_entries[i].ldu_filep =
CONSOLE_OPEN("a+");
if (log_control.log_entries[i].ldu_filep) {
+ set_cloexec_file(log_control.log_entries[i].ldu_filep);
log_control.log_entries[i].log_type = K_LOG_CONSOLE;
log_control.log_entries[i].ldu_devname = "console";
}
log_control.log_entries[i].ldu_filep =
DEVICE_OPEN(&cp[7], "w");
if (log_control.log_entries[i].ldu_filep) {
+ set_cloexec_file(log_control.log_entries[i].ldu_filep);
log_control.log_entries[i].log_type = K_LOG_DEVICE;
log_control.log_entries[i].ldu_devname = &cp[7];
}
*/
f = fopen(log_control.log_entries[lindex].lfu_fname, "a+");
if (f) {
+ set_cloexec_file(f);
log_control.log_entries[lindex].lfu_filep = f;
} else {
fprintf(stderr, "Couldn't open log file %s: %s\n",
/*
* lib/kadm5/srv/server_acl.c
*
- * Copyright 1995-2004 by the Massachusetts Institute of Technology.
+ * Copyright 1995-2004, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
/* Open the ACL file for read */
afp = fopen(acl_acl_file, "r");
if (afp) {
+ set_cloexec_file(afp);
alineno = 1;
aentpp = &acl_list_head;
} else
return errno;
}
- if (fstat(fd, &sb) == -1)
+ set_cloexec_fd(fd);
+ if (fstat(fd, &sb) == -1) {
+ close(fd);
return errno;
+ }
if ((word_block = (char *) malloc(sb.st_size + 1)) == NULL)
return errno;
if (read(fd, word_block, sb.st_size) != sb.st_size)
/*
* lib/kdb/kdb_helper.c
*
- * Copyright 1995 by the Massachusetts Institute of Technology.
+ * Copyright 1995, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
error_message (e), keyfile);
return e;
}
+ set_cloexec_file(kf);
enctype = key->enctype;
if ((fwrite((krb5_pointer) &enctype,
2, 1, kf) != 1) ||
if (!(kf = fopen((db_args) ? db_args : defkeyfile, "r")))
#endif
return KRB5_KDB_CANTREAD_STORED;
+ set_cloexec_file(kf);
if (fread((krb5_pointer) &enctype, 2, 1, kf) != 1) {
retval = KRB5_KDB_CANTREAD_STORED;
krb4int.h tf_util.c
dest_tkt.so dest_tkt.po $(OUTPRE)dest_tkt.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(KRB_ERR_H_DEP) $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-util.h $(SRCTOP)/include/kerberosIV/des.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/k5-util.h $(SRCTOP)/include/kerberosIV/des.h \
$(SRCTOP)/include/kerberosIV/krb.h dest_tkt.c
in_tkt.so in_tkt.po $(OUTPRE)in_tkt.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(KRB_ERR_H_DEP) $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
$(SRCTOP)/include/k5-util.h $(SRCTOP)/include/kerberosIV/des.h \
$(SRCTOP)/include/kerberosIV/krb.h in_tkt.c
tkt_string.so tkt_string.po $(OUTPRE)tkt_string.$(OBJEXT): \
krb4int.h unix_glue.c
klog.so klog.po $(OUTPRE)klog.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(KRB_ERR_H_DEP) $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
$(SRCTOP)/include/kerberosIV/des.h $(SRCTOP)/include/kerberosIV/klog.h \
$(SRCTOP)/include/kerberosIV/krb.h $(SRCTOP)/include/port-sockets.h \
klog.c krb4int.h
kuserok.so kuserok.po $(OUTPRE)kuserok.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(KRB_ERR_H_DEP) $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
$(SRCTOP)/include/kerberosIV/des.h $(SRCTOP)/include/kerberosIV/krb.h \
kuserok.c
log.so log.po $(OUTPRE)log.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(KRB_ERR_H_DEP) $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
$(SRCTOP)/include/kerberosIV/des.h $(SRCTOP)/include/kerberosIV/klog.h \
$(SRCTOP)/include/kerberosIV/krb.h $(SRCTOP)/include/port-sockets.h \
krb4int.h log.c
$(SRCTOP)/include/kerberosIV/prot.h cr_death_pkt.c
put_svc_key.so put_svc_key.po $(OUTPRE)put_svc_key.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(KRB_ERR_H_DEP) $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/kerberosIV/des.h \
- $(SRCTOP)/include/kerberosIV/krb.h $(SRCTOP)/include/port-sockets.h \
- krb4int.h put_svc_key.c
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kerberosIV/des.h $(SRCTOP)/include/kerberosIV/krb.h \
+ $(SRCTOP)/include/port-sockets.h krb4int.h put_svc_key.c
sendauth.so sendauth.po $(OUTPRE)sendauth.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(KRB_ERR_H_DEP) $(BUILDTOP)/include/profile.h \
$(COM_ERR_DEPS) $(SRCTOP)/include/kerberosIV/des.h \
/*
* lib/krb4/dest_tkt.c
*
- * Copyright 1985, 1986, 1987, 1988, 2000, 2001 by the Massachusetts
+ * Copyright 1985, 1986, 1987, 1988, 2000, 2001, 2007 by the Massachusetts
* Institute of Technology. All Rights Reserved.
*
* Export of this software from the United States of America may
#include "k5-util.h"
#define do_seteuid krb5_seteuid
+#include "k5-platform.h"
#ifdef TKT_SHMEM
#include <sys/param.h>
ret = (errno == ENOENT) ? RET_TKFIL : KFAILURE;
goto out;
}
+ set_cloexec_fd(fd);
/*
* Do some additional paranoid things. The worst-case situation
* is that a user may be fooled into opening a non-regular file
&full_name);
if (retval == 0 && full_name && full_name[0]) {
cnffile = fopen(full_name[0],"r");
+ if (cnffile)
+ set_cloexec_file(cnffile);
for (cpp = full_name; *cpp; cpp++)
krb5_xfree(*cpp);
krb5_xfree(full_name);
#ifdef ATHENA_CONF_FALLBACK
if (!cnffile) cnffile = fopen(KRB_FB_CONF,"r");
#endif
+ if (cnffile)
+ set_cloexec_file(cnffile);
return cnffile;
}
if (!realmsfile) realmsfile = fopen(KRB_FB_RLM_TRANS, "r");
#endif
+ if (realmsfile)
+ set_cloexec_file(realmsfile);
+
return realmsfile;
}
-
-
/*
* lib/krb4/in_tkt.c
*
- * Copyright 1985, 1986, 1987, 1988, 2000, 2001 by the Massachusetts
+ * Copyright 1985, 1986, 1987, 1988, 2000, 2001, 2007 by the Massachusetts
* Institute of Technology. All Rights Reserved.
*
* Export of this software from the United States of America may
#include "k5-util.h"
#define do_seteuid krb5_seteuid
+#include "k5-platform.h"
#ifndef O_SYNC
#define O_SYNC 0
return KFAILURE;
/* file already exists, and permissions appear ok, so nuke it */
fd = open(file, O_RDWR|O_SYNC, 0);
+ if (fd >= 0)
+ set_cloexec_fd(fd);
(void)unlink(file);
if (me != metoo && do_seteuid(metoo) < 0)
return KFAILURE;
ticket file. */
mask = umask(077);
tktfile = open(file, O_RDWR|O_SYNC|O_CREAT|O_EXCL, 0600);
+ if (tktfile >= 0)
+ set_cloexec_fd(tktfile);
umask(mask);
if (me != metoo) {
if (do_seteuid(metoo) < 0) {
/*
* lib/krb4/kadm_net.c
*
- * Copyright 1988, 2002 by the Massachusetts Institute of Technology.
+ * Copyright 1988, 2002, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
if ((client_parm->admin_fd =
socket(client_parm->admin_addr.sin_family, SOCK_STREAM,0)) < 0)
return KADM_NO_SOCK; /* couldnt create the socket */
+ set_cloexec_fd(client_parm->admin_fd);
if (SOCKET_CONNECT(client_parm->admin_fd,
(struct sockaddr *) & client_parm->admin_addr,
sizeof(client_parm->admin_addr))) {
/*
* lib/krb4/klog.c
*
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute of
+ * Copyright 1985, 1986, 1987, 1988, 2007 by the Massachusetts Institute of
* Technology. All Rights Reserved.
*
* Export of this software from the United States of America may
#include "krb4int.h"
#include <klog.h>
+#include "k5-platform.h"
static char *log_name = KRBLOG;
static char logtxt[1000];
if ((logfile = fopen(log_name,"a")) == NULL)
return(logtxt);
+ set_cloexec_file(logfile);
(void) time(&now);
tm = localtime(&now);
/*
* lib/krb4/kuserok.c
*
- * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ * Copyright 1987, 1988, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
/* just for F_OK for sco */
#include <sys/unistd.h>
#endif
+#include "k5-platform.h"
#ifndef HAVE_SETEUID
#ifdef HAVE_SETRESUID
return(NOTOK);
}
}
+ set_cloexec_file(fp);
/*
* security: if the user does not own his own .klogin file,
* do not grant access
/*
* lib/krb4/log.c
*
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute of
+ * Copyright 1985, 1986, 1987, 1988, 2007 by the Massachusetts Institute of
* Technology. All Rights Reserved.
*
* Export of this software from the United States of America may
#include "krb4int.h"
#include <klog.h>
+#include "k5-platform.h"
static char *log_name = KRBLOG;
#if 0
va_start(args, format);
if ((logfile = fopen(log_name,"a")) != NULL) {
+ set_cloexec_file(logfile);
(void) time(&now);
tm = localtime(&now);
if (!is_open) {
if ((logfile = fopen(log_name,"a")) == NULL) return(1);
+ set_cloexec_file(logfile);
is_open = 1;
}
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#include "k5-platform.h"
#define KEYSZ sizeof(C_Block)
/* strict put_svc_key.
if ((fd = open(sfile, O_RDWR)) < 0)
return KFAILURE;
+ set_cloexec_fd(fd);
while(getst(fd,fname,SNAME_SZ) > 0) {
getst(fd,finst,INST_SZ);
/*
* rd_svc_key.c
*
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
+ * Copyright 1985, 1986, 1987, 1988, 2007 by the Massachusetts Institute
* of Technology.
*
* For copying and distribution information, please see the file
if ((stab = open(file, 0, 0)) < 0)
return(KFAILURE);
+ set_cloexec_fd(stab);
wcard = (instance[0] == '*') && (instance[1] == '\0');
/* get current realm if not passed in */
/*
* tf_shm.c
*
- * Copyright 1988 by the Massachusetts Institute of Technology.
+ * Copyright 1988, 2007 by the Massachusetts Institute of Technology.
*
* For copying and distribution information, please see the file
* <mit-copyright.h>.
perror("krb_shm_create file");
(void) shmctl(shmid, IPC_RMID, 0);
return(KFAILURE); /* XXX */
- }
+ }
+ set_cloexec_file(sfile);
if (fchmod(fileno(sfile),0600) < 0) {
if (krb_debug)
perror("krb_shm_create fchmod");
perror("cannot open shared memory file");
return(KFAILURE); /* XXX */
}
+ set_cloexec_file(sfile);
if (fscanf(sfile,"%d",&shmid) == 1) {
if (shmctl(shmid,IPC_RMID,0) != 0) {
if (krb_debug)
/*
* lib/krb4/tf_util.c
*
- * Copyright 1985, 1986, 1987, 1988, 2000, 2001 by the Massachusetts
+ * Copyright 1985, 1986, 1987, 1988, 2000, 2001, 2007 by the Massachusetts
* Institute of Technology. All Rights Reserved.
*
* Export of this software from the United States of America may
return KFAILURE;
sfp = fopen(shmidname, "r"); /* only need read/write on the
actual tickets */
+ if (sfp != 0)
+ set_cloexec_file(sfp);
if (me != metoo && do_seteuid(metoo) < 0)
return KFAILURE;
if (sfp == 0) {
if (me != metoo && do_seteuid(me) < 0)
return KFAILURE;
fd = open(tf_name, O_RDWR, 0600);
+ if (fd >= 0)
+ set_cloexec_fd(fd);
if (me != metoo && do_seteuid(metoo) < 0)
return KFAILURE;
if (fd < 0) {
if (me != metoo && do_seteuid(me) < 0)
return KFAILURE;
fd = open(tf_name, O_RDONLY, 0600);
+ if (fd >= 0)
+ set_cloexec_fd(fd);
if (me != metoo && do_seteuid(metoo) < 0)
return KFAILURE;
if (fd < 0) {
cnfname, sizeof(cnfname) - 1, KERBEROS_INI);
cnffile = fopen(cnfname, "r");
+ if (cnffile)
+ set_cloexec_file(cnffile);
return cnffile;
}
realmsname, sizeof(realmsname) - 1, KERBEROS_INI);
realmsfile = fopen(realmsname, "r");
+ if (realmsfile)
+ set_cloexec_file(realmsfile);
return realmsfile;
}
return krb5_fcc_interpret (context, errno);
}
}
+ set_cloexec_fd(f);
data->mode = mode;
kret = krb5_fcc_interpret(context, errno);
goto cleanup;
}
+ set_cloexec_fd(ret);
data->file = ret;
}
else
k5_mutex_unlock(&krb5int_cc_file_mutex);
return krb5_fcc_interpret(context, errno);
}
+ set_cloexec_fd(ret);
/* Allocate memory */
data = (krb5_pointer) malloc(sizeof(krb5_fcc_data));
}
}
}
+ set_cloexec_file(KTFILEP(id));
if ((kerror = krb5_lock_file(context, fileno(KTFILEP(id)), mode))) {
(void) fclose(KTFILEP(id));
KTFILEP(id) = 0;
/*
* lib/krb5/keytab/srvtab/kts_resolv.c
*
- * Copyright 1990,1991,2002 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991,2002,2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
KTFILEP(id) = fopen(KTFILENAME(id), READ_MODE);
if (!KTFILEP(id))
return errno;
+ set_cloexec_file(KTFILEP(id));
return 0;
}
/*
* lib/krb5/os/kuserok.c
*
- * Copyright 1990,1993 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1993,2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
free(princname);
return(FALSE);
}
+ set_cloexec_file(fp);
/*
* For security reasons, the .k5login file must be owned either by
* the user himself, or by root. Otherwise, don't grant access.
/*
* lib/krb5/os/localaddr.c
*
- * Copyright 1990,1991,2000,2001,2002,2004 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991,2000,2001,2002,2004,2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
int i;
unsigned int addrbyte[16];
+ set_cloexec_file(f);
while (fscanf(f,
"%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x"
" %2x %2x %2x %2x %20s\n",
Tperror ("socket");
continue;
}
+ set_cloexec_fd(P.sock);
P.lifnum.lifn_family = P.af;
P.lifnum.lifn_flags = 0;
Tperror ("socket");
continue;
}
+ set_cloexec_fd(P.sock);
code = ioctl (P.sock, SIOCGLIFNUM, &P.if_num);
if (code) {
s = socket (USE_AF, USE_TYPE, USE_PROTO);
if (s < 0)
return SOCKET_ERRNO;
+ set_cloexec_fd(s);
retval = get_ifreq_array(&buf, &n, s);
if (retval) {
sock = socket(AF_INET, SOCK_DGRAM, 0);
if (sock == INVALID_SOCKET)
return NULL;
+ set_cloexec_fd(sock);
/* connect to arbitrary port and address (NOT loopback) */
addr.sin_family = AF_INET;
fd = dup(STDIN_FILENO);
if (fd < 0)
return KRB5_LIBOS_CANTREADPWD;
+ set_cloexec_fd(fd);
fp = fdopen(fd, "r");
if (fp == NULL)
goto cleanup;
dprint("socket: fd %d too high\n", fd);
return -1;
}
+ set_cloexec_fd(fd);
/* Make it non-blocking. */
if (ai->ai_socktype == SOCK_STREAM) {
static const int one = 1;
goto cleanup;
}
}
+ set_cloexec_fd(d->fd);
retval = krb5_rc_io_write(context, d, (krb5_pointer)&rc_vno,
sizeof(rc_vno));
if (retval)
goto cleanup;
}
}
+ set_cloexec_fd(d->fd);
do_not_unlink = 0;
retval = krb5_rc_io_read(context, d, (krb5_pointer) &rc_vno,
(void) krb5_rc_io_close(context, new1);
new1->fn = fn;
new1->fd = dup(old->fd);
+ set_cloexec_fd(new1->fd);
return 0;
#endif
}
$(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/xdr.h \
pmap_prot2.c
pmap_rmt.so pmap_rmt.po $(OUTPRE)pmap_rmt.$(OBJEXT): \
- $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \
- $(SRCTOP)/include/gssrpc/auth.h $(SRCTOP)/include/gssrpc/auth_gss.h \
- $(SRCTOP)/include/gssrpc/auth_unix.h $(SRCTOP)/include/gssrpc/clnt.h \
- $(SRCTOP)/include/gssrpc/pmap_clnt.h $(SRCTOP)/include/gssrpc/pmap_prot.h \
- $(SRCTOP)/include/gssrpc/pmap_rmt.h $(SRCTOP)/include/gssrpc/rename.h \
- $(SRCTOP)/include/gssrpc/rpc.h $(SRCTOP)/include/gssrpc/rpc_msg.h \
- $(SRCTOP)/include/gssrpc/svc.h $(SRCTOP)/include/gssrpc/svc_auth.h \
- $(SRCTOP)/include/gssrpc/xdr.h pmap_rmt.c
+ $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/gssapi/gssapi.h \
+ $(BUILDTOP)/include/gssrpc/types.h $(SRCTOP)/include/gssrpc/auth.h \
+ $(SRCTOP)/include/gssrpc/auth_gss.h $(SRCTOP)/include/gssrpc/auth_unix.h \
+ $(SRCTOP)/include/gssrpc/clnt.h $(SRCTOP)/include/gssrpc/pmap_clnt.h \
+ $(SRCTOP)/include/gssrpc/pmap_prot.h $(SRCTOP)/include/gssrpc/pmap_rmt.h \
+ $(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
+ $(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
+ $(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
+ pmap_rmt.c
rpc_prot.so rpc_prot.po $(OUTPRE)rpc_prot.$(OBJEXT): \
$(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \
$(SRCTOP)/include/gssrpc/auth.h $(SRCTOP)/include/gssrpc/auth_gss.h \
$(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
$(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
$(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
svc_tcp.c
svc_udp.so svc_udp.po $(OUTPRE)svc_udp.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \
$(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
$(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
$(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
svc_udp.c
xdr.so xdr.po $(OUTPRE)xdr.$(OBJEXT): $(BUILDTOP)/include/gssrpc/types.h \
$(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/xdr.h \
perror("get_myaddress: socket");
exit(1);
}
+ set_cloexec_fd(s);
ifc.ifc_len = sizeof (buf);
ifc.ifc_buf = buf;
if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
if (d == 0)
return;
- if (d->rpcf == NULL)
+ if (d->rpcf == NULL) {
d->rpcf = fopen(RPCDB, "r");
- else
+ if (d->rpcf)
+ set_cloexec_file(d->rpcf);
+ } else
rewind(d->rpcf);
if (d->current)
free(d->current);
if (d == 0)
return(NULL);
- if (d->rpcf == NULL && (d->rpcf = fopen(RPCDB, "r")) == NULL)
+ if (d->rpcf == NULL) {
+ if ((d->rpcf = fopen(RPCDB, "r")) == NULL)
return (NULL);
- if (fgets(d->line, BUFSIZ, d->rpcf) == NULL)
+ set_cloexec_file(d->rpcf);
+ }
+ if (fgets(d->line, BUFSIZ, d->rpcf) == NULL)
return (NULL);
return interpret(d->line, strlen(d->line));
}
#include <arpa/inet.h>
#define MAX_BROADCAST_SIZE 1400
#include <string.h>
+#include "k5-platform.h" /* set_cloexec_fd */
static struct timeval timeout = { 3, 0 };
stat = RPC_CANTSEND;
goto done_broad;
}
+ set_cloexec_fd(sock);
#ifdef SO_BROADCAST
if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, (char *) &on,
sizeof (on)) < 0) {
#include <errno.h>
#include <stdlib.h>
#include "autoconf.h"
+#include "k5-platform.h" /* set_cloexec_fd */
/*extern bool_t abort();
extern errno;
*/
perror("svctcp_.c - udp socket creation problem");
return ((SVCXPRT *)NULL);
}
+ set_cloexec_fd(sock);
madesock = TRUE;
}
memset((char *)&addr, 0, sizeof (addr));
goto again;
return (FALSE);
}
+ set_cloexec_fd(sock);
if (getsockname(sock, &laddr, &llen) < 0)
return (FALSE);
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
+#include "k5-platform.h"
#define rpc_buffer(xprt) ((xprt)->xp_p1)
perror("svcudp_create: socket creation problem");
return ((SVCXPRT *)NULL);
}
+ set_cloexec_fd(sock);
madesock = TRUE;
}
memset((char *)&addr, 0, sizeof (addr));
return OSA_ADB_NOLOCKFILE;
}
}
+ set_cloexec_file(lockp->lockinfo.lockfile);
lockp->lockinfo.lockmode = lockp->lockinfo.lockcnt = 0;
}
/* now we need to create the file since it does not exist */
fd = THREEPARAMOPEN(db->lock->filename,O_RDWR | O_CREAT | O_EXCL,
0600);
+ if (fd < 0)
+ return OSA_ADB_NOLOCKFILE;
+ set_cloexec_fd(fd);
if ((db->lock->lockfile = fdopen(fd, "w+")) == NULL)
return OSA_ADB_NOLOCKFILE;
} else if ((ret = krb5_lock_file(db->lock->context,
/*
* lib/kdb/kdb_db2.c
*
- * Copyright 1997,2006 by the Massachusetts Institute of Technology.
+ * Copyright 1997,2006,2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
goto err_out;
}
}
+ set_cloexec_fd(db_ctx->db_lf_file);
db_ctx->db_inited++;
if ((retval = krb5_db2_db_get_age(context, NULL, &db_ctx->db_lf_time)))
free(filename);
return errno;
}
+ set_cloexec_fd(fd);
/* fstat() will probably not fail unless using a remote filesystem
* (which is inappropriate for the kerberos database) so this check
* is mostly paranoia. */
retval = errno;
goto errout;
}
+ set_cloexec_fd(db_ctx->db_lf_file);
db_ctx->db_inited = 1;
# the Makefile.in file
#
bt_close.so bt_close.po $(OUTPRE)bt_close.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../include/config.h \
+ $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
+ $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
+ $(srcdir)/../mpool/mpool.h bt_close.c btree.h extern.h
+bt_conv.so bt_conv.po $(OUTPRE)bt_conv.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
$(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
$(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- bt_close.c btree.h extern.h
-bt_conv.so bt_conv.po $(OUTPRE)bt_conv.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(srcdir)/../include/config.h \
+ bt_conv.c btree.h extern.h
+bt_debug.so bt_debug.po $(OUTPRE)bt_debug.$(OBJEXT): \
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../include/config.h \
$(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
$(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
- $(srcdir)/../mpool/mpool.h bt_conv.c btree.h extern.h
-bt_debug.so bt_debug.po $(OUTPRE)bt_debug.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
+ $(srcdir)/../mpool/mpool.h bt_debug.c btree.h extern.h
+bt_delete.so bt_delete.po $(OUTPRE)bt_delete.$(OBJEXT): \
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../include/config.h \
+ $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
+ $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
+ $(srcdir)/../mpool/mpool.h bt_delete.c btree.h extern.h
+bt_get.so bt_get.po $(OUTPRE)bt_get.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
$(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
$(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- bt_debug.c btree.h extern.h
-bt_delete.so bt_delete.po $(OUTPRE)bt_delete.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
+ bt_get.c btree.h extern.h
+bt_open.so bt_open.po $(OUTPRE)bt_open.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
$(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
$(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
$(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- bt_delete.c btree.h extern.h
-bt_get.so bt_get.po $(OUTPRE)bt_get.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(srcdir)/../include/config.h \
- $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
- $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
- $(srcdir)/../mpool/mpool.h bt_get.c btree.h extern.h
-bt_open.so bt_open.po $(OUTPRE)bt_open.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(SRCTOP)/include/k5-platform.h \
- $(SRCTOP)/include/k5-thread.h $(srcdir)/../include/config.h \
+ bt_open.c btree.h extern.h
+bt_overflow.so bt_overflow.po $(OUTPRE)bt_overflow.$(OBJEXT): \
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../include/config.h \
$(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
$(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
- $(srcdir)/../mpool/mpool.h bt_open.c btree.h extern.h
-bt_overflow.so bt_overflow.po $(OUTPRE)bt_overflow.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
+ $(srcdir)/../mpool/mpool.h bt_overflow.c btree.h extern.h
+bt_page.so bt_page.po $(OUTPRE)bt_page.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
$(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
$(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- bt_overflow.c btree.h extern.h
-bt_page.so bt_page.po $(OUTPRE)bt_page.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(srcdir)/../include/config.h \
- $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
- $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
- $(srcdir)/../mpool/mpool.h bt_page.c btree.h extern.h
+ bt_page.c btree.h extern.h
bt_put.so bt_put.po $(OUTPRE)bt_put.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(srcdir)/../include/config.h \
- $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
- $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
- $(srcdir)/../mpool/mpool.h bt_put.c btree.h extern.h
-bt_search.so bt_search.po $(OUTPRE)bt_search.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
$(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
$(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
$(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- bt_search.c btree.h extern.h
-bt_seq.so bt_seq.po $(OUTPRE)bt_seq.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(srcdir)/../include/config.h \
+ bt_put.c btree.h extern.h
+bt_search.so bt_search.po $(OUTPRE)bt_search.$(OBJEXT): \
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../include/config.h \
$(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
$(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
- $(srcdir)/../mpool/mpool.h bt_seq.c btree.h extern.h
-bt_split.so bt_split.po $(OUTPRE)bt_split.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
+ $(srcdir)/../mpool/mpool.h bt_search.c btree.h extern.h
+bt_seq.so bt_seq.po $(OUTPRE)bt_seq.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
$(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
$(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- bt_split.c btree.h extern.h
+ bt_seq.c btree.h extern.h
+bt_split.so bt_split.po $(OUTPRE)bt_split.$(OBJEXT): \
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../include/config.h \
+ $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
+ $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
+ $(srcdir)/../mpool/mpool.h bt_split.c btree.h extern.h
bt_utils.so bt_utils.po $(OUTPRE)bt_utils.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
- $(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
- $(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
- $(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- bt_utils.c btree.h extern.h
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../include/config.h \
+ $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
+ $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
+ $(srcdir)/../mpool/mpool.h bt_utils.c btree.h extern.h
#endif
if ((fd = mkstemp(path)) != -1)
(void)unlink(path);
+ set_cloexec_fd(fd);
#ifdef SIG_BLOCK
(void)sigprocmask(SIG_SETMASK, &oset, NULL);
#else
# the Makefile.in file
#
db.so db.po $(OUTPRE)db.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(srcdir)/../include/config.h \
- $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
- $(srcdir)/../include/db.h db.c
+ $(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
+ $(srcdir)/../include/db-int.h $(srcdir)/../include/db.h \
+ db.c
# the Makefile.in file
#
hash.so hash.po $(OUTPRE)hash.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(srcdir)/../include/config.h \
- $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
- $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
- $(srcdir)/../mpool/mpool.h extern.h hash.c hash.h page.h
-hash_bigkey.so hash_bigkey.po $(OUTPRE)hash_bigkey.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
$(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
$(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
$(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- extern.h hash.h hash_bigkey.c page.h
+ extern.h hash.c hash.h page.h
+hash_bigkey.so hash_bigkey.po $(OUTPRE)hash_bigkey.$(OBJEXT): \
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../include/config.h \
+ $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
+ $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
+ $(srcdir)/../mpool/mpool.h extern.h hash.h hash_bigkey.c \
+ page.h
hash_debug.so hash_debug.po $(OUTPRE)hash_debug.$(OBJEXT): \
hash_debug.c
hash_func.so hash_func.po $(OUTPRE)hash_func.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
- $(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
- $(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
- $(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- extern.h hash.h hash_func.c page.h
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../include/config.h \
+ $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
+ $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
+ $(srcdir)/../mpool/mpool.h extern.h hash.h hash_func.c \
+ page.h
hash_log2.so hash_log2.po $(OUTPRE)hash_log2.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
- $(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
- $(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
- $(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- extern.h hash.h hash_log2.c page.h
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../include/config.h \
+ $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
+ $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
+ $(srcdir)/../mpool/mpool.h extern.h hash.h hash_log2.c \
+ page.h
hash_page.so hash_page.po $(OUTPRE)hash_page.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
- $(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
- $(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
- $(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- extern.h hash.h hash_page.c page.h
-hsearch.so hsearch.po $(OUTPRE)hsearch.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(srcdir)/../include/config.h \
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../include/config.h \
$(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
- $(srcdir)/../include/db.h hsearch.c search.h
+ $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
+ $(srcdir)/../mpool/mpool.h extern.h hash.h hash_page.c \
+ page.h
+hsearch.so hsearch.po $(OUTPRE)hsearch.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
+ $(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
+ $(srcdir)/../include/db-int.h $(srcdir)/../include/db.h \
+ hsearch.c search.h
dbm.so dbm.po $(OUTPRE)dbm.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(BUILDTOP)/include/db-ndbm.h \
- $(BUILDTOP)/include/db.h $(srcdir)/../include/config.h \
- $(srcdir)/../include/db-config.h $(srcdir)/../include/db-dbm.h \
- $(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
- $(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- dbm.c hash.h
+ $(BUILDTOP)/include/db-ndbm.h $(BUILDTOP)/include/db.h \
+ $(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
+ $(srcdir)/../include/db-dbm.h $(srcdir)/../include/db-int.h \
+ $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
+ $(srcdir)/../mpool/mpool.h dbm.c hash.h
# the Makefile.in file
#
mpool.so mpool.po $(OUTPRE)mpool.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(srcdir)/../include/config.h \
- $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
- $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
- mpool.c mpool.h
+ $(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
+ $(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
+ $(srcdir)/../include/db.h mpool.c mpool.h
# the Makefile.in file
#
rec_close.so rec_close.po $(OUTPRE)rec_close.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
- $(srcdir)/../btree/btree.h $(srcdir)/../btree/extern.h \
- $(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
- $(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
- $(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- extern.h rec_close.c recno.h
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../btree/btree.h \
+ $(srcdir)/../btree/extern.h $(srcdir)/../include/config.h \
+ $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
+ $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
+ $(srcdir)/../mpool/mpool.h extern.h rec_close.c recno.h
rec_delete.so rec_delete.po $(OUTPRE)rec_delete.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
- $(srcdir)/../btree/btree.h $(srcdir)/../btree/extern.h \
- $(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
- $(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
- $(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- extern.h rec_delete.c recno.h
-rec_get.so rec_get.po $(OUTPRE)rec_get.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(srcdir)/../btree/btree.h \
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../btree/btree.h \
$(srcdir)/../btree/extern.h $(srcdir)/../include/config.h \
$(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
$(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
- $(srcdir)/../mpool/mpool.h extern.h rec_get.c recno.h
-rec_open.so rec_open.po $(OUTPRE)rec_open.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
+ $(srcdir)/../mpool/mpool.h extern.h rec_delete.c recno.h
+rec_get.so rec_get.po $(OUTPRE)rec_get.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(srcdir)/../btree/btree.h $(srcdir)/../btree/extern.h \
$(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
$(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
$(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- extern.h rec_open.c recno.h
-rec_put.so rec_put.po $(OUTPRE)rec_put.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(srcdir)/../btree/btree.h \
+ extern.h rec_get.c recno.h
+rec_open.so rec_open.po $(OUTPRE)rec_open.$(OBJEXT): \
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../btree/btree.h \
$(srcdir)/../btree/extern.h $(srcdir)/../include/config.h \
$(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
$(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
- $(srcdir)/../mpool/mpool.h extern.h rec_put.c recno.h
-rec_search.so rec_search.po $(OUTPRE)rec_search.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
+ $(srcdir)/../mpool/mpool.h extern.h rec_open.c recno.h
+rec_put.so rec_put.po $(OUTPRE)rec_put.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(srcdir)/../btree/btree.h $(srcdir)/../btree/extern.h \
$(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
$(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
$(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- extern.h rec_search.c recno.h
-rec_seq.so rec_seq.po $(OUTPRE)rec_seq.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
- $(BUILDTOP)/include/db-config.h $(srcdir)/../btree/btree.h \
+ extern.h rec_put.c recno.h
+rec_search.so rec_search.po $(OUTPRE)rec_search.$(OBJEXT): \
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../btree/btree.h \
$(srcdir)/../btree/extern.h $(srcdir)/../include/config.h \
$(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
$(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
- $(srcdir)/../mpool/mpool.h extern.h rec_seq.c recno.h
-rec_utils.so rec_utils.po $(OUTPRE)rec_utils.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/db-config.h \
+ $(srcdir)/../mpool/mpool.h extern.h rec_search.c recno.h
+rec_seq.so rec_seq.po $(OUTPRE)rec_seq.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(srcdir)/../btree/btree.h $(srcdir)/../btree/extern.h \
$(srcdir)/../include/config.h $(srcdir)/../include/db-config.h \
$(srcdir)/../include/db-int.h $(srcdir)/../include/db-queue.h \
$(srcdir)/../include/db.h $(srcdir)/../mpool/mpool.h \
- extern.h rec_utils.c recno.h
+ extern.h rec_seq.c recno.h
+rec_utils.so rec_utils.po $(OUTPRE)rec_utils.$(OBJEXT): \
+ $(BUILDTOP)/include/autoconf.h $(srcdir)/../btree/btree.h \
+ $(srcdir)/../btree/extern.h $(srcdir)/../include/config.h \
+ $(srcdir)/../include/db-config.h $(srcdir)/../include/db-int.h \
+ $(srcdir)/../include/db-queue.h $(srcdir)/../include/db.h \
+ $(srcdir)/../mpool/mpool.h extern.h rec_utils.c recno.h
if (fname != NULL && (rfd = open(fname, flags | O_BINARY, mode)) < 0)
return (NULL);
+ if (fname != NULL && fcntl(rfd, F_SETFD, 1) == -1) {
+ close(rfd);
+ return NULL;
+ }
+
/* Create a btree in memory (backed by disk). */
dbp = NULL;
if (openinfo) {
ldap_exp.so ldap_exp.po $(OUTPRE)ldap_exp.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
$(srcdir)/libkdb_ldap/kdb_ldap.h $(srcdir)/libkdb_ldap/ldap_krbcontainer.h \
com_err(me, errno, "while deleting entry from file %s", file_name);
goto cleanup;
}
+ set_cloexec_file(pfile);
/* Create a new file with the extension .tmp */
tmp_file = (char *)malloc(strlen(file_name) + 4 + 1);
com_err(me, errno, "Failed to open file %s", file_name);
goto cleanup;
}
+ set_cloexec_file(pfile);
while (fgets(line, MAX_LEN, pfile) != NULL) {
if ((str = strstr(line, service_object)) != NULL) {
com_err(me, errno, "Error creating file %s", tmp_file);
goto cleanup;
}
-
+ set_cloexec_file(newfile);
fseek(pfile, 0, SEEK_SET);
while (fgets(line, MAX_LEN, pfile) != NULL) {
}
memset(passwd, 0, passwd_len);
- /* TODO: file lock for the service passowrd file */
+ /* TODO: file lock for the service password file */
/* set password in the file */
old_mode = umask(0177);
strerror (errno));
goto cleanup;
}
+ set_cloexec_file(pfile);
rewind (pfile);
umask(old_mode);
fclose(pfile);
goto cleanup;
}
+ set_cloexec_file(newfile);
fseek(pfile, 0, SEEK_SET);
while (fgets(line, MAX_LEN, pfile) != NULL) {
$(SRCTOP)/include/gssrpc/rpc.h $(SRCTOP)/include/gssrpc/rpc_msg.h \
$(SRCTOP)/include/gssrpc/svc.h $(SRCTOP)/include/gssrpc/svc_auth.h \
$(SRCTOP)/include/gssrpc/xdr.h $(SRCTOP)/include/k5-err.h \
- $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
- $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
- $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(SRCTOP)/include/k5-int-pkinit.h $(SRCTOP)/include/k5-int.h \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
+ $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
+ $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.c kdb_ldap.h ldap_err.h ldap_krbcontainer.h \
kdb_ldap_conn.so kdb_ldap_conn.po $(OUTPRE)kdb_ldap_conn.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h kdb_ldap_conn.c ldap_handle.h ldap_krbcontainer.h \
ldap_realm.so ldap_realm.po $(OUTPRE)ldap_realm.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_err.h ldap_handle.h ldap_krbcontainer.h \
ldap_create.so ldap_create.po $(OUTPRE)ldap_create.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_create.c ldap_err.h ldap_handle.h ldap_krbcontainer.h \
ldap_krbcontainer.so ldap_krbcontainer.po $(OUTPRE)ldap_krbcontainer.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_err.h ldap_handle.h ldap_krbcontainer.c \
$(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
$(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
$(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
- $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_err.h ldap_handle.h ldap_krbcontainer.h \
$(SRCTOP)/include/gssrpc/rpc.h $(SRCTOP)/include/gssrpc/rpc_msg.h \
$(SRCTOP)/include/gssrpc/svc.h $(SRCTOP)/include/gssrpc/svc_auth.h \
$(SRCTOP)/include/gssrpc/xdr.h $(SRCTOP)/include/k5-err.h \
- $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
- $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
- $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(SRCTOP)/include/k5-int-pkinit.h $(SRCTOP)/include/k5-int.h \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
+ $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
+ $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_err.h ldap_handle.h ldap_krbcontainer.h \
ldap_pwd_policy.so ldap_pwd_policy.po $(OUTPRE)ldap_pwd_policy.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_err.h ldap_handle.h ldap_krbcontainer.h \
$(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
$(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
$(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
- $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_err.h ldap_handle.h ldap_krbcontainer.h \
ldap_handle.so ldap_handle.po $(OUTPRE)ldap_handle.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_handle.c ldap_handle.h ldap_krbcontainer.h \
ldap_tkt_policy.so ldap_tkt_policy.po $(OUTPRE)ldap_tkt_policy.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_err.h ldap_handle.h ldap_krbcontainer.h \
ldap_services.so ldap_services.po $(OUTPRE)ldap_services.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_err.h ldap_handle.h ldap_krbcontainer.h \
ldap_service_rights.so ldap_service_rights.po $(OUTPRE)ldap_service_rights.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_err.h ldap_handle.h ldap_krbcontainer.h \
$(SRCTOP)/include/gssrpc/rpc.h $(SRCTOP)/include/gssrpc/rpc_msg.h \
$(SRCTOP)/include/gssrpc/svc.h $(SRCTOP)/include/gssrpc/svc_auth.h \
$(SRCTOP)/include/gssrpc/xdr.h $(SRCTOP)/include/k5-err.h \
- $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
- $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
- $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(SRCTOP)/include/k5-int-pkinit.h $(SRCTOP)/include/k5-int.h \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
+ $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
+ $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_krbcontainer.h ldap_principal.h ldap_realm.h \
ldap_fetch_mkey.so ldap_fetch_mkey.po $(OUTPRE)ldap_fetch_mkey.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_fetch_mkey.c ldap_handle.h ldap_krbcontainer.h \
ldap_service_stash.so ldap_service_stash.po $(OUTPRE)ldap_service_stash.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
- $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int-pkinit.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(SRCTOP)/lib/kdb/kdb5.h \
kdb_ldap.h ldap_handle.h ldap_krbcontainer.h ldap_main.h \
kdb_xdr.so kdb_xdr.po $(OUTPRE)kdb_xdr.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
$(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h \
- $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
- $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
- $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(SRCTOP)/include/k5-int-pkinit.h $(SRCTOP)/include/k5-int.h \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
+ $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
+ $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h kdb_xdr.c kdb_xdr.h
ldap_err.so ldap_err.po $(OUTPRE)ldap_err.$(OBJEXT): \
krb5_set_error_message (context, st, "%s", errbuf);
goto rp_exit;
}
+ set_cloexec_file(fptr);
/* get the record from the file */
while (fgets(line, RECORDLEN, fptr)!= NULL) {
/*
* plugins/locate/python/py-locate.c
*
- * Copyright 2006 Massachusetts Institute of Technology.
+ * Copyright 2006, 2007 Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
SCRIPT_PATH, strerror(errno));
return -1;
}
+ set_cloexec_file(f);
PyRun_SimpleFile (f, SCRIPT_PATH);
fclose(f);
mainmodule = PyModule_GetDict(PyImport_AddModule("__main__"));
idopts->cert_filename, errno);
goto cleanup;
}
+ set_cloexec_file(fp);
p12 = d2i_PKCS12_fp(fp, NULL);
fclose(fp);
if ((f = fopen(filename, "w")) == NULL)
return;
+ set_cloexec_file(f);
+
for (i = 0; i < len; i++)
fputc(buf[i], f);
retval = ENOENT;
return retval;
}
+ set_cloexec_file(f);
data->upd_serial++;
data->flags &= PROFILE_FILE_SHARED;
if (rw_access(data->filespec))
goto errout;
}
+ set_cloexec_file(f);
profile_write_tree_file(data->root, f);
if (fclose(f) != 0) {
retval = errno;
func = signal(SIGINT, SIG_IGN);
#endif
- fd = ss_pager_create();
+ fd = ss_pager_create(); /* FD_CLOEXEC set */
output = fdopen(fd, "w");
#ifdef POSIX_SIGNALS
* "write" side.
*/
(void) close(filedes[0]);
+ set_cloexec_fd(filedes[1]);
return(filedes[1]);
}
}
{
int fd;
fd = open("/dev/tty", O_WRONLY, 0);
+ if (fd >= 0)
+ set_cloexec_fd(fd);
return fd;
}
#endif
/*
* util/support/threads.c
*
- * Copyright 2004,2005,2006 by the Massachusetts Institute of Technology.
+ * Copyright 2004,2005,2006,2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
/* stats_logfile = stderr; */
stats_logfile = fopen("/dev/tty", "w+");
if (stats_logfile == NULL)
- stats_logfile = stderr;
+ stats_logfile = stderr;
+ else
+ set_cloexec_file(stats_logfile);
#endif
#ifndef ENABLE_THREADS