View | Details | Raw Unified | Return to bug 686
Collapse All | Expand All

(-)uidswap.c.org (+8 lines)
Lines 16-21 Link Here
16
16
17
#include "log.h"
17
#include "log.h"
18
#include "uidswap.h"
18
#include "uidswap.h"
19
#ifdef WITH_IRIX_AUDIT
20
# include <sat.h>
21
#endif
19
22
20
/*
23
/*
21
 * Note: all these functions must work in all of the following cases:
24
 * Note: all these functions must work in all of the following cases:
Lines 192-200 Link Here
192
	}
195
	}
193
196
194
	/* Try restoration of UID if changed (test clearing of saved uid) */
197
	/* Try restoration of UID if changed (test clearing of saved uid) */
198
#ifdef WITH_IRIX_AUDIT
199
	if (old_uid != pw->pw_uid && satsetid(old_uid) != -1)
200
		fatal("%s: was able to restore old [e]uid", __func__);
201
#else
195
	if (old_uid != pw->pw_uid && 
202
	if (old_uid != pw->pw_uid && 
196
	    (setuid(old_uid) != -1 || seteuid(old_uid) != -1))
203
	    (setuid(old_uid) != -1 || seteuid(old_uid) != -1))
197
		fatal("%s: was able to restore old [e]uid", __func__);
204
		fatal("%s: was able to restore old [e]uid", __func__);
205
#endif
198
206
199
	/* Verify UID drop was successful */
207
	/* Verify UID drop was successful */
200
	if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) {
208
	if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) {

Return to bug 686