summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--support/include/misc.h3
-rw-r--r--utils/gssd/svcgssd_proc.c3
-rw-r--r--utils/mountd/cache.c5
3 files changed, 11 insertions, 0 deletions
diff --git a/support/include/misc.h b/support/include/misc.h
index bc5ba23..eedc1fe 100644
--- a/support/include/misc.h
+++ b/support/include/misc.h
@@ -17,4 +17,7 @@ int weakrandomkey(unsigned char *keyout, int len);
extern int is_mountpoint(char *path);
+/* size of the file pointer buffers for rpc procfs files */
+#define RPC_CHAN_BUF_SIZE 32768
+
#endif /* MISC_H */
diff --git a/utils/gssd/svcgssd_proc.c b/utils/gssd/svcgssd_proc.c
index 7a916d7..c714d99 100644
--- a/utils/gssd/svcgssd_proc.c
+++ b/utils/gssd/svcgssd_proc.c
@@ -56,6 +56,7 @@
#include "gss_util.h"
#include "err_util.h"
#include "context.h"
+#include "misc.h"
#include "gss_oids.h"
#include "svcgssd_krb5.h"
@@ -71,6 +72,7 @@ struct svc_cred {
int cr_ngroups;
gid_t cr_groups[NGROUPS];
};
+static char vbuf[RPC_CHAN_BUF_SIZE];
static int
do_svc_downcall(gss_buffer_desc *out_handle, struct svc_cred *cred,
@@ -92,6 +94,7 @@ do_svc_downcall(gss_buffer_desc *out_handle, struct svc_cred *cred,
SVCGSSD_CONTEXT_CHANNEL, strerror(errno));
goto out_err;
}
+ setvbuf(f, vbuf, _IOLBF, RPC_CHAN_BUF_SIZE);
qword_printhex(f, out_handle->value, out_handle->length);
/* XXX are types OK for the rest of this? */
/* For context cache, use the actual context endtime */
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index ce93e3c..df6b38f 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -825,6 +825,7 @@ struct {
char *cache_name;
void (*cache_handle)(FILE *f);
FILE *f;
+ char vbuf[RPC_CHAN_BUF_SIZE];
} cachelist[] = {
{ "auth.unix.ip", auth_unix_ip, NULL},
{ "auth.unix.gid", auth_unix_gid, NULL},
@@ -848,6 +849,10 @@ void cache_open(void)
continue;
sprintf(path, "/proc/net/rpc/%s/channel", cachelist[i].cache_name);
cachelist[i].f = fopen(path, "r+");
+ if (cachelist[i].f != NULL) {
+ setvbuf(cachelist[i].f, cachelist[i].vbuf, _IOLBF,
+ RPC_CHAN_BUF_SIZE);
+ }
}
}