diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2014-10-29 18:04:01 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2014-11-12 00:56:13 +0800 |
commit | 530b905d4ed7b92ebbd03362bb7a3a2a81a607e6 (patch) | |
tree | 637f24bd68f76789a59a5f4cfd6ada288637d402 | |
parent | 946b1184aabba0f1c5809ed7e6b63738145ba421 (diff) | |
download | extras-530b905d4ed7b92ebbd03362bb7a3a2a81a607e6.tar.gz |
bionic libc tests: clean up tests for seteuid call
Clean up files and settings for seteuid test here,
Since the tests will be migrated to unistd.seteuid* test
in bionic/tests/unistd_test.cpp file
Change-Id: Ia24b03c1e9a73e5e6c532e591a9d532253f0b9d1
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r-- | tests/bionic/libc/Android.mk | 1 | ||||
-rw-r--r-- | tests/bionic/libc/common/test_seteuid.c | 57 |
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; -} |