(chown_xsockets): new function

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5153 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1998-09-26 15:34:39 +00:00
parent 4b4b8f9e35
commit a13f0423b7

View File

@@ -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;
}
/*
*
*/