summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-11-12 02:07:05 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-11-12 02:07:05 +0000
commit122ca1918351648d0bc252a5583d376f8b3a0ee7 (patch)
tree61ec64b687f27311906ce3e53ec741766161a685
parentd0b1347e1679e6b4641bad0788157e5cd6da0082 (diff)
parent530b905d4ed7b92ebbd03362bb7a3a2a81a607e6 (diff)
downloadextras-122ca1918351648d0bc252a5583d376f8b3a0ee7.tar.gz
Merge "bionic libc tests: clean up tests for seteuid call"
-rw-r--r--tests/bionic/libc/Android.mk1
-rw-r--r--tests/bionic/libc/common/test_seteuid.c57
2 files changed, 0 insertions, 58 deletions
diff --git a/tests/bionic/libc/Android.mk b/tests/bionic/libc/Android.mk
index c35d6707..e7cdf1ee 100644
--- a/tests/bionic/libc/Android.mk
+++ b/tests/bionic/libc/Android.mk
@@ -63,7 +63,6 @@ endef
sources := \
common/test_pthread_mutex.c \
common/test_pthread_rwlock.c \
- common/test_seteuid.c \
# _XOPEN_SOURCE=600 is needed to get pthread_mutexattr_settype() on GLibc
#
diff --git a/tests/bionic/libc/common/test_seteuid.c b/tests/bionic/libc/common/test_seteuid.c
deleted file mode 100644
index ac330cec..00000000
--- a/tests/bionic/libc/common/test_seteuid.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
-
-int main( void )
-{
- uid_t ruid, euid;
-
- printf( "sizeof(uid_t) = %d sizeof(gid_t) = %d\n", sizeof(uid_t), sizeof(gid_t) );
-
- ruid = getuid();
- euid = geteuid();
- printf("Start: ruid=%d euid=%d\n", ruid, euid);
-
- if (seteuid(9999) != 0)
- perror("seteuid(9999)");
-
- ruid = getuid();
- euid = geteuid();
- printf("After set: ruid=%d euid=%d\n", ruid, euid);
-
- if (seteuid(0) != 0)
- perror("seteuid(0)");
-
- ruid = getuid();
- euid = geteuid();
- printf("After restore: ruid=%d euid=%d\n", ruid, euid);
-
- return 0;
-}