chiark / gitweb /
sd-bus: use proper cleanup macro
[elogind.git] / src / libelogind / sd-bus / bus-message.c
index 6ee209dd1be88d81dc6a2ff943d43028e4420536..983e2f62cddce00a9ebd41bce7bc0fd0f79d1246 100644 (file)
@@ -435,7 +435,6 @@ int bus_message_from_header(
                 size_t message_size,
                 int *fds,
                 unsigned n_fds,
-                const struct ucred *ucred,
                 const char *label,
                 size_t extra,
                 sd_bus_message **ret) {
@@ -528,23 +527,6 @@ int bus_message_from_header(
         m->fds = fds;
         m->n_fds = n_fds;
 
-        if (ucred) {
-                m->creds.pid = ucred->pid;
-                m->creds.euid = ucred->uid;
-                m->creds.egid = ucred->gid;
-
-                /* Due to namespace translations some data might be
-                 * missing from this ucred record. */
-                if (m->creds.pid > 0)
-                        m->creds.mask |= SD_BUS_CREDS_PID;
-
-                if (m->creds.euid != UID_INVALID)
-                        m->creds.mask |= SD_BUS_CREDS_EUID;
-
-                if (m->creds.egid != GID_INVALID)
-                        m->creds.mask |= SD_BUS_CREDS_EGID;
-        }
-
         if (label) {
                 m->creds.label = (char*) m + ALIGN(sizeof(sd_bus_message)) + ALIGN(extra);
                 memcpy(m->creds.label, label, label_sz + 1);
@@ -565,7 +547,6 @@ int bus_message_from_malloc(
                 size_t length,
                 int *fds,
                 unsigned n_fds,
-                const struct ucred *ucred,
                 const char *label,
                 sd_bus_message **ret) {
 
@@ -579,7 +560,7 @@ int bus_message_from_malloc(
                         buffer, length,
                         length,
                         fds, n_fds,
-                        ucred, label,
+                        label,
                         0, &m);
         if (r < 0)
                 return r;
@@ -822,7 +803,7 @@ _public_ int sd_bus_message_new_method_errorf(
                 const char *format,
                 ...) {
 
-        _cleanup_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+        _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         va_list ap;
 
         assert_return(name, -EINVAL);
@@ -841,7 +822,7 @@ _public_ int sd_bus_message_new_method_errno(
                 int error,
                 const sd_bus_error *p) {
 
-        _cleanup_free_ sd_bus_error berror = SD_BUS_ERROR_NULL;
+        _cleanup_bus_error_free_ sd_bus_error berror = SD_BUS_ERROR_NULL;
 
         if (sd_bus_error_is_set(p))
                 return sd_bus_message_new_method_error(call, m, p);
@@ -858,7 +839,7 @@ _public_ int sd_bus_message_new_method_errnof(
                 const char *format,
                 ...) {
 
-        _cleanup_free_ sd_bus_error berror = SD_BUS_ERROR_NULL;
+        _cleanup_bus_error_free_ sd_bus_error berror = SD_BUS_ERROR_NULL;
         va_list ap;
 
         va_start(ap, format);