Re: [Toybox] [PATCH] macOS: move getmountlist.c functions into portability.c.
> What ever it is, this isn't the first mailman driven mailing list I'm > having that problem with. I wonder if there is a simple to use > "convert base64 encoded ASCII emails to just plain damn ASCII emails" > utility I can bolt onto my mail filtering pipeline and be done with > it? I logged onto the mailman options page, changed "Get MIME or Plain Text Digests?" from "Plain Text" to "MIME", which the descriptive text strongly implies it only changes how digests of bundled posts get sent, not individual posts. I don't have digests turned on. Now I'm getting Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit instead of Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 But my email program still can't quote it. Something odd at my end. Still, progress. -- A big old stinking pile of genius that no one wants coz there are too many silver coated monkeys in the world. ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
Re: [Toybox] [PATCH] macOS: move getmountlist.c functions into portability.c.
Given the subject of this port of the discussion, apologies for the lack of attribution in the quotes below. > > Though now I'm getting annoyed at mailman sending plain ASCII text > > as base64 encoding. My email proggy can't handle quoting that. It > > didn't used to. > > I wonder if that's related to me enabling the "header rewrite" option > to avoid triggering gmail's spam filtering when a mail server has > that funky sender verification thing that breaks mailing lists? You would expect something called "header rewrite" would only rewrite headers, not body, but mailman is proudly a GNU project. What ever it is, this isn't the first mailman driven mailing list I'm having that problem with. I wonder if there is a simple to use "convert base64 encoded ASCII emails to just plain damn ASCII emails" utility I can bolt onto my mail filtering pipeline and be done with it? Or pull my finger out on my "switch email clients" TODO item, and find one that can cope? It's gonna take time to evaluate the contenders. > Apparently it's gotten so bad some open source projects are > abandoning mailing lists: > > https://lwn.net/Articles/768483/ That was an interesting read. I've long been of the opinion that mailing lists, web forums, bug trackers, and even chat room software, is all basically conversation based. There could be a base conversation system that all the above would just be UI front ends to. Let each user choose which to use. Especially bug trackers, users have a tendency to just make bug reports and support requests with whatever they are using at the time, not the actual official bug tracker. -- A big old stinking pile of genius that no one wants coz there are too many silver coated monkeys in the world. ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
Re: [Toybox] [PATCH] macOS: move getmountlist.c functions into portability.c.
On 12/5/18 6:31 AM, David Seikel wrote: >> There's something strange about gmail and this mailing list. I still >> can read your messages only from Elliot Hughes' replies (And of >> course I saw that message since you Cc'ed me). I can't even find your >> messages in the "Spam" folder in Thunderbird! > > Switching to no longer using gmail seems to have worked for me. > > Though now I'm getting annoyed at mailman sending plain ASCII text as > base64 encoding. My email proggy can't handle quoting that. It didn't > used to. I wonder if that's related to me enabling the "header rewrite" option to avoid triggering gmail's spam filtering when a mail server has that funky sender verification thing that breaks mailing lists? Apparently it's gotten so bad some open source projects are abandoning mailing lists: https://lwn.net/Articles/768483/ Given that everything else is subject to cloud rot, I'm pretty sure the ones that _don't_ abandon mailing lists will outlive the ones that do. But it'll be some years before that shakes out. (When microsoft finally kills github it's gonna suck for the digital archaeologists.) Rob ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
Re: [Toybox] [PATCH] macOS: move getmountlist.c functions into portability.c.
> There's something strange about gmail and this mailing list. I still > can read your messages only from Elliot Hughes' replies (And of > course I saw that message since you Cc'ed me). I can't even find your > messages in the "Spam" folder in Thunderbird! Switching to no longer using gmail seems to have worked for me. Though now I'm getting annoyed at mailman sending plain ASCII text as base64 encoding. My email proggy can't handle quoting that. It didn't used to. -- A big old stinking pile of genius that no one wants coz there are too many silver coated monkeys in the world. ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
Re: [Toybox] [PATCH] macOS: move getmountlist.c functions into portability.c.
There's something strange about gmail and this mailing list. I still can read your messages only from Elliot Hughes' replies (And of course I saw that message since you Cc'ed me). I can't even find your messages in the "Spam" folder in Thunderbird! Confused, R.H. On 05/12/2018 01:15, Rob Landley wrote: On 12/4/18 3:34 PM, enh via Toybox wrote: it'll fail to build if you actually try to build a toy that needs these :-) On Tue, Dec 4, 2018 at 1:28 PM Reverend Homer wrote: Oddy enough for that one I got your reply, but not Revend Homer's, and going through the spam filter (about 35 things from the buildroot list and such had wound up in there since I last checked)... still didn't find it. I suspect gmail did the "refuse delivery" thing, except I didn't get unsubcribed from the list again? (Does it have a third "accept delivery but discard and not even put it in the spam folder" option?) Wheee, Rob ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
Re: [Toybox] [PATCH] macOS: move getmountlist.c functions into portability.c.
On 12/4/18 3:34 PM, enh via Toybox wrote: > it'll fail to build if you actually try to build a toy that needs these :-) > On Tue, Dec 4, 2018 at 1:28 PM Reverend Homer wrote: Oddy enough for that one I got your reply, but not Revend Homer's, and going through the spam filter (about 35 things from the buildroot list and such had wound up in there since I last checked)... still didn't find it. I suspect gmail did the "refuse delivery" thing, except I didn't get unsubcribed from the list again? (Does it have a third "accept delivery but discard and not even put it in the spam folder" option?) Wheee, Rob ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
Re: [Toybox] [PATCH] macOS: move getmountlist.c functions into portability.c.
it'll fail to build if you actually try to build a toy that needs these :-) On Tue, Dec 4, 2018 at 1:28 PM Reverend Homer wrote: > > > On 04/12/2018 23:48, enh via Toybox wrote: > > <...> > > + > > +// Get a linked list of mount points, with stat information. > > +#ifdef __APPLE__ > > + > > +// Not implemented for macOS. > > +// See 's getmntinfo(3) for the BSD API. > > + > > > Shouldn't there be some warning? > > > R.H. > > > > +#else > > + > > +#include > > + > > +static void octal_deslash(char *s) > > +{ > > + char *o = s; > > + > > + while (*s) { > > +if (*s == '\\') { > > + int i, oct = 0; > > + > > + for (i = 1; i < 4; i++) { > > +if (!isdigit(s[i])) break; > > +oct = (oct<<3)+s[i]-'0'; > > + } > > + if (i == 4) { > > +*o++ = oct; > > +s += i; > > +continue; > > + } > > +} > > +*o++ = *s++; > > + } > > + > > + *o = 0; > > +} > > + > > +// Check if this type matches list. > > +// Odd syntax: typelist all yes = if any, typelist all no = if none. > > + > > +int mountlist_istype(struct mtab_list *ml, char *typelist) > > +{ > > + int len, skip; > > + char *t; > > + > > + if (!typelist) return 1; > > + > > + skip = strncmp(typelist, "no", 2); > > + > > + for (;;) { > > +if (!(t = comma_iterate(, ))) break; > > +if (!skip) { > > + // If one -t starts with "no", the rest must too > > + if (strncmp(t, "no", 2)) error_exit("bad typelist"); > > + if (!strncmp(t+2, ml->type, len-2)) { > > +skip = 1; > > +break; > > + } > > +} else if (!strncmp(t, ml->type, len) && !ml->type[len]) { > > + skip = 0; > > + break; > > +} > > + } > > + > > + return !skip; > > +} > > + > > +// Get list of mounted filesystems, including stat and statvfs info. > > +// Returns a reversed list, which is good for finding overmounts and such. > > + > > +struct mtab_list *xgetmountlist(char *path) > > +{ > > + struct mtab_list *mtlist = 0, *mt; > > + struct mntent *me; > > + FILE *fp; > > + char *p = path ? path : "/proc/mounts"; > > + > > + if (!(fp = setmntent(p, "r"))) perror_exit("bad %s", p); > > + > > + // The "test" part of the loop is done before the first time through and > > + // again after each "increment", so putting the actual load there avoids > > + // duplicating it. If the load was NULL, the loop stops. > > + > > + while ((me = getmntent(fp))) { > > +mt = xzalloc(sizeof(struct mtab_list) + strlen(me->mnt_fsname) + > > + strlen(me->mnt_dir) + strlen(me->mnt_type) + strlen(me->mnt_opts) + > > 4); > > +dlist_add_nomalloc((void *), (void *)mt); > > + > > +// Collect details about mounted filesystem > > +// Don't report errors, just leave data zeroed > > +if (!path) { > > + stat(me->mnt_dir, &(mt->stat)); > > + statvfs(me->mnt_dir, &(mt->statvfs)); > > +} > > + > > +// Remember information from /proc/mounts > > +mt->dir = stpcpy(mt->type, me->mnt_type)+1; > > +mt->device = stpcpy(mt->dir, me->mnt_dir)+1; > > +mt->opts = stpcpy(mt->device, me->mnt_fsname)+1; > > +strcpy(mt->opts, me->mnt_opts); > > + > > +octal_deslash(mt->dir); > > +octal_deslash(mt->device); > > + } > > + endmntent(fp); > > + > > + return mtlist; > > +} > > + > > +#endif > > > > ___ > > Toybox mailing list > > Toybox@lists.landley.net > > http://lists.landley.net/listinfo.cgi/toybox-landley.net > ___ > Toybox mailing list > Toybox@lists.landley.net > http://lists.landley.net/listinfo.cgi/toybox-landley.net ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
Re: [Toybox] [PATCH] macOS: move getmountlist.c functions into portability.c.
On 04/12/2018 23:48, enh via Toybox wrote: <...> + +// Get a linked list of mount points, with stat information. +#ifdef __APPLE__ + +// Not implemented for macOS. +// See 's getmntinfo(3) for the BSD API. + Shouldn't there be some warning? R.H. +#else + +#include + +static void octal_deslash(char *s) +{ + char *o = s; + + while (*s) { +if (*s == '\\') { + int i, oct = 0; + + for (i = 1; i < 4; i++) { +if (!isdigit(s[i])) break; +oct = (oct<<3)+s[i]-'0'; + } + if (i == 4) { +*o++ = oct; +s += i; +continue; + } +} +*o++ = *s++; + } + + *o = 0; +} + +// Check if this type matches list. +// Odd syntax: typelist all yes = if any, typelist all no = if none. + +int mountlist_istype(struct mtab_list *ml, char *typelist) +{ + int len, skip; + char *t; + + if (!typelist) return 1; + + skip = strncmp(typelist, "no", 2); + + for (;;) { +if (!(t = comma_iterate(, ))) break; +if (!skip) { + // If one -t starts with "no", the rest must too + if (strncmp(t, "no", 2)) error_exit("bad typelist"); + if (!strncmp(t+2, ml->type, len-2)) { +skip = 1; +break; + } +} else if (!strncmp(t, ml->type, len) && !ml->type[len]) { + skip = 0; + break; +} + } + + return !skip; +} + +// Get list of mounted filesystems, including stat and statvfs info. +// Returns a reversed list, which is good for finding overmounts and such. + +struct mtab_list *xgetmountlist(char *path) +{ + struct mtab_list *mtlist = 0, *mt; + struct mntent *me; + FILE *fp; + char *p = path ? path : "/proc/mounts"; + + if (!(fp = setmntent(p, "r"))) perror_exit("bad %s", p); + + // The "test" part of the loop is done before the first time through and + // again after each "increment", so putting the actual load there avoids + // duplicating it. If the load was NULL, the loop stops. + + while ((me = getmntent(fp))) { +mt = xzalloc(sizeof(struct mtab_list) + strlen(me->mnt_fsname) + + strlen(me->mnt_dir) + strlen(me->mnt_type) + strlen(me->mnt_opts) + 4); +dlist_add_nomalloc((void *), (void *)mt); + +// Collect details about mounted filesystem +// Don't report errors, just leave data zeroed +if (!path) { + stat(me->mnt_dir, &(mt->stat)); + statvfs(me->mnt_dir, &(mt->statvfs)); +} + +// Remember information from /proc/mounts +mt->dir = stpcpy(mt->type, me->mnt_type)+1; +mt->device = stpcpy(mt->dir, me->mnt_dir)+1; +mt->opts = stpcpy(mt->device, me->mnt_fsname)+1; +strcpy(mt->opts, me->mnt_opts); + +octal_deslash(mt->dir); +octal_deslash(mt->device); + } + endmntent(fp); + + return mtlist; +} + +#endif ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net