From patchwork Mon Mar 18 14:44:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?q?Krzysztof=20Micho=C5=84ski?= X-Patchwork-Id: 1057898 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::340; helo=mail-wm1-x340.google.com; envelope-from=swupdate+bncbdc4bxh6saorbag6x3sakgqeo3k7ewq@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="koamGSTf"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CBik7uzb"; dkim-atps=neutral Received: from mail-wm1-x340.google.com (mail-wm1-x340.google.com [IPv6:2a00:1450:4864:20::340]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44NJrP4RLsz9s6w for ; Tue, 19 Mar 2019 01:45:24 +1100 (AEDT) Received: by mail-wm1-x340.google.com with SMTP id u194sf1073212wmf.6 for ; Mon, 18 Mar 2019 07:45:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1552920321; cv=pass; d=google.com; s=arc-20160816; b=xiiN97+exnxzmrIndzj19kLJDaUHoM+5x2M0K8RlID8uXnFIFe7xqF7/bNJF+mlpvS o0cj+vv4A5EOBSFbFRq1QLiGrl32BzdOk+qneccHEgRR/AylZqSrnUV83BRGpxQ7jBgs p7QvnESgOJQ5O/sUWrh6ZI09Na4tMyecRjYZZUBGWgLeZMOEDGntgEk97WEmZLcSQgxU TzcLXGJTx+bHVm4KOnT97lI5okW9jeYI71Au6u8/WyWpe6ui2ypldbXiGhqi20pOxj1A iYwvr+lS1593P4zcjU28Ghshjv9Rl1mmI7Eck7gHDWpCS9+HjZwSVXK6fx9UK2YaARLh QxMQ== 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:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:sender :dkim-signature:dkim-signature; bh=I2LHNBQAwTkxP84G48rmEsfLFOvwCbnIq46Gu8BBwdM=; b=N+wFqi7mIio5c3KQZXqmJn+1K+UcCpjY+9ft2Hpr/CXcFYlr6ErLeCBE628quboJAO 6Ma6xEOVzSb6kqeO816fvDVD/PvCF14hgNVadhSQk7tX6n9Q6lSdnVIefpBa2njejy6K EBySp50KdCcDtU7ItDSbs3JuUsN0x1fgZmbp0SpuLMM8AdQAvoPWKVQQ9C0VSgo5w4sE bITMzMNpsZgozs3Fo06APxa5Z4ki1QFUrAKRYwJl1akW8siQqojEp6Qb2ndfvcrSFV6m f/+3yzAkb0rWHB6tS6/1cv4LC/e38PMoMfgwlix+N0gtXM41Z5zTyLEWvgeoBmgr3rgY 9U5A== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hyZmmDOF; spf=pass (google.com: domain of michonskikrzysztof@gmail.com designates 2a00:1450:4864:20::244 as permitted sender) smtp.mailfrom=michonskikrzysztof@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=I2LHNBQAwTkxP84G48rmEsfLFOvwCbnIq46Gu8BBwdM=; b=koamGSTfLHoz+L4FZ6/tGhiP+Z8DT7NUJBwvYQB0KzYX7eEvq+wEIOFdivutLirvBV TfC77JnMdGSnqVLN2kSwqBK9hB8cLrSUI7cWAhrhCrU4jsFIMG0Sf8xmGbjFSzTcwy8q ONkThvuysaJ9qvq+HxpbWM2GkASyFUI4jtZCTaR52bQzdS4EN0E2aQYRgD8toJRf7Ok+ WpND7cYamdJLhnYXSJ+v7BuR+khaKVA9hYwB0dILc3LM9ArgMhWza7pfp6tdj0y4xRFj O9vN1dEDtB1OqaGtPhtdREqi+tnQN26VLVVQdFjJTg60/5QOD+r0eXorErdangsKK0jE fOdQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=I2LHNBQAwTkxP84G48rmEsfLFOvwCbnIq46Gu8BBwdM=; b=CBik7uzbHkd9dCCcuvrNp5L6A1Cvv81YgrzFepL1mXCWxia85lPMwsIA0sOC6HKBfG f1DT8BqNPrTJTrHdyPKTLZBbO1JWLICofHPEr7/n9q40F9hmb6a7mrU+xCjQCaktL+Rl 4IOF4xmCkywcwOoOl3IxGYd4RwVKZ15ub4nMpucITCGj9sDmKET3ts6tRm47Ei8PMbQF /DlinXJmepkTDAJZfg6bCdOcWAKa43BRZOHN1Kcq/POqDf/9JwI0tiVBR0OqsYqmX1q2 ieOtCfuOt0zSfzUKsHbCx2eSxa/7lY8jNFNuDIkYWADT+wtC/ER4LONcbwZqbFPqVxvf WzjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=I2LHNBQAwTkxP84G48rmEsfLFOvwCbnIq46Gu8BBwdM=; b=Cbqfeimj4RlD5lttBn2zOMW8l0ZZwtg5G/7CqD/s/UTO3+5yJqme9zYvIC7pK8pWlO K8lAWT9r0O+M/7g2DdHpcHLzKMCPSxhq01KJjv0PFKEWcTtvjCLj2E+WV+Y8sqpYT9jG DlrIdAxOnHvnU7C0Q5I4pyhDgJtSYmrcZYKxlHb0EwlNnc/C2ttpjvnWFe9HoC/jjBQn IgVIDYENKiEEQbMQ6C32XNFvIheiU6IlYoLUxZe/6tsbMNVyTFT/EKBXuSKLmvoZ4shl epmAgTb52S1Lzhd2Qjaw4LbaU9uFgEiYDbSxqJkQDevtVNluhHsch/fFnR4WJI9LCNs4 OiQQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAVD3UhEmb3hrZd/Fa4PThewJ82pPygbibJhZRj8pX0PA3kMr4wj ZYjtJWX1F60sXsxqMyHTxws= X-Google-Smtp-Source: APXvYqx12n9RMdCDmIoITg/KqeDw53t6YH/zy+iKknmmqpXrhrIPIeChaUyHDzNDSjwfT6fiA//Ssw== X-Received: by 2002:adf:8213:: with SMTP id 19mr12266801wrb.155.1552920320824; Mon, 18 Mar 2019 07:45:20 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:adf:e2d1:: with SMTP id d17ls909848wrj.8.gmail; Mon, 18 Mar 2019 07:45:20 -0700 (PDT) X-Received: by 2002:adf:f011:: with SMTP id j17mr294256wro.8.1552920320333; Mon, 18 Mar 2019 07:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552920320; cv=none; d=google.com; s=arc-20160816; b=Kw1XXVRzf7Q7p7zhV8U5T+wHSoOKJHz4mmsbSl+aUAIUQlbbrsaUtI6Ojlwhoxzm5C VBl329f1+ALm1LxnN7VrEsZkDLHNXTLwKz5WErAmQBwKU22NaFoD4kEhho2WgjyVuHw0 FF3ztg5ecRL7ABoyx26TCOG517yP4O+sISodXzegtylqbSQeggosuECd4i65ZyKpAo67 oEIIpiTfTgUwTUFNRjNZ2+wqc2nZhmCDISVjt5oMpClM8jr3aeLgJb88iU3Xf22ZQvCw QU0bJfSuaSLYot7vKihzSlZHDZVz/BHLTNyJrx+oCl5hbQXXcdT7QbhEoLyh9sxWiBqz mMYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=Mo3FUNPBrjIKFbwZBqq97jo6d47Cd9CGerx2bXfgrhk=; b=f72Q1y7NLdevaOt15Cs4tX73TnsFneELawUeDdajVJnz38YCK/4oZdC5uXXf1+ssWF E9OrxMkqrEvH5bE8k3eq3zUfoTdH+qFS3SYkHvhVsgR71zQb0z9kpxp7rEn0rywPmVaV Gzq/mI7Y8+hy3VvQbTXEdpTLCQbmZlBd9gDUOBzsQyYcLcBQz1s4o4ldfF5pz60Br9e9 cAd6FtsvA7anoUvsvFGFtj4kIOWVphfFXrRHkko6bgR80jwi0omfoRkqDv5F+nGUu4Ih ujUPQjwllJEd2bnsJhy6G6penDS3G7Uuhmv8J2dKfREXHubokhNL1o5f60jv+0i/tSnD axqQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hyZmmDOF; spf=pass (google.com: domain of michonskikrzysztof@gmail.com designates 2a00:1450:4864:20::244 as permitted sender) smtp.mailfrom=michonskikrzysztof@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com. [2a00:1450:4864:20::244]) by gmr-mx.google.com with ESMTPS id f185si476155wme.1.2019.03.18.07.45.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 07:45:20 -0700 (PDT) Received-SPF: pass (google.com: domain of michonskikrzysztof@gmail.com designates 2a00:1450:4864:20::244 as permitted sender) client-ip=2a00:1450:4864:20::244; Received: by mail-lj1-x244.google.com with SMTP id p20so1440261lji.10 for ; Mon, 18 Mar 2019 07:45:20 -0700 (PDT) X-Received: by 2002:a2e:934a:: with SMTP id m10mr10712484ljh.164.1552920319849; Mon, 18 Mar 2019 07:45:19 -0700 (PDT) Received: from localhost.localdomain ([217.153.215.58]) by smtp.gmail.com with ESMTPSA id g24sm2145379lja.75.2019.03.18.07.45.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Mar 2019 07:45:18 -0700 (PDT) From: "=?UTF-8?q?Krzysztof=20Micho=C5=84ski?=" To: swupdate@googlegroups.com Cc: afenkart@gmail.com, Krzysztof Michonski Subject: [swupdate] [PATCH 1/1] Increase filename length where it's too small Date: Mon, 18 Mar 2019 15:44:47 +0100 Message-Id: <20190318144447.29215-1-krzysztof.michonski@digitalstrom.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Original-Sender: michonskikrzysztof@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hyZmmDOF; spf=pass (google.com: domain of michonskikrzysztof@gmail.com designates 2a00:1450:4864:20::244 as permitted sender) smtp.mailfrom=michonskikrzysztof@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , From: Krzysztof Michonski Most of filename size limitations were unified and unlike in version 2018.03 we should be able to use files with filenames longer than 64 bytes, this patch increases the filename size in places still dependant on the older filename size. The filename + tmpdir can easily exceed 64 bytes size limit. Today most of size limitations as in for example install handlers are unified (for example fully dropped for flash handler: fa6fa9d3), this patch unifies this limitations even more. We need this because we usually deal with filenames with size of around ~100 chars. Signed-off-by: Krzysztof MichoĊ„ski Acked-by: Stefano Babic --- core/cpio_utils.c | 2 +- handlers/boot_handler.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/cpio_utils.c b/core/cpio_utils.c index 143474b..a464108 100644 --- a/core/cpio_utils.c +++ b/core/cpio_utils.c @@ -540,7 +540,7 @@ int extract_sw_description(int fd, const char *descfile, off_t *offs) { struct filehdr fdh; unsigned long offset = *offs; - char output_file[64]; + char output_file[MAX_IMAGE_FNAME]; uint32_t checksum; int fdout; const char* TMPDIR = get_tmpdir(); diff --git a/handlers/boot_handler.c b/handlers/boot_handler.c index 2a1b61a..4af8bda 100644 --- a/handlers/boot_handler.c +++ b/handlers/boot_handler.c @@ -30,7 +30,7 @@ static int install_boot_environment(struct img_type *img, int fdout; FILE *fp; char *buf; - char filename[64]; + char filename[MAX_IMAGE_FNAME]; struct stat statbuf; if (snprintf(filename, sizeof(filename), "%s%s", get_tmpdirscripts(),