Message ID | 20240415101906.45782-2-stefano.babic@swupdate.org |
---|---|
State | Accepted |
Delegated to: | Stefano Babic |
Headers | show
Return-Path: <swupdate+bncBCBOLPPCVAMRBH766OYAMGQE72P7NVY@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=rm+HvpSx; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::53d; helo=mail-ed1-x53d.google.com; envelope-from=swupdate+bncbcbolppcvamrbh766oyamgqe72p7nvy@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-ed1-x53d.google.com (mail-ed1-x53d.google.com [IPv6:2a00:1450:4864:20::53d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VJ37X6Nj7z1yY4 for <incoming@patchwork.ozlabs.org>; Mon, 15 Apr 2024 20:19:36 +1000 (AEST) Received: by mail-ed1-x53d.google.com with SMTP id 4fb4d7f45d1cf-56e353671f7sf621458a12.1 for <incoming@patchwork.ozlabs.org>; Mon, 15 Apr 2024 03:19:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713176373; cv=pass; d=google.com; s=arc-20160816; b=AD6NSHCN0iwR47N8sCXhdliC1kBit5Gi6Q7u6EDR0rHyl1+n6KeefJ/e0cek0vSeIT 2opYpApBaee/GrJcGV623G2NGXRBiL0E2cDBUtrZREBI0HaVtGSirfGvX3TcToG1GBvl glg8Kk9ftIcnIv9f6qrZKKuNza2mQYhvHmdqFRRd709zUmYoyHEKA/vpHoagqH9a7mVi WL29ekjAXejGniBVgbkD6j5EqkkRXpcOvmYgDfwRFt+b7nngEzBRPy/PPCGOcsnVzkg/ 9RR9rYnRDMirEIfhXNcYM7S9McuLTIR1Ic5OW5T9mROBX7DGqCnoKAmtVnNw4IJEHAtF eGSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:ui-outboundreport:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=7MlafbKwJ8kUAldWI7YhGdCm5yjek4VmsB8krEuOEtk=; fh=zjZj+VImD0rE57AkWEN4/svl+83lyUWdH6zfRPKiL4k=; b=qLWo+gTFizC97w2Y0LMW9/UYKlL23EZC6YpbWTLid7tVwlB1rJMVYo4a5spa6pFwI6 hnDfkHKvrwPAkawlqAdTrVS6Df9E50nwG+GBr9E7hV5tpyZ++5bUkgB+pYz7zRzBvEN9 dK4vqK8gqUMsjBFl9wAh75Aj4FmYP2/uPm2n5N3n1nLSxpi3QX1SpNQB5XmkEx7Agh5a F84NmQWcSq+No8AxEkXEjyVsZkQ/r2mq2wNk1l+mQNgXuVMHKK45fZSvzRrQjCN2smhM cvEoLm9gQ+3dk1VZ9ONTRbFZhI1ihqJPHLm6g4hZNxfA79HbWxcTqYkKYcfGjEZ5eu2A qd2g==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=FTs9EE9A; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1713176373; x=1713781173; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:ui-outboundreport:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=7MlafbKwJ8kUAldWI7YhGdCm5yjek4VmsB8krEuOEtk=; b=rm+HvpSxlZNqJd1MxLFmJia9oOpX59IHMd3TZ4LTlcdKM079OM+wa31RUgXOKs2ycM v305fXb6HxljlYyxY025fnyaEBLEdCIlYVOM9NDs9R2v/ONrho0q+ozwcDjCb4LUnnso ysJd7DGx7oNkJ/s2KX1PSClLwGvrkuCQwWBZwgM9i/HABFzd2UF8LIiM8n6vkIkJ1YEW PBlXSRFvk4lW+p7Pv5/t46pZIX34/NJXAckKgQn7wPj7IvndBa5dlEBtmF/LUge+HWrU L+AeyqJ95x7FzKaGBF7k6CnA9X00RXHjKQXs6e/KeHTpCOzIhpJWocrvL9gQB6Ruyo/3 k+mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713176373; x=1713781173; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :ui-outboundreport:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=7MlafbKwJ8kUAldWI7YhGdCm5yjek4VmsB8krEuOEtk=; b=dLM2+UbQowwkDneUx1A6rZyXvZkBVe+vj3lwwVtGiwKx4GvzNOCvE52VB5KVf9iLGg keQ156e/cBt03rN9yRP+1GIOSsLrsyPTf0KaxYHF2bwi6RHg6ZzbrAcoKkFewFvIFC+G tjR7GjpsaYDiC5BNAV8LQ+giUwFaXKC2WKrlouiL0hnzVN6LiEXFQ22OLKTvj8gBuE/u T0nnxTdzLknQjnppKOvsxyDlFoP94TZEAV9A50vLVyiGmmWGNLjHUrCbMVHX3ITUreJV 1s3sQII//XdWOXyZYZI8uAT2EEp1pDNRRpVFHVAyDDvf878Ja1Ho42eTcHkn4zFvvmb/ 3rqw== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCUoF/6L7AnifNp+mHif249R3Q5hpbe+F6xFOF/cnnlqVmy8GqTO8jSi7EWAAuyo+f+rP37Hb5SiUo4X/CCdaBC/ONLh/O2k8KptmMWA3w== X-Gm-Message-State: AOJu0YyNc2gVsf5uHe+IeG/5jGRH1v1umUxnI8f5ORLuPz3cqz2p2RaL IM+Hr8hDvZ1qFSu3WtFekU+EQi4ro78eo7K3BDfhaK/py3YNKEsb X-Google-Smtp-Source: AGHT+IGC1iNg04flfIHf9Af/MnoOc1vpeCk8atBmnPzTwnOyZMSHf1ZXDKV8cxw3upZywoyX6NGLlA== X-Received: by 2002:a2e:9853:0:b0:2da:9ccd:84f1 with SMTP id e19-20020a2e9853000000b002da9ccd84f1mr489894ljj.2.1713176352497; Mon, 15 Apr 2024 03:19:12 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:a4c1:0:b0:2d8:3dd7:a9bf with SMTP id p1-20020a2ea4c1000000b002d83dd7a9bfls962020ljm.2.-pod-prod-07-eu; Mon, 15 Apr 2024 03:19:10 -0700 (PDT) X-Received: by 2002:a2e:6e12:0:b0:2d8:3eaf:86d2 with SMTP id j18-20020a2e6e12000000b002d83eaf86d2mr5867272ljc.47.1713176350049; Mon, 15 Apr 2024 03:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713176350; cv=none; d=google.com; s=arc-20160816; b=Qpv9zExXt3taNMnZBEzbn8oxeRD3pRvnAcbRVd1ZL8/WIzS2f5xtBPvtWtXQLfbfZh ZEO4KaMBk0R+VnAf1fc/wkhRzcWPeXMOR7/y1SN7jMmRndrEfVSiWiLpS+xxjToakLTb BW/oRqV3ezVdjZcVTivuexUTAJbm+UWMxZLfmpd8dj0uK77QAAbCEgGGR0PKbJR8+fW9 3aywwnG3Y7gXLo5UOfsDt1w+grWYTuwcduoNT299iu9casdeKS/kKvjvcf45+w4xjDDF rzlxniFlwvj2U5kd0ukefC67kGKzF0w8grF1onoxOWOR5ZlVUy1hogsHNY4JTJFtY2Mp 5x8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=ln8Mu8iCiOcfsV00WQl8eVk7doqgPOpofRoXIVX5zV4=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=eL9ZMLwm9DqCfszZ3Tx3hNiLvjdk5VC176AbeCtVoYSI60UoQiwb9LX215IRTd4JQQ UD6xxlMyfAFIkbo41J2isyABzuzlttv8Rbq0N5FK09a//GFKombQ8M3XGTWtxWGtGkZZ XdXp9Y9OmDUw33SsFvOjFxDUmRwr2IEXfanO7SOaRh6g/d/lNzmey8F9yF0RctqSWP/9 FRdDVaeMQgSegtB5TFf3n+psQtk3yVqD+gp+OrsDOk24Ki7tl8KZzXEuCtzUqTBEtPGH EXV5EPAsF1zlwwUWPlmZTopAeqd8BA0Ct2pxH5kyqAGvrId++jzdxyuIL/hoZ17JsNKF 8kRg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=FTs9EE9A; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.17.10]) by gmr-mx.google.com with ESMTPS id k19-20020a2e9213000000b002d83db42d33si272207ljg.6.2024.04.15.03.19.09 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 03:19:09 -0700 (PDT) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) client-ip=212.227.17.10; X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue106 [213.165.67.113]) with ESMTPSA (Nemesis) id 1Mna0x-1sdJ9t3inl-00jcdZ; Mon, 15 Apr 2024 12:19:08 +0200 From: Stefano Babic <stefano.babic@swupdate.org> To: swupdate@googlegroups.com Cc: Stefano Babic <stefano.babic@swupdate.org> Subject: [swupdate] [PATCH 2/3] hawkbit: check for validity of action_id Date: Mon, 15 Apr 2024 12:19:05 +0200 Message-Id: <20240415101906.45782-2-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415101906.45782-1-stefano.babic@swupdate.org> References: <20240415101906.45782-1-stefano.babic@swupdate.org> MIME-Version: 1.0 X-Provags-ID: V03:K1:SjZN1ZVbAC97sSTGn3YbPtiF6H0RNm21yQwHYfcBvxrqczaAIA3 sO8tJwIFhOGePzUlTer9aowZleAmoIsXbzpAiVM8eD2yhJ5vB6JyF2a8tueHUYbYPpEWT+i ZgfGba5DlbeqPpA5dQKZy3TUBnhfvtjqj/QNJPdWJHC5AnzLkWwpDphYZ8zqrI9hz3od375 977hGa9UZneum+UGSwGRQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:wPD23/EhON8=;kPvhLZH7lOwDKdE+6YuiOJ4LLp1 28F3GfqjD/NK16My8KIFKiNabTsxqIjEUKlpHO2sUc8oAOOdXu7DvSSCVcPrl/7D1MtkJJo0K 0ACmVVVpWvzthoId7L5r0QpTd08nvK42PrprwF9JEElSZwg942daIxkJ5wNn9tbRQoXEUtmxu iCI1L4BNRimriAVPecRWSDyAsuFF0hERNy05gKr4oSSpxwAHqTjBlWT8H4RXEtzrds6telmFN bTyQfAqttq/jFVLQOjqEmnUfdUjOOKK/zx9tXMnqcZqPy0XKPcG+IUJIZ+hgZB84K/RaEWbsZ a2pnwXr1dkEv88xcWmFN7e0SLOTI8Rl0Tz/jNWwR8Zrg8jLXSJGnsUz+eqDF04PmiBNejBbxq ArYxV6RiYWJc/SL7Le2W0nGSVma9zdx+f9xIvpPbEFtD5VuXvj8TAv3/EwxPIKxcICAh/E7DD ybhBENfVngQ7X0L3yZGHay9ptrA5g3OSZJ0CYQfPytCgU1ZI/gDnBfjibvljLGeZcmULKrvw5 J2egVKldwD7aJVEzOZXd1FwUFvz2BMNoG/d6/ujR0pEv12RVKyo0XUVahtD4jlVjoetTlu/kU AwWT08nGU66MN7IrtkVECq+kt3rmXXMmFlNgRn2TbnUJy62QhBwN+5gZYEwpUSa6TpsymFAmo +G9fybT9ykJol/r214hFPi5eSEflwHJOGhVEjFiXEiwMx4OWAuAQjl8DfYtN7UIvVt/Q9VxpD hb2GJrpwJA6kLT0oaWE8s7EDDp1atKAt5IneqfkIW/HhGg81PsJH3s= X-Original-Sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=FTs9EE9A; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[1/3] BUG: hawkbit: check if details are sent via IPC
|
expand
|
diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c index f1948c68..5199eefe 100644 --- a/suricatta/server_hawkbit.c +++ b/suricatta/server_hawkbit.c @@ -867,6 +867,7 @@ static void get_action_id_from_env(int *action_id) * Get the acction_id that corresponds to the done update if it was * stored. */ + *action_id = -1; char *action_str = swupdate_vars_get("action_id", NULL); if (action_str) { int tmp = ustrtoull(action_str, NULL, 10); @@ -2023,11 +2024,12 @@ static server_op_res_t server_activation_ipc(ipc_message *msg) int action_id = -1; if (json_data) { action_id = json_object_get_int(json_data); - } else { + } + if (action_id <= 0) { /* 0 is not a valid action id */ get_action_id_from_env(&action_id); } - if (action_id < 0) { + if (action_id <= 0) { ERROR("No action_id passed into JSON message and no action:_id in env"); return SERVER_EERR; }
The "swupdate-ipc sendtohawkbit" tool allows to send a feedback to the Hawkbit server with external data. Commit d770ad59e introduces that SWUpdate can persistently store the action-id between runs, and this worked after a reboot when SWUpdate is started again. This patch introduces the same feature when IPC is used. The action-id in IPC can be set to 0 or -1 (invalid for Hawkbit), and SWUpdate will then check if a valid action_id is in the environment. Signed-off-by: Stefano Babic <stefano.babic@swupdate.org> --- suricatta/server_hawkbit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.34.1