[File] [External] - Re: Feature request / patch offer: What about a `--files-from0` option?

Evan Driscoll edriscoll at codesecure.com
Mon Jun 10 15:57:13 UTC 2024


Hi, sorry for the delayed response; I had to confirm I could share it, and doofus me tried to do this on a Friday afternoon.

Anyway, I'm attaching the patch. I'm not thrilled by the goto​ in the argument processing, but I was worried about tracing side effects if I pulled things out to another function. Feel free to adjust of course.

Evan
________________________________
From: Christos Zoulas <christos at zoulas.com>
Sent: Friday, June 7, 2024 5:28 PM
To: Evan Driscoll <edriscoll at codesecure.com>
Cc: file at astron.com <file at astron.com>
Subject: [External] - Re: [File] Feature request / patch offer: What about a `--files-from0` option?

[You don't often get email from christos at zoulas.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

CAUTION: External Email


Sure, just send a patch. No copyright assignment needed...

christos

> On Jun 7, 2024, at 4:52 PM, Evan Driscoll <edriscoll at codesecure.com> wrote:
>
> The `--0`​ option to `file` provides a nice way to get perfect parsing of results that include unfortunate file names.
>
> However, there's not an analogue on the input side for providing filenames via a file, a la `--files-from`. Would it be possible to add an option, say `--files-from0`, that functions like `--files-from` except that the filenames are `\0` separated instead of newline-separated?
>
> I've put my money where my mouth is a bit, and implemented this locally; with some light testing only, it seems to work. I *believe* I can offer this patch. Is it of interest? What are your contribution requirements in terms of copyright assignment and whatnot?
>
> Thanks,
> Evan Driscoll
> ________________________________
> The information contained in this e-mail and any attachments from CodeSecure, Inc may contain confidential and/or proprietary information, and is intended only for the named recipient to whom it was originally addressed. If you are not the intended recipient, any disclosure, distribution, or copying of this e-mail or its attachments is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by return e-mail and permanently delete the e-mail and any attachments.
> --
> File mailing list
> File at astron.com
> https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.astron.com%2Fmailman%2Flistinfo%2Ffile&data=05%7C02%7Cedriscoll%40codesecure.com%7Cde26b67b514146ba79fe08dc87413f45%7C3b03d731b2154ba7baac94f143da2377%7C0%7C0%7C638533962182457700%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C60000%7C%7C%7C&sdata=LqY9NHE64v09ga2aj6HfoZW4rnA4JQA8V4U1c%2FHg4ss%3D&reserved=0<https://mailman.astron.com/mailman/listinfo/file>
>
> --
> This message has been 'sanitized'.  This means that potentially
> dangerous content has been rewritten or removed.  The following
> log describes which actions were taken.
>
> Sanitizer (start="1717799244"):
>  Split unusually long word(s) in header.
>  SanitizeFile (filename="unnamed.txt", mimetype="text/plain"):
>    Match (names="unnamed.txt", rule="9"):
>      Enforced policy: accept
>
>  Total modifications so far: 1
>
>
> Anomy 0.0.0 : Sanitizer.pm
> $Id: Sanitizer.pm,v 1.94 2006/01/02 16:43:10 bre Exp $
>

________________________________
The information contained in this e-mail and any attachments from CodeSecure, Inc may contain confidential and/or proprietary information, and is intended only for the named recipient to whom it was originally addressed. If you are not the intended recipient, any disclosure, distribution, or copying of this e-mail or its attachments is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by return e-mail and permanently delete the e-mail and any attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.astron.com/pipermail/file/attachments/20240610/c1ccd3d9/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: files-from0.patch
Type: text/x-patch
Size: 2750 bytes
Desc: files-from0.patch
URL: <https://mailman.astron.com/pipermail/file/attachments/20240610/c1ccd3d9/attachment.bin>


More information about the File mailing list