Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1477264rwd; Thu, 1 Jun 2023 16:43:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7U8DnhuEY8H6NCc3jgMB7TFfUKXTdx12xJ6wU8uasdUJFt1RUKUtam5mZ9Oa18xB4I/C0f X-Received: by 2002:ac8:5709:0:b0:3f6:bcda:e77 with SMTP id 9-20020ac85709000000b003f6bcda0e77mr14567616qtw.55.1685663035348; Thu, 01 Jun 2023 16:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685663035; cv=none; d=google.com; s=arc-20160816; b=HExsK71SqBU7XPxlQplSxR6SazUM3R0pS+CNe1E/dKcEUtPAoxTRMn2PvHaMhgeEE+ ipkxSXmd/wKpCRJA9gIlagK4bPUr7mem9PDOTjozZoM/hZh+zkPD1yebo6f4i/ZPPFjK In0JOB2dCIUJLn30VVtC7GnnTeSbc6gWerKgEzlkGdSjJNPcL9VrNGCU4c55FeWNSXsg 32PTAsBBl1o+Jbdfq0GtSkwbNrHbqyTRbZ0YpZvmjRgtWudvuhhd6j135IT5Nw3N1vMe zaXMK0BJPoKPQSDA03NFsaz4SqhGKpy/8fTSGdg8YEZ+gkGzGG2hogJd5ubMDr0szGi5 ovvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=y0c4SjY8Vrb88l5DL8d5i62OqpQ8IbLKYgBK1H7pEeU=; b=tOPz0ACThbgA6PMk6DSORTn7L01obG1OfJ6qJCYQ8mVBcFa+JTA7nQPSw2kbme8Zey Y+/kx35dxkyytOYLcElAiTV7exjaMQzRTp7TGM1dvomKqAEaUSFkUzxhovXC8rKu73n7 OzvEnleuaDA6UVP9K0ybJk+qgR+4HWcDqLJtqVB3hv62XFLJ6EXel7vuOp2DsCaJQvIE 8dfDJ0oQX1WNYSA88h6gZhECorSdHegWAn2WXIykeHoB6V/Ug/hLgl6ZUffrAlhelBNQ tUQDabWrOVI6Fz74CADojgG1IoDR8EtzDjfd3mfnSuI40G7Q8b8H8HsX4vFaC8fLA6GU NSNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=McQImibN; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d26-20020a63735a000000b005030925d31asi15937pgn.203.2023.06.01.16.43.40; Thu, 01 Jun 2023 16:43:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=McQImibN; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232250AbjFAXdZ (ORCPT + 99 others); Thu, 1 Jun 2023 19:33:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232674AbjFAXdW (ORCPT ); Thu, 1 Jun 2023 19:33:22 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21EEB189 for ; Thu, 1 Jun 2023 16:33:20 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1b010338d82so8574565ad.0 for ; Thu, 01 Jun 2023 16:33:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685662399; x=1688254399; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=y0c4SjY8Vrb88l5DL8d5i62OqpQ8IbLKYgBK1H7pEeU=; b=McQImibNKacStuD/heEryN4927kYnI7uHPnEjaIyJUxw/UC8uDjO7H4j2K+GYjUSrL r8MGKZrhEkC29dY89R3Ukt8aqMVisnEVoeB4n/zueF/EbFnYF1Aor+s7Jo3QgQvIAolf O1zf15IOPuT315S+u1+C521SfzMNgRsIcxVYpYM/7Cb9mIACWHLuS5nKUHBCsA8pN5/O Jacek6mtnHr8Z1LYflvouX6lezYwKcuTeuwb2MDcsrtzYrG90QRLHL9SB1hOe60CVUwt 4RwoXUUXsJojUM7D4hcabl8BsUZ2upTn8y4TWSKJ25XLXzeygnExyeTpgbZpunq7SO45 2nOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685662399; x=1688254399; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y0c4SjY8Vrb88l5DL8d5i62OqpQ8IbLKYgBK1H7pEeU=; b=l0W3X9+eQSOO4FHPTQj6veTfHNZU7D3EXL9sFLXCG4Gdj/Zd0X6YpAY9XjC5vvqkGy sxTU8N8dBKZnwxWzZURAf62CORqJNZqMQWsA3LnHPbj5kgvQcvMkzzFNeQxbOW3vCQ6q 08dPg+pPLDdVJtbqFsdP0cDDPNGLNEbTv5c6F2WkGOPSF7TYLOtnrmVY5JHzFYwA8NKw vcPTDecnMoGoAb2lvIkTlDe5mYE5C5giyr3SUzZN6Cc0qCWWKuyTBzwOXOxPH+TD8mvg lYoyVG5pkOgiYfpVBrdXKIa49urcwjuDO8cOZq8lwOK+oBtWubUGIRL5H9eQ5PH0V1y0 IWLg== X-Gm-Message-State: AC+VfDx6RFipLos8m+rp+5WijFcPzHSzF3DuFZXQWTYcbaxHwMSxJU7d hVzQav8t9zVS9F21CZ/vbW8xScPhrSs= X-Received: by 2002:a17:903:11d1:b0:1ac:b363:83a6 with SMTP id q17-20020a17090311d100b001acb36383a6mr782876plh.17.1685662398720; Thu, 01 Jun 2023 16:33:18 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-59-129-171.hsd1.or.comcast.net. [71.59.129.171]) by smtp.gmail.com with ESMTPSA id s7-20020a170902a50700b001ab0b2dad2fsm4051420plq.211.2023.06.01.16.33.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 16:33:18 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 1/2] monitor: Only print credentials if PID is set Date: Thu, 1 Jun 2023 16:33:16 -0700 Message-Id: <20230601233317.1419030-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz If PID is not set don't print anything since this is likely a packet originated by the kernel itself. --- monitor/packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/packet.c b/monitor/packet.c index 946ceb2c640d..6d73e5abfcbc 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -438,7 +438,7 @@ static void print_packet(struct timeval *tv, struct ucred *cred, char ident, pos += n; } - if (cred) { + if (cred && cred->pid) { cred_pid(cred, pid_str, sizeof(pid_str)); n = sprintf(line + pos, "%s: %c %s", pid_str, ident, label ? label : ""); -- 2.40.1