From a13f0423b7b5af84159ff7af044bea6c09964ec4 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sat, 26 Sep 1998 15:34:39 +0000 Subject: [PATCH] (chown_xsockets): new function git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5153 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/kx/common.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/appl/kx/common.c b/appl/kx/common.c index 5912cc248..3710d7be2 100644 --- a/appl/kx/common.c +++ b/appl/kx/common.c @@ -288,7 +288,6 @@ try_mkdir (const char *path) oldmask = umask(0); mkdir (dir, 01777); - chmod (dir, 01777); umask (oldmask); free (dir); } @@ -377,6 +376,22 @@ get_xsockets (int *number, struct x_socket **sockets, int tcp_socket) return dpy; } +/* + * + */ + +int +chown_xsockets (int n, struct x_socket *sockets, uid_t uid, gid_t gid) +{ + int i; + + for (i = 0; i < n; ++i) + if (sockets[i].pathname != NULL) + if (chown (sockets[i].pathname, uid, gid) < 0) + return -1; + return 0; +} + /* * */