All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] makedevs: don't restrict device node paths to 40 characters
@ 2016-09-12 20:14 Andre McCurdy
  2016-10-02 20:37 ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Andre McCurdy @ 2016-09-12 20:14 UTC (permalink / raw)
  To: openembedded-core

40 character paths work OK for device nodes in /dev but not for
device nodes created in a chroot, LXC container, etc.

Since the 'path' array is already a 4k buffer, the sscanf 40
character limit seems to be a typo or historical mis-merge. Update
the sscanf limit and bring the code in sync with the Buildroot
version:

  https://git.buildroot.net/buildroot/commit/?id=8876b6751e0bc19a3754290061808f0f8420708e

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
 meta/recipes-devtools/makedevs/makedevs/makedevs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/makedevs/makedevs/makedevs.c b/meta/recipes-devtools/makedevs/makedevs/makedevs.c
index 7471f3f..cba7681 100644
--- a/meta/recipes-devtools/makedevs/makedevs/makedevs.c
+++ b/meta/recipes-devtools/makedevs/makedevs/makedevs.c
@@ -360,7 +360,7 @@ static int interpret_table_entry(char *line)
 	unsigned long mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
 	unsigned long start = 0, increment = 1, count = 0;
 
-	if (0 > sscanf(line, "%40s %c %lo %40s %40s %lu %lu %lu %lu %lu", path,
+	if (0 > sscanf(line, "%4095s %c %lo %40s %40s %lu %lu %lu %lu %lu", path,
 		    &type, &mode, usr_buf, grp_buf, &major, &minor, &start,
 		    &increment, &count))
 	{
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] makedevs: don't restrict device node paths to 40 characters
  2016-09-12 20:14 [PATCH] makedevs: don't restrict device node paths to 40 characters Andre McCurdy
@ 2016-10-02 20:37 ` Khem Raj
  2016-10-03  6:41   ` Andre McCurdy
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2016-10-02 20:37 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1733 bytes --]


> On Sep 12, 2016, at 1:14 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
> 
> 40 character paths work OK for device nodes in /dev but not for
> device nodes created in a chroot, LXC container, etc.
> 
> Since the 'path' array is already a 4k buffer, the sscanf 40
> character limit seems to be a typo or historical mis-merge. Update
> the sscanf limit and bring the code in sync with the Buildroot
> version:
> 
>  https://git.buildroot.net/buildroot/commit/?id=8876b6751e0bc19a3754290061808f0f8420708e

what is upstream worthiness of this patch ? it seems it could be
a good change

> 
> Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
> ---
> meta/recipes-devtools/makedevs/makedevs/makedevs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-devtools/makedevs/makedevs/makedevs.c b/meta/recipes-devtools/makedevs/makedevs/makedevs.c
> index 7471f3f..cba7681 100644
> --- a/meta/recipes-devtools/makedevs/makedevs/makedevs.c
> +++ b/meta/recipes-devtools/makedevs/makedevs/makedevs.c
> @@ -360,7 +360,7 @@ static int interpret_table_entry(char *line)
> 	unsigned long mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
> 	unsigned long start = 0, increment = 1, count = 0;
> 
> -	if (0 > sscanf(line, "%40s %c %lo %40s %40s %lu %lu %lu %lu %lu", path,
> +	if (0 > sscanf(line, "%4095s %c %lo %40s %40s %lu %lu %lu %lu %lu", path,
> 		    &type, &mode, usr_buf, grp_buf, &major, &minor, &start,
> 		    &increment, &count))
> 	{
> --
> 1.9.1
> 
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] makedevs: don't restrict device node paths to 40 characters
  2016-10-02 20:37 ` Khem Raj
@ 2016-10-03  6:41   ` Andre McCurdy
  2016-10-03 23:41     ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Andre McCurdy @ 2016-10-03  6:41 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE Core mailing list

On Sun, Oct 2, 2016 at 1:37 PM, Khem Raj <raj.khem@gmail.com> wrote:
>
>> On Sep 12, 2016, at 1:14 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
>>
>> 40 character paths work OK for device nodes in /dev but not for
>> device nodes created in a chroot, LXC container, etc.
>>
>> Since the 'path' array is already a 4k buffer, the sscanf 40
>> character limit seems to be a typo or historical mis-merge. Update
>> the sscanf limit and bring the code in sync with the Buildroot
>> version:
>>
>>  https://git.buildroot.net/buildroot/commit/?id=8876b6751e0bc19a3754290061808f0f8420708e
>
> what is upstream worthiness of this patch ? it seems it could be
> a good change

Where is the upstream?

>>
>> Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
>> ---
>> meta/recipes-devtools/makedevs/makedevs/makedevs.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-devtools/makedevs/makedevs/makedevs.c b/meta/recipes-devtools/makedevs/makedevs/makedevs.c
>> index 7471f3f..cba7681 100644
>> --- a/meta/recipes-devtools/makedevs/makedevs/makedevs.c
>> +++ b/meta/recipes-devtools/makedevs/makedevs/makedevs.c
>> @@ -360,7 +360,7 @@ static int interpret_table_entry(char *line)
>>       unsigned long mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
>>       unsigned long start = 0, increment = 1, count = 0;
>>
>> -     if (0 > sscanf(line, "%40s %c %lo %40s %40s %lu %lu %lu %lu %lu", path,
>> +     if (0 > sscanf(line, "%4095s %c %lo %40s %40s %lu %lu %lu %lu %lu", path,
>>                   &type, &mode, usr_buf, grp_buf, &major, &minor, &start,
>>                   &increment, &count))
>>       {
>> --
>> 1.9.1
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] makedevs: don't restrict device node paths to 40 characters
  2016-10-03  6:41   ` Andre McCurdy
@ 2016-10-03 23:41     ` Khem Raj
  0 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2016-10-03 23:41 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: OE Core mailing list

[-- Attachment #1: Type: text/plain, Size: 2121 bytes --]


> On Oct 2, 2016, at 11:41 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
> 
> On Sun, Oct 2, 2016 at 1:37 PM, Khem Raj <raj.khem@gmail.com> wrote:
>> 
>>> On Sep 12, 2016, at 1:14 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
>>> 
>>> 40 character paths work OK for device nodes in /dev but not for
>>> device nodes created in a chroot, LXC container, etc.
>>> 
>>> Since the 'path' array is already a 4k buffer, the sscanf 40
>>> character limit seems to be a typo or historical mis-merge. Update
>>> the sscanf limit and bring the code in sync with the Buildroot
>>> version:
>>> 
>>> https://git.buildroot.net/buildroot/commit/?id=8876b6751e0bc19a3754290061808f0f8420708e
>> 
>> what is upstream worthiness of this patch ? it seems it could be
>> a good change
> 
> Where is the upstream?

mtd-utils, but in this case it seems its a back port so we are fine.

> 
>>> 
>>> Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
>>> ---
>>> meta/recipes-devtools/makedevs/makedevs/makedevs.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/meta/recipes-devtools/makedevs/makedevs/makedevs.c b/meta/recipes-devtools/makedevs/makedevs/makedevs.c
>>> index 7471f3f..cba7681 100644
>>> --- a/meta/recipes-devtools/makedevs/makedevs/makedevs.c
>>> +++ b/meta/recipes-devtools/makedevs/makedevs/makedevs.c
>>> @@ -360,7 +360,7 @@ static int interpret_table_entry(char *line)
>>>      unsigned long mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
>>>      unsigned long start = 0, increment = 1, count = 0;
>>> 
>>> -     if (0 > sscanf(line, "%40s %c %lo %40s %40s %lu %lu %lu %lu %lu", path,
>>> +     if (0 > sscanf(line, "%4095s %c %lo %40s %40s %lu %lu %lu %lu %lu", path,
>>>                  &type, &mode, usr_buf, grp_buf, &major, &minor, &start,
>>>                  &increment, &count))
>>>      {
>>> --
>>> 1.9.1
>>> 
>>> --
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-03 23:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12 20:14 [PATCH] makedevs: don't restrict device node paths to 40 characters Andre McCurdy
2016-10-02 20:37 ` Khem Raj
2016-10-03  6:41   ` Andre McCurdy
2016-10-03 23:41     ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.