1f08c3bdfSopenharmony_ci// SPDX-License-Identifier: GPL-2.0 2f08c3bdfSopenharmony_ci/* 3f08c3bdfSopenharmony_ci * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved. 4f08c3bdfSopenharmony_ci * Copyright (c) 2022 Petr Vorel <pvorel@suse.cz> 5f08c3bdfSopenharmony_ci */ 6f08c3bdfSopenharmony_ci 7f08c3bdfSopenharmony_ci/* 8f08c3bdfSopenharmony_ci * SUID to root program invoked by a non-root process to validate the mount 9f08c3bdfSopenharmony_ci * flag MS_NOSUID. 10f08c3bdfSopenharmony_ci */ 11f08c3bdfSopenharmony_ci 12f08c3bdfSopenharmony_ci#include <errno.h> 13f08c3bdfSopenharmony_ci#include <unistd.h> 14f08c3bdfSopenharmony_ci 15f08c3bdfSopenharmony_ci#define TST_NO_DEFAULT_MAIN 16f08c3bdfSopenharmony_ci#include "tst_test.h" 17f08c3bdfSopenharmony_ci 18f08c3bdfSopenharmony_ciint main(void) 19f08c3bdfSopenharmony_ci{ 20f08c3bdfSopenharmony_ci tst_reinit(); 21f08c3bdfSopenharmony_ci 22f08c3bdfSopenharmony_ci TST_EXP_FAIL(setreuid(getuid(), 0), EPERM); 23f08c3bdfSopenharmony_ci 24f08c3bdfSopenharmony_ci return 0; 25f08c3bdfSopenharmony_ci} 26