annotate tests/test-idpriv-drop.c @ 17363:5a51fb7777a9

sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin Problem reported by Marco Atzeri in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>. * lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]: Simply delegate to the system <sys/select.h> in this case too. Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to be needed on Solaris either. * lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]: Simply delgate to the system <sys/time.h> in this case.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 19 Mar 2013 09:08:47 -0700
parents e542fd46ad6f
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11614
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of dropping uid/gid privileges of the current process permanently.
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16201
diff changeset
2 Copyright (C) 2009-2013 Free Software Foundation, Inc.
11614
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 #include <config.h>
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include "idpriv.h"
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <stdbool.h>
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #include <stdio.h>
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include <stdlib.h>
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 #include <string.h>
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 #include <unistd.h>
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26
12496
a48d3d749ca5 Refactor common macros used in tests.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
27 #include "macros.h"
11614
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 static void
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 show_uids ()
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 {
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 #if HAVE_GETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 uid_t real;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 uid_t effective;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 uid_t saved;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 ASSERT (getresuid (&real, &effective, &saved) >= 0);
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 printf ("uids: real=%d effective=%d saved=%d",
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11614
diff changeset
38 (int) real, (int) effective, (int) saved);
11614
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 #elif HAVE_GETEUID
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 printf ("uids: real=%d effective=%d",
13051
094f6cfdb5c3 Minor formatting changes.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
41 (int) getuid (), (int) geteuid ());
11614
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 #elif HAVE_GETUID
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 printf ("uids: real=%d",
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11614
diff changeset
44 (int) getuid ());
11614
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 #endif
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 }
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 static void
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 show_gids ()
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 {
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 #if HAVE_GETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 gid_t real;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 gid_t effective;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 gid_t saved;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 ASSERT (getresgid (&real, &effective, &saved) >= 0);
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 printf ("gids: real=%d effective=%d saved=%d",
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11614
diff changeset
57 (int) real, (int) effective, (int) saved);
11614
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 #elif HAVE_GETEGID
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 printf ("gids: real=%d effective=%d",
13051
094f6cfdb5c3 Minor formatting changes.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
60 (int) getgid (), (int) getegid ());
11614
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 #elif HAVE_GETGID
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 printf ("gids: real=%d",
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11614
diff changeset
63 (int) getgid ());
11614
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 #endif
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 }
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 static void
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 show (const char *prefix)
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 {
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 printf ("%s ", prefix);
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 show_uids ();
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 printf (" ");
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 show_gids ();
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 printf ("\n");
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 }
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 int
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 main (int argc, char *argv[])
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79 {
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80 bool verbose = false;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 int i;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 #if HAVE_GETUID
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84 int uid = getuid ();
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 #endif
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 #if HAVE_GETGID
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 int gid = getgid ();
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 #endif
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 /* Parse arguments.
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 -v enables verbose output.
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 */
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 for (i = 1; i < argc; i++)
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 {
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 const char *arg = argv[i];
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
96 if (strcmp (arg, "-v") == 0)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11614
diff changeset
97 verbose = true;
11614
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
98 }
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100 if (verbose)
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
101 show ("before drop:");
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 ASSERT (idpriv_drop () == 0);
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
104
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
105 if (verbose)
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
106 show ("after drop: ");
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
107
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
108 /* Verify that the privileges have really been dropped. */
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109 #if HAVE_GETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
110 {
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
111 uid_t real;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
112 uid_t effective;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113 uid_t saved;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
114 if (getresuid (&real, &effective, &saved) < 0
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11614
diff changeset
115 || real != uid
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11614
diff changeset
116 || effective != uid
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11614
diff changeset
117 || saved != uid)
11614
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118 abort ();
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119 }
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 #else
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 # if HAVE_GETEUID
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
122 if (geteuid () != uid)
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
123 abort ();
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
124 # endif
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
125 # if HAVE_GETUID
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
126 if (getuid () != uid)
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
127 abort ();
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
128 # endif
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
129 #endif
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
130 #if HAVE_GETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
131 {
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
132 gid_t real;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
133 gid_t effective;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
134 gid_t saved;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
135 if (getresgid (&real, &effective, &saved) < 0
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11614
diff changeset
136 || real != gid
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11614
diff changeset
137 || effective != gid
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11614
diff changeset
138 || saved != gid)
11614
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
139 abort ();
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140 }
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
141 #else
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
142 # if HAVE_GETEGID
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
143 if (getegid () != gid)
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
144 abort ();
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
145 # endif
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
146 # if HAVE_GETGID
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
147 if (getgid () != gid)
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
148 abort ();
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
149 # endif
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
150 #endif
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
151
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
152 return 0;
b3e5d914be7d Tests for module 'idpriv-drop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
153 }