~apparmor-dev/apparmor/apparmor-ubuntu-citrain-trusty

« back to all changes in this revision

Viewing changes to debian/patches/0047-libapparmor-Make-aa_getpeercon_raw-similar-to-aa_get.patch

  • Committer: Seth Arnold
  • Date: 2014-03-12 02:05:16 UTC
  • mto: This revision was merged to the branch mainline in revision 1496.
  • Revision ID: seth.arnold@canonical.com-20140312020516-zjike3pmw6hi861h
[ Jamie Strandboge ]
 * debian/debhelper/dh_apparmor: exit with error if aa-easyprof does not
   exist
 * debian/control: drop Depends on apparmor-easyprof to Suggests for
   dh-apparmor
[ Seth Arnold, Jamie Strandboge, Steve Beattie, John Johansen, Tyler Hicks ]
* New upstream snapshot (LP: #1278702, #1061693, #1285653) dropping very
  large Ubuntu delta and fixing the following bugs:
  - Adjust fonts abstraction for libthai (LP: #1278702)
  - Support translated XDG user directories (LP: #1061693)
  - Adjust abstractions/web-data to include /var/www/html (LP: #1285653)
    Refresh 0002-add-debian-integration-to-lighttpd.patch to include
    /etc/lighttpd/conf-available/*.conf
  - Adjust debian/libapparmor1.symbols to reflect new upstream versioning
    for the aa_query_label() function
  - Raise exceptions in Python bindings when something fails
* ship new Python replacements for previous Perl-based tools
  - debian/apparmor-utils.install: remove usr/share/perl5/Immunix/*.pm and add
    usr/sbin/aa-autodep, usr/sbin/aa-cleanprof and usr/sbin/aa-mergeprof
  - debian/control:
    + remove various Perl dependencies
    + add python-apparmor and python3-apparmor
    + python3-apparmor Breaks: apparmor-easyprof to move the file since it
      ships dist-packages/apparmor/__init__.py now
  - debian/apparmor-utils.manpages: ship new manpages for aa-cleanprof and
    aa-mergeprof
  - debian/rules: build and install Python tools
* debian/apparmor.install:
  - install apparmorfs, dovecot, kernelvars, securityfs, sys,
    and xdg-user-dirs tunables and xdg-user-dirs.d directory
* debian/apparmor.dirs:
  - install /etc/apparmor.d/tunables/xdg-user-dirs.d
* debian/apparmor.postinst: create xdg-user-dirs.d
* debian/apparmor.postrm: remove xdg-user-dirs.d
* Remaining patches:
  - 0001-add-chromium-browser.patch
  - 0002-add-debian-integration-to-lighttpd.patch
  - 0003-ubuntu-manpage-updates.patch
  - 0004-libapparmor-layout-deb.patch (renamed from 0008)
  - 0005-libapparmor-mention-dbus-method-in-getcon-man.patch (renamed from
    0068)
  - 0006-etc-writable.patch (renamed from 0070)
  - 0007-aa-utils_are_bilingual.patch (renamed from 0077)
  - 0008-remove-ptrace.patch
  - 0009-convert-to-rules.patch
  - 0010-list-fns.patch
  - 0011-parse-mode.patch
  - 0012-add-decimal-interp.patch
  - 0013-policy_mediates.patch
  - 0014-fix-failpath.patch
  - 0015-feature_file.patch
  - 0016-fix-network.patch
  - 0017-aare-to-class.patch
  - 0018-add-mediation-unix.patch
  - 0019-parser_version.patch
  - 0020-caching.patch
  - 0021-label-class.patch
  - 0022-signal.patch
  - 0023-fix-lexer-debug.patch
  - 0024-ptrace.patch
  - 0025-use-diff-encode.patch
  - 0026-fix-serialize.patch
  - 0027-fix-af.patch
  - 0028-opt_arg.patch
  - 0029-tests-cond-dbus.patch
  - 0030-tests.diff
* Move manpages from libapparmor1 to libapparmor-dev
  - debian/libapparmor-dev.manpages: install aa_change_hat.2,
    aa_change_profile.2, aa_find_mountpoint.2, aa_getcon.2
  - debian/control: libapparmor-dev Replaces: and Breaks: libapparmor1
* Move /usr/lib/python3/dist-packages/apparmor/__init__.py from
  apparmor-easyprof to python3-apparmor
  - debian/control: python3-apparmor Breaks: apparmor-easyprof
  - debian/apparmor-easyprof.install: remove
    usr/lib/python*.*/site-packages/apparmor*
* New profiles and abstractions:
  - debian/apparmor.install: tunables/dovecot, tunables/kernelvars,
    tunables/xdg-user-dirs, tunables/xdg-user-dirs.d
* Test merge from upstream new pyutils branch (rev 2385)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: libapparmor: Make aa_getpeercon_raw() similar to
2
 
 aa_getprocattr_raw()
3
 
 .
4
 
 The parameter names are slightly different in the two functions. Rename
5
 
 buffer to buf and rename size to len to make the two function prototypes
6
 
 look similar.
7
 
 .
8
 
 Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
9
 
 Acked-by: Seth Arnold <seth.arnold@canonical.com>
10
 
Origin: commit, revision id: tyhicks@canonical.com-20130625225508-00ax5w3r1aa22c3e
11
 
Author: Tyler Hicks <tyhicks@canonical.com>
12
 
Last-Update: 2013-06-25
13
 
X-Bzr-Revision-Id: tyhicks@canonical.com-20130625225508-00ax5w3r1aa22c3e
14
 
 
15
 
=== modified file 'libraries/libapparmor/src/apparmor.h'
16
 
--- old/libraries/libapparmor/src/apparmor.h    2013-06-25 22:54:17 +0000
17
 
+++ new/libraries/libapparmor/src/apparmor.h    2013-06-25 22:55:08 +0000
18
 
@@ -48,7 +48,7 @@
19
 
 extern int aa_getprocattr(pid_t tid, const char *attr, char **buf, char **mode);
20
 
 extern int aa_gettaskcon(pid_t target, char **con, char **mode);
21
 
 extern int aa_getcon(char **con, char **mode);
22
 
-extern int aa_getpeercon_raw(int fd, char *buffer, int *size, char **mode);
23
 
+extern int aa_getpeercon_raw(int fd, char *buf, int *len, char **mode);
24
 
 extern int aa_getpeercon(int fd, char **con, char **mode);
25
 
 
26
 
 #define __macroarg_counter(Y...) __macroarg_count1 ( , ##Y)
27
 
 
28
 
=== modified file 'libraries/libapparmor/src/kernel_interface.c'
29
 
--- old/libraries/libapparmor/src/kernel_interface.c    2013-06-25 22:54:17 +0000
30
 
+++ new/libraries/libapparmor/src/kernel_interface.c    2013-06-25 22:55:08 +0000
31
 
@@ -561,35 +561,35 @@
32
 
 /**
33
 
  * aa_getpeercon_raw - get the confinement of the socket's peer (other end)
34
 
  * @fd: socket to get peer confinement for
35
 
- * @con: pointer to buffer to store confinement string
36
 
- * @size: initially contains size of the buffer, returns size of data read
37
 
+ * @buf: buffer to store the result in
38
 
+ * @len: initially contains size of the buffer, returns size of data read
39
 
  * @mode: if set will point to mode string within buffer if it is present
40
 
  *
41
 
  * Returns: length of confinement data including null termination or -1 on error
42
 
- *          if errno == ERANGE then @size will hold the size needed
43
 
+ *          if errno == ERANGE then @len will hold the size needed
44
 
  */
45
 
-int aa_getpeercon_raw(int fd, char *buffer, int *size, char **mode)
46
 
+int aa_getpeercon_raw(int fd, char *buf, int *len, char **mode)
47
 
 {
48
 
-       socklen_t optlen = *size;
49
 
+       socklen_t optlen = *len;
50
 
        char *mode_str;
51
 
        int rc;
52
 
 
53
 
-       if (optlen <= 0 || buffer == NULL) {
54
 
+       if (optlen <= 0 || buf == NULL) {
55
 
                errno = EINVAL;
56
 
                return -1;
57
 
        }
58
 
 
59
 
-       rc = getsockopt(fd, SOL_SOCKET, SO_PEERSEC, buffer, &optlen);
60
 
+       rc = getsockopt(fd, SOL_SOCKET, SO_PEERSEC, buf, &optlen);
61
 
        if (rc == -1 || optlen <= 0)
62
 
                goto out;
63
 
 
64
 
        /* check for null termination */
65
 
-       if (buffer[optlen - 1] != 0) {
66
 
-               if (optlen < *size) {
67
 
-                       buffer[optlen] = 0;
68
 
+       if (buf[optlen - 1] != 0) {
69
 
+               if (optlen < *len) {
70
 
+                       buf[optlen] = 0;
71
 
                        optlen++;
72
 
                } else {
73
 
-                       /* buffer needs to be bigger by 1 */
74
 
+                       /* buf needs to be bigger by 1 */
75
 
                        rc = -1;
76
 
                        errno = ERANGE;
77
 
                        optlen++;
78
 
@@ -597,13 +597,13 @@
79
 
                }
80
 
        }
81
 
 
82
 
-       mode_str = parse_confinement_mode(buffer, optlen);
83
 
+       mode_str = parse_confinement_mode(buf, optlen);
84
 
        if (mode)
85
 
                *mode = mode_str;
86
 
 
87
 
        rc = optlen;
88
 
 out:
89
 
-       *size = optlen;
90
 
+       *len = optlen;
91
 
        return rc;
92
 
 }
93
 
 
94
 
 
95
 
=== modified file 'libraries/libapparmor/swig/SWIG/libapparmor.i'
96
 
--- old/libraries/libapparmor/swig/SWIG/libapparmor.i   2013-06-25 22:54:17 +0000
97
 
+++ new/libraries/libapparmor/swig/SWIG/libapparmor.i   2013-06-25 22:55:08 +0000
98
 
@@ -25,5 +25,5 @@
99
 
 extern int aa_getprocattr(pid_t tid, const char *attr, char **buf, char **mode);
100
 
 extern int aa_gettaskcon(pid_t target, char **con, char **mode);
101
 
 extern int aa_getcon(char **con, char **mode);
102
 
-extern int aa_getpeercon_raw(int fd, char *buffer, int *size, char **mode);
103
 
+extern int aa_getpeercon_raw(int fd, char *buf, int *len, char **mode);
104
 
 extern int aa_getpeercon(int fd, char **con, char **mode);
105