Compare commits
No commits in common. "c90c597ee3b6b9d30ee86410e46939ba875e467a" and "3cfb7cc50771ca6ee579217c1194534313f03d8d" have entirely different histories.
c90c597ee3
...
3cfb7cc507
|
@ -354,5 +354,3 @@ option('oss-fuzz', type : 'boolean', value : 'false',
|
||||||
description : 'build against oss-fuzz')
|
description : 'build against oss-fuzz')
|
||||||
option('llvm-fuzz', type : 'boolean', value : 'false',
|
option('llvm-fuzz', type : 'boolean', value : 'false',
|
||||||
description : 'build against LLVM libFuzzer')
|
description : 'build against LLVM libFuzzer')
|
||||||
option('kernel-install', type: 'boolean', value: 'true',
|
|
||||||
description : 'include kernel-install feature')
|
|
||||||
|
|
|
@ -124,13 +124,10 @@ static int verify_socket(Unit *u) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int verify_executable(Unit *u, const ExecCommand *exec) {
|
static int verify_executable(Unit *u, ExecCommand *exec) {
|
||||||
if (!exec)
|
if (!exec)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (exec->flags & EXEC_COMMAND_IGNORE_FAILURE)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (access(exec->path, X_OK) < 0)
|
if (access(exec->path, X_OK) < 0)
|
||||||
return log_unit_error_errno(u, errno, "Command %s is not executable: %m", exec->path);
|
return log_unit_error_errno(u, errno, "Command %s is not executable: %m", exec->path);
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "execute.h"
|
|
||||||
#include "path-lookup.h"
|
#include "path-lookup.h"
|
||||||
|
|
||||||
int verify_executable(Unit *u, const ExecCommand *exec);
|
|
||||||
int verify_units(char **filenames, UnitFileScope scope, bool check_man, bool run_generators);
|
int verify_units(char **filenames, UnitFileScope scope, bool check_man, bool run_generators);
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
/* SPDX-License-Identifier: LGPL-2.1+ */
|
|
||||||
#include "analyze-verify.h"
|
|
||||||
#include "tests.h"
|
|
||||||
|
|
||||||
static void test_verify_nonexistent(void) {
|
|
||||||
/* Negative cases */
|
|
||||||
assert_se(verify_executable(NULL, &(ExecCommand) {.flags = EXEC_COMMAND_IGNORE_FAILURE, .path = (char*) "/non/existent"}) == 0);
|
|
||||||
assert_se(verify_executable(NULL, &(ExecCommand) {.path = (char*) "/non/existent"}) < 0);
|
|
||||||
|
|
||||||
/* Ordinary cases */
|
|
||||||
assert_se(verify_executable(NULL, &(ExecCommand) {.path = (char*) "/bin/echo"}) == 0);
|
|
||||||
assert_se(verify_executable(NULL, &(ExecCommand) {.flags = EXEC_COMMAND_IGNORE_FAILURE, .path = (char*) "/bin/echo"}) == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
|
||||||
test_setup_logging(LOG_DEBUG);
|
|
||||||
|
|
||||||
test_verify_nonexistent();
|
|
||||||
}
|
|
|
@ -1,8 +1,5 @@
|
||||||
# SPDX-License-Identifier: LGPL-2.1+
|
# SPDX-License-Identifier: LGPL-2.1+
|
||||||
|
|
||||||
want_kernel_install = get_option('kernel-install')
|
|
||||||
|
|
||||||
if want_kernel_install
|
|
||||||
install_data('kernel-install',
|
install_data('kernel-install',
|
||||||
install_mode : 'rwxr-xr-x',
|
install_mode : 'rwxr-xr-x',
|
||||||
install_dir : bindir)
|
install_dir : bindir)
|
||||||
|
@ -15,4 +12,3 @@ if want_kernel_install
|
||||||
|
|
||||||
meson.add_install_script('sh', '-c',
|
meson.add_install_script('sh', '-c',
|
||||||
mkdir_p.format(join_paths(sysconfdir, 'kernel/install.d')))
|
mkdir_p.format(join_paths(sysconfdir, 'kernel/install.d')))
|
||||||
endif
|
|
||||||
|
|
|
@ -1127,10 +1127,6 @@ tests += [
|
||||||
[],
|
[],
|
||||||
[]],
|
[]],
|
||||||
|
|
||||||
[['src/analyze/test-verify.c', 'src/analyze/analyze-verify.c', 'src/analyze/analyze-verify.h'],
|
|
||||||
[libcore, libshared],
|
|
||||||
[]],
|
|
||||||
|
|
||||||
[['src/login/test-inhibit.c'],
|
[['src/login/test-inhibit.c'],
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
|
|
Loading…
Reference in New Issue