mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
binutils/aa-features-abi: fix a couple of minor issues
A small patch set to fix two issues with binutils/aa-features-abi: 1. The `aa-features-abi -f` short argument was not added to the `getopt_long()` set of short arguments, resulting in the command incorrectly failing when passed -f 2. Due to variable shadowing the file descriptor for the `--file` argument was not being autoclosed. - binutils/aa-features-abi: make -f short arg actually be accepted - binutils/aa-features-abi: fix failure to close fd due to shadowed var decl Signed-off-by: Steve Beattie <steve.beattie@canonical.com> Acked-by: John Johansen <john.johansen@canonical.com> MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/804 (cherry picked from commita24cda5ae1
)8137beb2
binutils/aa-features-abi: make -f short arg actually be acceptedffc6529b
binutils/aa-features-abi: fix failure to close fd due to shadowed var decl
This commit is contained in:
parent
e186512671
commit
609a262447
1 changed files with 2 additions and 2 deletions
|
@ -124,7 +124,7 @@ static char **parse_args(int argc, char **argv)
|
||||||
{"stdout", no_argument, 0, ARG_STDOUT},
|
{"stdout", no_argument, 0, ARG_STDOUT},
|
||||||
};
|
};
|
||||||
|
|
||||||
while ((opt = getopt_long(argc, argv, "+dvhxl:w:", long_opts, NULL)) != -1) {
|
while ((opt = getopt_long(argc, argv, "+dvhxf:l:w:", long_opts, NULL)) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'd':
|
case 'd':
|
||||||
opt_debug = true;
|
opt_debug = true;
|
||||||
|
@ -181,7 +181,7 @@ int main(int argc, char **argv)
|
||||||
error("failed to extract features abi from the kernel");
|
error("failed to extract features abi from the kernel");
|
||||||
}
|
}
|
||||||
if (opt_file) {
|
if (opt_file) {
|
||||||
int in = open(opt_file, O_RDONLY);
|
in = open(opt_file, O_RDONLY);
|
||||||
if (in == -1)
|
if (in == -1)
|
||||||
error("failed to open file '%s'", opt_file);
|
error("failed to open file '%s'", opt_file);
|
||||||
rc = aa_features_new_from_file(&features, in);
|
rc = aa_features_new_from_file(&features, in);
|
||||||
|
|
Loading…
Add table
Reference in a new issue