summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/test/t_setuid.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/test/t_setuid.c')
-rw-r--r--contrib/sendmail/test/t_setuid.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/contrib/sendmail/test/t_setuid.c b/contrib/sendmail/test/t_setuid.c
index 7487579..6533339 100644
--- a/contrib/sendmail/test/t_setuid.c
+++ b/contrib/sendmail/test/t_setuid.c
@@ -1,12 +1,22 @@
/*
+ * Copyright (c) 2001 Sendmail, Inc. and its suppliers.
+ * All rights reserved.
+ *
+ * By using this file, you agree to the terms and conditions set
+ * forth in the LICENSE file which can be found at the top level of
+ * the sendmail distribution.
+ *
+ */
+
+/*
** This program checks to see if your version of setuid works.
-** Compile it, make it setuid root, and run it as yourself (NOT as
+** Compile it, make it set-user-ID root, and run it as yourself (NOT as
** root).
**
** NOTE: This should work everywhere, but Linux has the ability
** to use the undocumented setcap() call to make this break.
**
-** Compilation is trivial -- just "cc t_setuid.c". Make it setuid,
+** Compilation is trivial -- just "cc t_setuid.c". Make it set-user-ID,
** root and then execute it as a non-root user.
*/
@@ -15,16 +25,16 @@
#include <stdio.h>
#ifndef lint
-static char id[] = "@(#)$Id: t_setuid.c,v 8.2.2.1 2000/05/31 00:29:47 gshapiro Exp $";
+static char id[] = "@(#)$Id: t_setuid.c,v 8.7 2001/09/23 03:35:41 ca Exp $";
#endif /* ! lint */
static void
printuids(str, r, e)
char *str;
- int r, e;
+ uid_t r, e;
{
- printf("%s (should be %d/%d): r/euid=%d/%d\n", str, r, e,
- getuid(), geteuid());
+ printf("%s (should be %d/%d): r/euid=%d/%d\n", str, (int) r, (int) e,
+ (int) getuid(), (int) geteuid());
}
int
@@ -39,7 +49,7 @@ main(argc, argv)
if (geteuid() != 0)
{
- printf("SETUP ERROR: re-run setuid root\n");
+ printf("SETUP ERROR: re-run set-user-ID root\n");
exit(1);
}
OpenPOWER on IntegriCloud