apparmor/binutils
Steve Beattie ffc6529bef
binutils/aa-features-abi: fix failure to close fd due to shadowed var decl
The variable used to store the file descriptor for the --file ended up
being declared twice, resulting in the autoclose attribute attached to
the first declaration being removed by the shadowed second declaration.
Fix this by converting the second declaration to just be an assignment,
as was intended.

strace output before:

  [...]
  ) = 1925
  close(1)                                = 0
  exit_group(0)                           = ?
  +++ exited with 0 +++

strace output after removing shadow declaration:

  ) = 1925
  close(1)                                = 0
  close(3)                                = 0
  exit_group(0)                           = ?
  +++ exited with 0 +++

(File descriptor 3 is what is returned by the open() call on the
 --file argument.)

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
2021-09-27 13:07:11 -07:00
..
po treewide: spelling/typo fixes in code strings 2020-12-01 12:47:18 -08:00
aa-enabled.pod Fix typos 2020-10-25 11:54:56 +00:00
aa-exec.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-features-abi.pod Fix typos 2020-10-25 11:54:56 +00:00
aa-status.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa_enabled.c Fix typos 2020-10-25 11:54:56 +00:00
aa_exec.c Error out on conflicting aa-exec parameters 2020-05-21 17:04:40 +02:00
aa_features_abi.c binutils/aa-features-abi: fix failure to close fd due to shadowed var decl 2021-09-27 13:07:11 -07:00
aa_status.c aa_status: Fix build issue with musl 2020-10-07 09:10:43 -07:00
cJSON.c aa-status: add json pretty printing using cJSON 2020-05-07 01:12:28 -07:00
cJSON.h aa-status: add json pretty printing using cJSON 2020-05-07 01:12:28 -07:00
Makefile apparmor: fix manpage order 2020-10-07 06:30:33 -07:00