[dovecot-cvs] dovecot/src/lib compat.c, 1.21, 1.22 compat.h, 1.27, 1.28

cras at dovecot.org cras at dovecot.org
Sun Mar 27 17:42:23 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv13103/src/lib

Modified Files:
	compat.c compat.h 
Log Message:
Added setegid() emulation for HP-UX.



Index: compat.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/compat.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- compat.c	20 Dec 2004 04:39:50 -0000	1.21
+++ compat.c	27 Mar 2005 14:42:20 -0000	1.22
@@ -174,6 +174,18 @@
 }
 #endif
 
+#ifndef HAVE_SETEGID
+int my_setegid(gid_t egid)
+{
+#ifdef HAVE_SETRESGID
+	/* HP-UX at least doesn't have setegid() but has setresgid() */
+	return setresgid(-1, egid, -1);
+#else
+#  error Missing setegid functionality
+#endif
+}
+#endif
+
 #ifndef HAVE_LIBGEN_H
 char *my_basename(char *path)
 {

Index: compat.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/compat.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- compat.h	20 Dec 2004 04:39:50 -0000	1.27
+++ compat.h	27 Mar 2005 14:42:20 -0000	1.28
@@ -113,6 +113,11 @@
 int my_seteuid(uid_t euid);
 #endif
 
+#ifndef HAVE_SETEGID
+#  define setegid my_setegid
+int my_setegid(gid_t egid);
+#endif
+
 #ifndef HAVE_LIBGEN_H
 #  define basename my_basename
 char *my_basename(char *path);



More information about the dovecot-cvs mailing list