Re: (b)make: Outputting a huge variable value

2024-05-16 Thread Edgar Fuß
> Does "make -V '$VARIABLE'" (or without the $, depending on exactly what > you want) not work? I must be missing something. The point is to do this in a makefile, not as an isolated invocation of make. So something like ${VAR:wfile} or ${VAR:|echo >file}.

(b)make: Outputting a huge variable value

2024-05-16 Thread Edgar Fuß
Following a discussion (make mdi: shell limit exceeded) on tech-pkg@, I keep asking myself whether there's a sensible way to output the contents of a make variable to a file (or pipe), even if the contents exceeds ARG_MAX.

Re: strtoi(3) ERANGE vs ENOTSUP

2024-01-21 Thread Edgar Fuß
I think it depends on what you consider valid use cases of strtoi(). > This is the case when the number is out of range, and there's trailing > garbage -- e.g., s="42z", min=3, max=7. Is it correct to consider the first non-digit character garbage? I.e., would you regard it as an abuse of

Re: child of a multithreaded process looping in malloc()

2023-11-02 Thread Edgar Fuß
Oh well. > It effectively does -- the calls to _malloc_prefork/postfork(_child) > are baked into fork in NetBSD's libc: It does in -current, but the problem shows up in -8. I'll try to back-port the changes. Am I right that I'll need the changes of malloc.c 1.60, jemalloc.c 1.53 (and 1.48),

child of a multithreaded process looping in malloc()

2023-11-02 Thread Edgar Fuß
I've a long-standing problem of a process eating cpu time without doing anything useful, which, most probably, goes like this: Of a multi-threaded process, one thread is in malloc() while another thread fork()s. (So the child is born with the malloc lock held.) The child process (becoming

Re: new certificate stuff

2023-08-28 Thread Edgar Fuß
What about certctl.conf in the etc set defaulting to "manual" and sysinst (optionally?) changing it to automatic mode? Of course, then, updating to -10 wouldn't give you automatic mode.

Re: epoll exposure

2023-08-15 Thread Edgar Fuß
> It also is a wrong way to build self-configuration; such a test is > vulnerable to both false positives and false negatives. It should be > reported upstream as a bug. Much righter is to test whether epoll, if > present, produces the behaviour the program expects in the uses it > makes of it.

submission port usage (was: /etc/services losses)

2023-08-04 Thread Edgar Fuß
I think the de-facto rationale for a larger network goes like this: -- You don't want to get your IPs blacklisted because infected clients send spam from within your network. -- Other sites will allow mail submission on their submission port only after authentication (SASL). So you block

Re: unresolvable R_X86_64_NONE relocation against symbol `__sF'

2023-05-18 Thread Edgar Fuß
> Can you post the build log for this and the > > /var/work/pkgsrc/pkgtools/pkg_install/work/libfetch/libfetch.a > > file itself? attached (gzip-ed and .work.log renamed). dot_work.log.gz Description: Binary data libfetch.a.gz Description: Binary data

porting nss-pam-ldapd (was: pulling in changes to nsswitch from FreeBSD?)

2023-05-18 Thread Edgar Fuß
> For "reasons" I have been looking to build nss-pam-ldapd I've already done that eight years ago: see pkg/49804.

unresolvable R_X86_64_NONE relocation against symbol `__sF'

2023-05-17 Thread Edgar Fuß
And another weird problem: Using a lang/gcc8 compiler patched to use gas and gld from devel/binutils 2.26.1 (see other thread), when building pkgtools/pkg_install, I get /usr/pkg/bin/gld: /var/work/pkgsrc/pkgtools/pkg_install/work/libfetch/libfetch.a(common.o)(.text+0x1e5):

Re: using gas/gld from devel/binutils

2023-05-17 Thread Edgar Fuß
[Adding tech-userlevel for the base system questions] For involved reasons, I patched lang/gcc8 to use gas/gld from devel/binutils (analogous to what is done to use gas on Solaris). This makes lang/gcc8 fail to build, it segfaults (cc1 nil pointer reference in etc_set_father() calling

Re: debugging/tracing a setuid program

2023-05-08 Thread Edgar Fuß
I haven't investigated this further, but it worked to ktrace -p and revealed openat() as the culprit. It's detected by autoconf on the -6 chroot on -8 while -6 doesn't implement it.

Re: debugging/tracing a setuid program

2023-05-05 Thread Edgar Fuß
> (a) I'd say it shouldn't stop ktracing I suspect it stops as soon as sudo calls setuid.

Re: debugging/tracing a setuid program

2023-05-05 Thread Edgar Fuß
> As root, ktrace -i the shell (or other process) it's started by. That gives me a ktrace that stops in the middle of the GIO where sudo is reading the sudoers file.

debugging/tracing a setuid program

2023-05-05 Thread Edgar Fuß
I have an interesting problem: How do you debug or ktrace a setuid binary that exhibits the problem only when run as non-root? (Specifically, this is sudo built for NetBSD-6 via kver in a chroot on -8 failing to read the timestamp files on real -6. When called as root, it doesn't use the

Re: split(1): add '-c' to continue creating files

2023-02-14 Thread Edgar Fuß
> How about instead adding an option that sets the first name explicitly > and keeps the "abort on failure" behaviour? That looks like a much better idea to me.

Re: tcsh as csh default

2022-10-21 Thread Edgar Fuß
> About the only argument for retaining csh that makes zero > sense is to retain it for scripts. I guess it's a matter of (varying) taste. I used to prefer csh at some time, and that was definetely after V7 appeared. Also, there are csh scripts out there. Anyone fully converted metamail to sh?

Re: Permissions of the root dot files

2022-08-30 Thread Edgar Fuß
> what difference does the user 'w' (or 'r' ... 'x' does matter) permission > bit really make on a root owned file? To me, it implies that the file should not be written regardless of the fact that it technically can.

PATH order (was: sh(1) and ksh(1) default PATH)

2022-08-18 Thread Edgar Fuß
If you need the base version of a utility, why not call it by full path? OTOH, if people need a newer version of foo, I install foo from pkgsrc and want that to take precedence over the base version. If I write a wrapper around bar, I put it in /usr/local/bin.

Re: /rescue/tar needing liblzma.so.2

2022-07-05 Thread Edgar Fuß
> if /rescue/tar is going to run gzip as a subprocess, it should have > the full path /rescue/gzip (or gzcat or whatever) baked in so > its behaviour doesn't depend on PATH. Yes, that looks lihe TRT to me.

Re: /rescue/tar needing liblzma.so.2

2022-07-04 Thread Edgar Fuß
> Fortunately, I could /rescue/gzcat base.tgz >base.tar and tar x that I also couldn‘t /rescue/gunzip base.tgz. Why?

/rescue/tar needing liblzma.so.2

2022-07-04 Thread Edgar Fuß
I nearly locked myself out updating a server (from -6 to -8). I booted the new kernel (single user), mounted /usr, /var and /tmp, extracted base.tgz (excluding /rescue, fortunately), but had forgotten to remount / rw. After that (I interrupted tar), tar didn't work any more. Well, I had

pthread__initmain() calling err() (was: cmake core dumps in -6 emulation)

2022-07-03 Thread Edgar Fuß
> No, this is just too early in the init sequence. > It shouldn't be using err()... Then someone(TM) should fix that? Shall I file a PR?

Re: cmake core dumps in -6 emulation

2022-07-01 Thread Edgar Fuß
EF> What I don't understand is why it dumps core while reporting an error. KRE> Perhaps NetBSD 6 required an explicit setprogname() which is no longer KRE> required? But that's a matter of the C library, no?

Re: cmake core dumps in -6 emulation

2022-07-01 Thread Edgar Fuß
> you could test with paxctl on the cmake file With paxctl +m /usr/pkg/bin/cmake (inside the chroot, of course), it now core dumps even earlier in the build, with #0 0x0079d33c in cmsys::SystemTools::FilesDiffer(std::__cxx11::basic_string, std::allocator > const&,

Re: cmake core dumps in -6 emulation

2022-07-01 Thread Edgar Fuß
> Ktrace it As mentioned, that doesn't work (well, it works, which is the problem). > there are 3 err() calls in pthread__init() Starting with #8 0x71b551460ac0 in err () from /usr/lib/libc.so.12 #9 0x71b55240c47b in pthread__init () from /usr/lib/libpthread.so.1 I

Re: cmake core dumps in -6 emulation

2022-07-01 Thread Edgar Fuß
> but it's got to mean _something_ Timing?

Re: cmake core dumps in -6 emulation

2022-06-30 Thread Edgar Fuß
> Ktrace it That, way, it proceeds past the error. I can then interrupt it and proceed with a normal make build. That core dumps again (later); ktrace-d, it proceeds past the error again. Interrupt, proceed normal. core dumps. Finally, I get a core dump with the ktrace-d run, but no sensible

cmake core dumps in -6 emulation

2022-06-30 Thread Edgar Fuß
In order to be able to build packages for -6 on a -8 machine, I set up a subdirectroy in /var/chroot containing a tar-ed copy of a real -6 machine. I then chroot into there with kver -r 6.1_STABLE /bin/sh. I tried to build icinga2, but I cmake core dumps with this backtrace: #0

Re: Checking whether an rc.d script was invoked from rc

2022-04-12 Thread Edgar Fuß
> Make the script require CRITLOCALMOUNTED (in -current, or mountcritlocal > in older versions)? I don't get that. That wouldn't mount /usr, no? My (second) question was about patching the binary so it would link to libc, libm and libpcap from /lib, not /usr/lib. Or would it do that

Checking whether an rc.d script was invoked from rc

2022-04-12 Thread Edgar Fuß
Two probably very basic questions: Is there a way to check whether an rc.d script was invoked from rc (as opposed to running it manually, via service(8) or whatever? During autoboot, rc_fast is set, but if I go single user and back multi user or boot to single user and go multi user from there,

Re: rc of built-in printf

2022-03-15 Thread Edgar Fuß
Oops, it looks like /usr/bin/printf will only exit non-zero because it receives SIGPIPE. If called with SIGPIPE ignored, it will still exit 0.

rc of built-in printf

2022-03-15 Thread Edgar Fuß
Is it on purpose that sh's (at least, NetBSD-8's sh's) built-in printf doesn't give a non-zero rc if the underlying write(2) fails (with EPIPE, in my case)? It turns out that this { sleep 1; printf "Hallo" || echo "ERROR">&2; } | echo Foo doesn't print "ERROR" with both sh and bash,

Re: sh(1) wait builtin command and stopped jobs

2022-03-15 Thread Edgar Fuß
> Then add an option to wait [...] to indicate that wait should complete > if the [...] process enters stopped state I guess "enters stopped state" includes the case where the process already was in the stopped state when the wait command was issued? > My inclination is to go that way, rather

Re: ZFS - mounting filesystems

2022-03-14 Thread Edgar Fuß
> I don't see a real problem with deciding to mount all local filesystems > (marked auto of course) at mouncritlocal time. What if /usr is on NFS and /usr/local is local?

Re: installboot: Old BPB too big, use -f (may invalidate filesystem)

2022-02-14 Thread Edgar Fuß
> BPB is PC specific and linked to MBR if I'm not mistaken. What seems to > me problematic is that you mention fdisk (i.e. MBR) first and the > error message is about GPT... I'm using MBR, not GPT. But fdisk provokes an error message about GPT.

Re: installboot: Old BPB too big, use -f (may invalidate filesystem)

2022-02-14 Thread Edgar Fuß
> If you are trying to setup the machine for NetBSD only use It's NetBSD only. > - if you are UEFI booting from a FAT partition No, it's plain old BIOS boot (the server is from 2005). > - if you really want ffsv1 boot code, then sd0e better not be a FAT file >system sd0e is fstype RAID.

Re: installboot: Old BPB too big, use -f (may invalidate filesystem)

2022-02-14 Thread Edgar Fuß
> I see no explicit indication of which port you're doing this on. Ah, sorry, it's amd64.

installboot: Old BPB too big, use -f (may invalidate filesystem)

2022-02-14 Thread Edgar Fuß
What does installboot: Old BPB too big, use -f (may invalidate filesystem) mean? I have a RAIDframe level 1 RAID consisting of /dev/sd0e and /dev/sd1e. Now, sd0 failed. I replaced the disc, fdisk'ed and disklabel'ed it and performed a raidctl -R, which succeeded. Now, I need to write the

Re: sh: killing a pipe head from the tail

2021-12-08 Thread Edgar Fuß
> apart from patching collectd For the record: https://github.com/collectd/collectd/pull/3954

Re: sh: killing a pipe head from the tail

2021-12-08 Thread Edgar Fuß
> It is irrelevant to the questino you asked. But people often ask "how > do I do XYZ?" when their problem is actually "how do I do ABC?" and > they believe XYZ is the only way (or sometimes, the correct way) to do > ABC. Such people are often wrong; there are often other ways to do ABC. Ah, OK,

Re: sh: killing a pipe head from the tail

2021-12-07 Thread Edgar Fuß
I'm confused. Is my english so bad that no-one understands what I'm asking or is my understanding of SIGPIPE wrong? > Can't you just close() the pipe? Yes, of course. I wrote: EF> Of course, when the tail exits, the head will get SIGPIPE as soon as it EF> tries to output something, but can the

sh: killing a pipe head from the tail

2021-12-07 Thread Edgar Fuß
Is there a sane way to kill a pipe's head from within the pipe's tail, at least on tail exit? Of course, when the tail exits, the head will get SIGPIPE as soon as it tries to output something, but can the tail explicitly kill it earlier?

fuser(1)

2021-10-29 Thread Edgar Fuß
I just stumbled over the fact that NetBSD userland seems to be missing the fuser(1) command mandated by (the XSI extension of) POSIX. Is there any reason (other than "nobody cared") for that?

Re: test a -nt b if b doesn't exist

2021-08-27 Thread Edgar Fuß
EF> Is there any cons[e]nsus among shell developers what the prefer[e]d EF> behaviour is? I just noticed that you understood "shell developers" as "people writing shell code" whereas I originally meant "people writing shells". But, of course, both are interesting. > Incidentally, this means

test a -nt b if b doesn't exist

2021-08-27 Thread Edgar Fuß
I've noticed a subtle difference between our sh and bash when applying test -nt to a pair of files where the first one exists, but the second doesn't: In bash, the result is true (0), while with our sh (and /bin/test), it's false (1). Unfortunately, test -nt is not specified by SUS. Is there

lout (was: Summary of man-page formatting)

2021-03-16 Thread Edgar Fuß
> However, I took a quick look at the source yesterday and it seems the > code comes as 52 source files numbered 01-52, which is not, shall we > say, entirely auspicious. :-| Well, any decent C programmer would have called them z00.c through z51.c.

attaching gdb to stopexit'ed process (was: unconditional core dump on exit?)

2021-03-09 Thread Edgar Fuß
EF> Is there a way to make a process dump core on exit no matter what? EF> I have a deamon dying (or whatever) from time to time with no trace to the EF> cause and guess a backtrace from a dump would help. KR> Start under a debugger, break on 'exit'. I tried to set proc.$pid.stopexit, but when I

Re: Set USB device ownership based on vedorid/productid

2021-02-16 Thread Edgar Fuß
> devpubd does that in-tree. OK. Is there a sane way of obtaining VendorId/ProductId in the devpub script?

Set USB device ownership based on vedorid/productid

2021-02-15 Thread Edgar Fuß
Does NetBSD provide any framework that allows USB device ownership/permissions to be autmatically set on USB VendorId/DeviceId? E.g., if a USB device with VendorId/ProductId 06da/0002 appears and becomes ugen0, do chown nut:nut /dev/ugen0.*; chmod 0660 /dev/ugen0.*

unconditional core dump on exit?

2020-09-14 Thread Edgar Fuß
Is there a way to make a process dump core on exit no matter what? I have a deamon dying (or whatever) from time to time with no trace to the cause and guess a backtrace from a dump would help.

fdisk: Can't read secondary GPT header: Invalid argument

2020-08-21 Thread Edgar Fuß
I just replaced a failed (SAS) disc in a RAIDframe RAID with an identical one. Everything seems to have worked well, only fdisk utters fdisk: Can't read secondary GPT header: Invalid argument combined with a kernel message sd0(ahd0:0:0:0): Check Condition on CDB: 0x28 00 04 47 e0

merging /usr/bin etc. to / (was: Solving the syslogd problem)

2020-01-30 Thread Edgar Fuß
> This is elegant and I would like to see it. Just remove /usr entirely and > collapse its contents into / - no /usr/bin, no /usr/lib, etc. This thread started because syslogd lives in /usr, mounting of /usr depends on NETWORK, and so network daemons are unable to log to syslog (at least in the

Re: Fonts for console/fb for various locales: a proposal

2019-09-29 Thread Edgar Fuß
> This is the whole purpose of METAFONT. METAFONT is a rasterizer. I'm somewhat sceptical that the results will be usable at the low resolution of a console frame buffer.

bmake: .if !empty(i:M[0-9]*)

2019-08-21 Thread Edgar Fuß
I once again ran into an oddity with bmake's .for loops. It looks like that .if !empty(i:Mxxx) doesn't work if i is a .for loop variable. Assigning the loop variable to another var makes it work. Oddly enough, .if !empty(:U123:Mxxx) (outside a .for loop) works as expected. [I'm aware that [0-9]*

Re: NetBSD truss(1), coredumper(1) and performance bottlenecks

2019-05-29 Thread Edgar Fuß
> I was asked for truss(1) by Christos back some time ago. So here it is. I'm surely missing something, but what's the advantage of truss over ktruss?

dynamic symbol resolving preference (was: SHA384_Update symbol clash with libgs)

2019-04-06 Thread Edgar Fuß
> IMO, they're both at fault. I'm not at all an expert on the field of dynamic linking, but what strikes me as odd is: 1. The dynamic linker should be able to notice that two libraries are pulled in which export conflicting symbols and warn about it, no? That would have saved me three working

SHA384_Update symbol clash with libgs

2019-04-05 Thread Edgar Fuß
I'm not sure at which level this needs to be dealt with. libgs, in its infinite wisdom, exports SHA384_Update, which of course clashes with OpenSSL's well known symbol of the same name. Which means that as soon as you pull in libgs, your TLS may fail in mysterious ways. [In my case, it was

Re: [PATCH] dump -U to specify dumpdates device

2019-03-21 Thread Edgar Fuß
> IIRC Irix had this, both for EFS and XFS. No, as far as I remember and see, neither dump nor xfsdump had this. I didn't actually start my O2, though.

Re: Re-establishing the "magic" of the special vars in sh(1)

2019-02-17 Thread Edgar Fuß
> So, one solution to this might be to add a new builtin command > something like this: > > specialvar variable ... While I concur that there's a problem to be solved (looks like it may even be a security problem to setenv RANDOM or the like), I guess such a change will only make sense if

Re: /bin/sh startup file processing

2018-12-14 Thread Edgar Fuß
> only current use for the (posix "is undefined") relative path in $ENV is > if the intent is to run the script relative to whatever directory the > shell happens to start in. I doubt that is often intended. I would guess the most probable intent is to run it from $HOME (and wonder why it

Re: Moving telnet/telnetd from base to pkgsrc

2018-12-14 Thread Edgar Fuß
> Y'all seem to think it's totally reasonable to telnet in the open internet What's the problem with "telnet www.uni-bonn.de http"?

Re: Moving telnet/telnetd from base to pkgsrc

2018-12-14 Thread Edgar Fuß
> send hate mail my way. I guess you are over-looking my (and probably a lot of other network administrator's) primary use case for /usr/bin/telnet: connect to a HTTP/SMTP/IMAP/whatever port and speak the protocol.

Re: /bin/sh startup file processing

2018-12-13 Thread Edgar Fuß
> I'm considering, if it seems reasonable to those here, to change sh so it does > not read profile files (any of them) from relative paths (simply ignore any > such attempt). Yes, that sounds reasonable to me. I don't know how many people's profiles it might break, though. In the current

Re: X=1 :

2018-11-26 Thread Edgar Fuß
> X=/ cd $X > > cd's to $HOME, not to / ... > > This really violates the POLA, I'd say... Depends on how much shell programming you do. I used to trip over it often enough. The point is that $X is expanded before X=/ is assigned. You run cd (with no arguments) with X set to /.

Re: /bin/sh redirect without command failure mode

2018-11-25 Thread Edgar Fuß
> All other shells seem to not exit As even dash seem not to exit: Did they change their behaviour on purpose to match ksh/bash? I guess it would be better to line up with ksh/dash unless there's some compelling reason to keep the differing behaviour.

Re: dirname(3) used on its own results?

2018-09-25 Thread Edgar Fuß
> But there's nothing in that bit that implies (to me!) > "You can't subsequently call dirname(3) on the results of > a previous call to dirname(3)". You are calling dirname() on an argument that may be destroyed by that very call. You are calling dirname() on a possibly invalid argument.

Re: dirname(3) used on its own results?

2018-09-25 Thread Edgar Fuß
> or are we restricted by some standard from having dirname(3) > be able to be called on the results of a previous dirname(3) call Not exactly restricted from, but This is not strictly a bug; it is explicitly allowed by IEEE Std 1003.1-2001 (``POSIX.1''). > in which case we

Re: Updating old scripts ... #1 /usr/sbin/ypinit

2018-09-22 Thread Edgar Fuß
I don't get that. It looks like you are looking for a script that reads and understands the documentation (which is wrong wrt. the current implementation) and would get confused if you change the documentation to match actual behaviour? Or are you looking for a script that reads and

Re: shell jobs -p

2018-09-13 Thread Edgar Fuß
> You're using an old version, not NetBSD current (or 8) right? 6.1, mostly (for the ash part), yes. > and now the only way for a script to make a job vanish from the > jobs table (and so, from being seen in the output of jobs -p) is > to "wait" for it. Surely you've digested what SUS says about

Re: shell jobs -p

2018-09-13 Thread Edgar Fuß
> You mean xargs -p, essentially? xargs -L 1 -P (capital) would have done the job if a) had I known about it (thanks for the hint!) b) it were POSIX

shell jobs -p

2018-09-13 Thread Edgar Fuß
I could probably as well directly mail kre@, but who knows. The objective was to write s shell script that parallelized invocations of some command, but only up to a certain number of jobs running in parallel. There were two ideas to implement this, one using the jobs utility to track the

Re: Redoing the code in /bin/sh to handle the issues in PR bin/48875

2018-08-31 Thread Edgar Fuß
A bit late due to vacation: > To me, a command substitution that runs in the background seems weird > and like something to avoid. Is there really a case where this is useful, > or would it be reasonable to include a suggestion that it's best to avoid > such a construct? The case that led to

Re: Weirdness in /bin/sh of 8.0

2018-08-11 Thread Edgar Fuß
> It just stops after printing the package list: 1. What's the exit code? 2. If you run it with sh -x, do you see where it exits?

Re: shell prefix/suffix removal with quoted word

2018-07-30 Thread Edgar Fuß
> I have susv4tc2. AOL. > It is specified Possibly yes. > but clarification should be done Surely yes. > Enclosing the full parameter expansion string in double- > quotes shall not cause the following four varieties of > pattern characters to be quoted, whereas _quoting_ >

shell prefix/suffix removal with quoted word

2018-07-27 Thread Edgar Fuß
It has been brought to my attention that quoting the "word" in sh's substring processing causes word to be matched literally rather than being treated as a pattern. I.e., x="abc" y="?" echo "${x#"$y"}" outputs "abc", while x="abc" y="?" echo

Re: swapctl -l

2018-07-25 Thread Edgar Fuß
> Pages are only removed from swap when they are freed or accessed. Ah, I see, thanks! Can I find out which processes own pages that are paged out?

Re: swapctl -l

2018-07-25 Thread Edgar Fuß
EF> It appears to me that swapctl -l lists how much of the swap devices EF> have ever been in use since they were configured. JS> No? It seems to list exactly how much space is currently in use. Sorry, I was confused by sysstat vm not showing any paging acivity. Looks like I have some daemons

swapctl -l

2018-07-25 Thread Edgar Fuß
It appears to me that swapctl -l lists how much of the swap devices have ever been in use since they were configured. Is there a way to display how much swap is currently in use in the sense of "how many pages are currently swapped out"? Maybe due to my lack of undestanding of vm the question

Re: open()ing a named pipe with no current readers

2018-06-17 Thread Edgar Fuß
> Won't O_NONBLOCK cover this? No. POSIX says: O_NONBLOCK When opening a FIFO with O_RDONLY or O_WRONLY set: If O_NONBLOCK is set, an open() for reading-only shall return without delay. An open() for writing-only shall return an error if no process currently has the file

Re: Suggestion: add a new option for chown(1)/chmod(1)

2018-06-04 Thread Edgar Fuß
> similar to the -x option available in find(1)? YES!

make: empty() and friends on loop variables

2017-12-14 Thread Edgar Fuß
It appears to me that empty(), defined() etc. do not work on .for loop variables, at least not on NetBSD 7's make and bmake-20150505. Assigning the loop variable to anothe rintermediate var seems tu cure it. .for i in aXa bYb .if defined(i) .info DEFINED .else .info UNDEFINED .endif .if

Re: Changing basename(3) and dirname(3) for future posix compatibility

2017-12-03 Thread Edgar Fuß
> there might be NetBSD applications currently which are assuming > that the input string is not modified by these functions I'd be heavily surprised if that change wouldn't break half (OK, 10%) the consumers, either because they call both functions on the same path argument or because they

Re: RFC: Change to the way sh -x works?

2017-11-12 Thread Edgar Fuß
> What "to standard error" means there, that is, which version of stderr, > isn't clear. So, can anyone imagine a use case where "follow whatever stderr happens to be subsequently redirected to" (current behaviour) would make more sense than "whatever stderr currently points to" (after your

Re: RFC: Change to the way sh -x works?

2017-11-12 Thread Edgar Fuß
This looks very useful to me. I guess SUS doesn't specify this? > For this, stderr is remembered only when tracing turns from off to on, > if it is on already, and another "set -x" is performed, nothing changes. I can't unambigiously parse that. On second reading, treating the comma at the end

Re: getaddrinfo(3) on numerical addresses

2017-10-25 Thread Edgar Fuß
EF> Ah yes, of course. Stupid me. Thanks. So what I've learned (thanks!) from this discussion: Calling getaddrinfo() with a hint of AF_INET/AF_INET6 means "if you try hard, can you make this a IPv4/IPv6 address" (e.g., look up 1.2.3.4.numerical.org or ::1.i-like-colons.org) If you want "does

Re: getaddrinfo(3) on numerical addresses

2017-10-24 Thread Edgar Fuß
> At least inet_pton parses a numerical IPv4 addresses without any dots. Despite the man page claiming so, it actually doesn't (on 6.1): #include #include #include int main(int argc, char *argv[]) { char buf[16]; printf("%d\n", inet_pton(AF_INET, "1", buf)); return 0;

Re: getaddrinfo(3) on numerical addresses

2017-10-24 Thread Edgar Fuß
> I suspect there's some misunderstanding. Yes. It's about numerical IPv4 addresses being looked up with an AF_INET6 hint. check_ping tries to figure out whether it needs to call ping6 (suppose wer'e on a system where ping6 is different from ping). Suppose that check_ping is invoked without

Re: getaddrinfo(3) on numerical addresses

2017-10-24 Thread Edgar Fuß
> That's what AI_NUMERICHOST is for? No (or so I think). I would like to save the resolver lookup if we know beforehand we don't need it. > It's not clear whether it should or should not parse the behavior I can't parse that sentence. What's wrong with the following argument? 1a. domain name

Re: Switching to GNU userland and tools - yay or nay?

2017-10-09 Thread Edgar Fuß
I have no idea why one would wnat to do what you intend to do, but you could use the Linux emulation and the SuSE compat packages in pkgksrc.

Re: killing subshells in /bin/sh scripts

2017-08-30 Thread Edgar Fuß
> However, there's another way which comes pretty close - the process group id > assigned is (in practice, and perhaps required) always the process id of the > process group leader I think it's required: If the calling process is not already a session leader, setpgrp() sets the process

Re: external versions of sh built-in utilities

2017-07-17 Thread Edgar Fuß
> For what little it's worth, here's where this silly requirement can be found > (in case you're still looking for it): > > http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/utilities/V3_chap01 As this is in the "introduction" section and there's a more precise (and more sensible)

Re: external versions of sh built-in utilities

2017-07-17 Thread Edgar Fuß
> This leads to the crux of the matter - I have been told that POSIX > actually requires that all of the commands in this third category (actually > all the sh built-in commands, except the special built-ins) have an > executable that can be subject of an execvp(2) call. The second group >

Re: How to properly daemonize?

2017-07-17 Thread Edgar Fuß
> IMHO that problem was already faced by supervisor's authors - for > example s6's author puts some thoughts and summaries on their pages: But there's a difference between a general-purpose notification mechanism and a process notifying it's (grand)parent exactly once upon statup, no?

Re: test -nt and -ot operators

2017-07-14 Thread Edgar Fuß
I would suggest clarifying the documentation that the test returns false if either file doesn't exist. And perhaps add a CAVEAT that other shells have different semantics in case one of the files is missing. I can't make sense out of the ksh bevaviour. I could make sense out of "true if file2

Re: How to properly daemonize?

2017-07-14 Thread Edgar Fuß
> The list in _Advanced Programming in the Unix Environment_ That list answeres just a tiny subset of my questions (mainly, that indeed SYSV is the system where a session leader automatically acquires a control tty if it happens to open a tty). Strangely, it doesn't mention the re-parenting at

Re: Future shell work - comments reqyuested

2017-07-13 Thread Edgar Fuß
> That's quite the editorial liberty you've taken there. > I'm speaking of our Almquist derivative, not dash. To fully quote from TLS's statement and your reply: TLS> In the direction you seem to be headed lies the true and vivid idiocy of the Debian shell, which is *larger* than our shell

Re: Future shell work - comments reqyuested

2017-07-13 Thread Edgar Fuß
TLS> I strongly disagree and note the obvious internal inconsistency in your TLS> argument (such as it is): I> If you want features for a scripting environment, use a different shell. I> I> The /bin/sh is an environment intended primarily to execute scripts. I> In what way is this inconsistent?

Captive Portal tool (was: Shipping SSL certificates in the base system)

2017-07-12 Thread Edgar Fuß
> I can create a simple CLI tool for it, but I won't be able to manage > ones that require heavy use of javascript or captchas. Is anyone's > captive portal requiring that? > > I would like examples (wget -r, please) of captive portals. With the one I wrote, you simply need to do a HTTP Basic

  1   2   >