libera/#devuan/ Saturday, 2024-08-03

AlexLikeRockhelp00:48
AlexLikeRockaptitude install -t deadalus-backports thunderbird00:48
AlexLikeRock00:48
AlexLikeRockE: The value 'deadalus-backports' is invalid for APT::Default-Release as such a release is not available in the sources00:48
gnarfaceyou spelled daedalus wrong00:49
AlexLikeRockyes, thanks00:50
AlexLikeRockjejej00:50
AlexLikeRockdaed = dead00:51
AlexLikeRocksomething in my brain is wrong because of so many horror video games, like silent hill.00:51
AlexLikeRockheheheh00:55
systemdleteI might just be losing my mind (once more), but isn't shell supposed to find executables by examining the PATH envar?  I am seeing some behavior that seems to be at variance with this.  I've been using shells for 45 years and I've never seen anything like this before.   I MUST be overlooking something.01:37
systemdleteafaik, I am not aliasing the command.   It's a shell script, which I am running from the current directory I am in.  But the PATH does NOT include "." (at, say, the beginning of $PATH), and the current directory is NOT in the PATH either.01:38
systemdleteIs there some option set somewhere that allows the shell to look at the current directory for executables?  Or does it work differently for shell scripts?01:39
systemdleteOh, this is bash.  Maybe there are some new semantics added recently I am not aware of.01:39
systemdlete(but I doubt it)01:39
systemdleteI tried "hash -r" to see if maybe something was sticking in the interpreter's brains.01:40
rrqon can run ./script also in scripts01:43
systemdlete?01:43
systemdleteI'm not running it as "./xyz" just as "xyz"01:44
systemdleteno relative path, no01:44
systemdlete(sorry that was not clear)01:44
rrqwhat does `which xyz` say?01:44
systemdleteshows me current directory pathname01:44
systemdleteoh wait01:45
systemdleteno01:45
systemdleteit actually says "./xyz"01:45
systemdletebut "." is NOT in my PATH01:45
systemdletethis doesn't happen in other directories.   This is in a mounted fs /opt01:45
rrqI guess you've verifide (many times).. echo $PATH01:46
systemdleteso if I copy xyz to /tmp, e.g., and try to do the same thing, it won't run.  I have to explicitly state the path or use relative ./xyz01:46
systemdletewhat is "verifide"--(my english is good, but maybe not perfect)01:47
systemdletethe current working directory is NOT in my PATH envar01:47
rrq(sorry my fingers swapped) ... and there is no empty element in $PATH01:48
systemdleteno, no "::" anywhere in it01:48
rrqlike ending in :  or having ::01:48
systemdletenope01:48
rrqand `/usr/bin/which xyz` says ./xyz01:49
systemdletehmmmm.  interesting:  set -x shows that command is not found!  And doesn't run the script.  But if I turn it off again, it acts normally again.01:50
systemdletewtf?????01:50
systemdleteset -x healed the problem ??????!!!!!01:50
systemdletebtw, echo $0 shows /bin/bash, not -bash01:52
systemdleteIdk if maybe that had something to do with it01:52
systemdleteI hope this VM is not diseased...01:52
rrqin my mind: the command line in bash does include aliases and functions ahdn hashed resolutions, all before resolving the command word bmo path01:54
systemdleteyes, and I checked for that.01:54
systemdleteI saw nothing.01:54
systemdletesorry, I just looked again, and it is a -bash after all.  the parent is a /bin/bash01:55
rrqand the local directory is not found as a $PATH point ?? with possible links etc?01:56
systemdletebut the short story is (TL;DR version) is that by calling "set -x" running the script (fails of course) and then "set +x" it unscrews the problem.01:56
systemdleteno, and no01:56
systemdlete(I checked that also before hitting the channel here)01:57
systemdlete(but still good to ask me)01:57
systemdleteyeah, I looked for links, aliases, envars (including PATH, LD_LIBRARY_PATH, etc)01:57
rrqand LD_PRELOAD01:57
systemdleteI know LD_LIBRARY_PATH should not influence this, but I was checking everything01:58
systemdletenot set01:58
systemdleteLD_PRELOAD is not in my environment01:58
rrqhmmm some bash completion activity? ... is there some "pre-command-execution" bash variable01:59
systemdleteenv |grep bash shows just SHELL=/bin/bash02:00
systemdletebut that might not be thorough enough02:00
systemdleteI opened another shell window (XFCE) and I don't see the original behavior there. It seems to have jsut been this one shell02:01
systemdletewhat is the ps fu for listing all the processes whose ppid is x?02:01
rrqany "trap DEBUG" setting?02:01
systemdletetrap (with no args or options) shows nothing02:01
systemdleteoh, nvm. --ppid02:02
rrqps -lww $(ps -hoppid,pid | awk '$1='$PPID'{print $2;}')02:02
rrqah --ppid is easier :)02:03
systemdleteps -f --ppid is shorter, but thanks for the effort!02:03
systemdleteI missed it the first 2 times I scanned the ps man page02:03
systemdleteI never noticed this before, but xfce-terminal launches all the shell windows.  For some reason, I thought each shell was launched by a xfce4-terminal instance.  Dumb me.02:04
systemdletetil02:04
systemdletewell, rrq, I may have picked your brains thoroughly enough.  I will wait and see if I notice this again and come back here with the evidence.02:05
systemdletethat is so weird how setting trace and unsetting it "fixed" the problem.02:06
systemdleteagain, it was only happening in one directory02:06
rrqyes.. that suggests some hashing I guess02:06
systemdletea giant security hole even if it is somehow intermittent02:07
rrqdid you experiment and try using other than xyz name ? if that command name is special (sometimes)...02:08
systemdleteoh, actually I used "tst" after my original script (by a diff name) started doing this02:09
systemdleteI wrote a short and dirty one liner, put exec perms on it, and tested that script02:09
rrq"When bash  is  not in  posix  mode, it searches the current directory if no file is found in PATH."02:09
systemdletegot the same behavior (before I tried the set -x/set +x thing)02:09
systemdleteah02:09
rrqthat's for the "source" command02:10
systemdletegood catch!!!02:10
systemdleteso set +x threw the shell back into posix mode then?02:10
systemdleteis there a way to get the posix mode ?02:12
systemdleteI have another window where the issue is happening02:12
systemdleteand I know why this window is different:  I launched it via ssh.02:13
systemdleteso it is a /bin/bash not a -bash02:13
systemdleteit is interactive and works fine, but it does not seem to know it is02:13
systemdleteso I am launching it (from Desktop file) as02:14
rrqenv POSIXLY_CORRECT is set in posix mode02:14
systemdletexfce4-terminal -e "ssh myuser@localhost" -T windowtitle02:15
systemdletewell, normal window (using default launcher as installed by system originally) correctly fails to find the "tst" script in the cwd, but echo $POSIXLY_CORRECT is not set02:16
systemdleteso none of my shells are politically correct then  :(02:17
systemdletebut the ssh explains why I am seeing the behavior, POSIXLY_CORRECT notwithstanding02:17
systemdleteok, now things make sense at least02:17
systemdleteI could have rubber ducked this, but chatting with you probably saved a lot of time02:18
systemdleteand you gave me some good ideas for next time I am trying to figure something like this out02:18
rrqcheers02:19
systemdletebut, rrq, I wonder if there could be security considerations for this02:19
systemdletehopefully, no untrusted user would gain ssh access to a system in the first place, but still02:20
systemdleteyeah, thanks.  later, unless you have more to suggest02:21
rrqI'm emptied for now :)02:21
systemdletenw02:21
rwpsystemdlete, Is /tmp a mount point mounted with the noexec option?06:00
rwpThough I may be misunderstanding your problem.06:01
rwpNote that back 45 years ago it was typical to have '.' in PATH but now that is seen as bad practice due to social engineering attacks and so now '.' is never in PATH by default and it is considered bad practice now.06:01
rwpMeaning that if it is in the current directory then you must use ./foo to execute it.06:02
fluffywolfI once had fun crafting malicious filenames with terminal escape sequences in them on a sunos box...  having . in $PATH would have been even more options for fun.  :P06:18
systemdleteI do not add "." to my path, ever.   And, yes, 45 years ago it really was typical to add it to the path (if it wasn't already).06:27
systemdletethe /tmp wasn't where the problem was occurring.  It was on a different file system.06:27
systemdletejust to clarify06:27
systemdleteyes, the /tmp file system is mounted with noexec.  But so is the other one.06:28
systemdletethe mount options are identical, in fact, I just noticed06:39
systemdleterwp, I think the distinction comes down to whether the shell is invoked as /bin/bash (as with ssh) or as -bash (as with local xfce terminals).07:14
joerg>><systemdlete> it actually says "./xyz"  <systemdlete> but "." is NOT in my PATH<< tried `rehash` ? (alias `hash -r' )17:01
joerghash: hash [-lr] [-p pathname] [-dt] [name ...]17:03
joerg    Remember or display program locations.17:03
joergbash builtin17:03
joergalso `hash -t xyz` [analog to `which xyz`]   - *prior to* a `hash -r` ;-)17:09
joergoh sirry, missed the >><systemdlete> I tried "hash -r"<<17:15
joergwhat is >>it is a -bash<<?17:20
joerg>>shell is invoked as […] -bash<< doesn't make sense to me17:21
rwpIf systemdlete were here I would ask, And what is that difference that you observe is causing you problems?17:44
rwpWhen invoked as /bin/bash or bash then bash reads ~/.bashrc only and no other file but will inherit some environment from the calling process.17:45
rwpWhen invoked as -bash then it is a login shell and after inheriting whatever environment it will read .bash_profile or .profile and then do whatever it is instructed to do there and will NOT read ~/.bashrc by default but only if instructed in a profile.17:46
rwpWHen invoked as #!/bin/bash then it is a non-interactive script and if $ENV is set then will read it.  Best never to set ENV because it is a breaker of scripts most often.17:47
joerg-bash: -bash: command not found22:12
fsmithredYeah, I was wondering if maybe it's supposed to be 'bash -' which is the same as 'bash --'22:51
fsmithredto mark the end of options22:51
AlexLikeRock0/22:55
yetilogin shells appear as -/bin/bash in the ps list, but I think they getr started via  bash --login  or  ... -l23:10
yeti"""yeti        2362  0.0  0.0  11308  4056 pts/1    Ss+  Jul27   0:00 -/bin/bash23:10
yeti"""23:10

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!