core: fix owner user/group output in socket dump
authorLennart Poettering <lennart@poettering.net>
Thu, 5 May 2016 11:45:18 +0000 (13:45 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 5 May 2016 20:34:47 +0000 (22:34 +0200)
The unit file settings are called SocketUser= and SocketGroup= hence name these
fields that way in the "systemd-analyze dump" output too.

https://github.com/systemd/systemd/issues/3171#issuecomment-216216995

src/core/socket.c

index 4fc66af..016df40 100644 (file)
@@ -640,8 +640,8 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
 
         if (!isempty(s->user) || !isempty(s->group))
                 fprintf(f,
-                        "%sOwnerUser: %s\n"
-                        "%sOwnerGroup: %s\n",
+                        "%sSocketUser: %s\n"
+                        "%sSocketGroup: %s\n",
                         prefix, strna(s->user),
                         prefix, strna(s->group));
 
@@ -1291,11 +1291,13 @@ static int socket_open_fds(Socket *s) {
 
                         /* Apply the socket protocol */
                         switch(p->address.type) {
+
                         case SOCK_STREAM:
                         case SOCK_SEQPACKET:
                                 if (p->socket->socket_protocol == IPPROTO_SCTP)
                                         p->address.protocol = p->socket->socket_protocol;
                                 break;
+
                         case SOCK_DGRAM:
                                 if (p->socket->socket_protocol == IPPROTO_UDPLITE)
                                         p->address.protocol = p->socket->socket_protocol;
@@ -1359,8 +1361,7 @@ static int socket_open_fds(Socket *s) {
                         }
                         break;
 
-                case SOCKET_USB_FUNCTION:
-                {
+                case SOCKET_USB_FUNCTION: {
                         _cleanup_free_ char *ep = NULL;
 
                         ep = path_make_absolute("ep0", p->path);