Starting PERL Script

I have a simple PERL script that sorts through a CSV address file and outputs a file formated for printing labels.

Typing the filename in a terminal window in the directory of the file, results in a not found in the form

If ‘all_labels’ is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf all_labels

But when I run the program from the parent directory like this

…/labels/all_labels

It runs just fine.

Any Idea why this is happening in SuSE 11.3… it ran OK in an older version of SuSE.

On 2011-10-26 03:26, orrinsam wrote:

> Typing the filename in a terminal window in the directory of the file,
> results in a not found in the form

As it should be.

A program can not be run unless it is in the $PATH. You can bypass that
rule if you specify the path, like ./program


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

As an addition to the above, I would suggest to put your executables in the directory bin within your home directory. That directory is by default in your PATH environment variable. From then on you can type

all_labels

from anywhere to start it.

I found that in YAST, the option for adding the ‘dot’ to the user path is suppose to be default to YES. For some reason, mine got set to NO. I clicked on the default and everthing works now.

Since this is a single user system, the security risk is minimal.

So you never connect to the Internet? It’s “user-friendly” stuff like that that makes MS Windows so “secure”.

Only when that “single user” is never making mistakes, the security risk is minimal. But let every generation experience these things the hard way.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Looking in Yast I do not see any reason this should be a default. The
option is there, both for ‘root’ as well as for other users, but it is
not a default and never should be. If you really want a command to work
as described you should put it in your PATH which could be as simple as
putting it in the ‘bin’ directory within your own user’s home directory.
Having your CWD in your PATH means anytime somebody (as mentioned by
eng-int, including via something from the Internet that you don’t
expect, because that’s how they all are) happens to put ‘ls’ in your
home directory (because you have rights there) and you then run ‘ls’
whatever code is in there will trump the system’s ‘ls’ command and your
user is now compromised, assuming you don’t have system rights in which
case your entire system is gone even though you knew you only ran the
‘ls’ command.

Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOqE01AAoJEF+XTK08PnB5xVAP/iESBWc4J/z1DPaCsB0P4jAE
nkDkDzxAnh1rO0gJzvKQ+NkZGoxsx5hc+17xUfMzXzicUNrOjXYHS4/L43V5tO75
ohOtw5gaAAnhGi78mC+sYEbpYC6TbD/hLjKwrhEFopWOJWssHu5hbKSnIRSN1LXe
TANxFmI/kfF2kILoxb1tOaynUaNwqJbizBK7zHrIJYo79UJwX1fqx5OKGD+WkDJY
GQ1R8KjdCFfMqN7efq5arZEwtn/oiKbgHFfQt+aX3SepsvdvVArKyRLK0MzPG6jX
O4BrrbUF8IAGb79CFkhdDC6MWI4kUaXYTVnGu2DagZX03gwQYnIPYzA8zvIM/9kD
M8Khm4P1A1Hea5VQ2MQQjmM+Tu4UTYK7VSKPOp4eFco/dlnuT1KRQi4bucXwkW4z
MQiNKtUzJW1OK1KhoR/p4DvBrduX7iDghCzxo2Lg88h2J0nDgJa6nTIzaiu3meuX
/fOOzLxpQkWEpJLUT81pWJw7/c6rdrijR30+FxBazyzAOgOjR4B/mzf6eIPS+6KS
L+9O4JkTaTe5ePY2E8ORkjmZZVQTGpENRcvL6bs89Nf2tAvHB+FLiWZMWEX7gyH0
jjkrxSL1ZHqTWZqBOSCnVkPNLeMiCk4htRHyFyY7x5BIYLRRZW2oHfWUKyrF+yxk
0iPxupkHhULOP1emoA2d
=ZR/E
-----END PGP SIGNATURE-----

This is from YAST in 11.3

Possible Values: yes,no
Default Value: yes
Configuration Script: groff
Description:

Do you want to have “.” in the path for normal users?
Defaults to “yes” since this has been the case for years.

This is serious misinformation.

I have been using SuSE/openSUSE since it was SLS, and I cannot recall it ever having these insecure $PATH defaults. This is the Description/Help message from YaST in 11.4 – it’s the same in 11.3:

By default the current working directory is not used when searching for executables.
Some systems set up a work-around by adding the dot (“.”) to the search path, enabling files in the current path to be found and executed. This is highly dangerous because you may accidentally launch unknown programs in the current directory instead of the usual systemwide files. As a result, executing Trojan Horses, which exploit this weakness and invade your system, is rather easy if you set this option.
This setting applies for root user and system users.

If your system is otherwise then it is seriously misconfigured, and should not be trusted until you satisfy yourself as to how it has arrived at that state.

eng-int wrote:

>
> orrinsam;2397682 Wrote:
>> This is from YAST in 11.3
>>
>> Possible Values: yes,no
>> Default Value: yes
>> Configuration Script: groff
>> Description:
>>
>> Do you want to have “.” in the path for normal users?
>> Defaults to “yes” since this has been the case for years.
>
I can see the same text in yast and I am surprised to see it (started with
S.u.S.E. 16 1/2 years ago in early '95) I cannot remember (am I getting so
old that I can’t remember) that . was ever part of the users default path.
And it is exactly not by default set to yes on any of my systems. So what
will yast tell us here?


PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
| 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.2 | nVidia
ION | 3GB Ram

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If Yast ever says that, it’s wrong. I too am looking on OpenSUSE 11.3
under ‘Security and Users’ and then under ‘Local Security’ and finally
in the ‘Miscellaneous Settings’ area. The help information there does
not state this is/was a default at any time, and also outlines some of
the security considerations.

Regardless of what is being read, the fact is that this option is erring
on the side of foolishness; use at your own peril despite better
alternatives such as your own user’s ‘bin’ directory.

Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOqG1ZAAoJEF+XTK08PnB5xMEP/3CkqPGC4mfg0a1WwOgPBfYm
bgzUsrHbmRq8fI7Ca6vL3qb1742bdsViLDkTMaU35Aq8ztxxfhyr/huboQ18h5g4
WIQmryZWE/2WkgcbY4aPmDvimGUSj1IU728MFp+YSTj0IIUd974YA9Y2XPOn9YAW
ybXmhEIl+pnzfheuKg9DsZIwH81+enAG8UEEsEHKurCS+G7VQyjXtHYXegc6SJxd
C73oo3pFGs6qrnMFFOfyvU/8VUvVjQRSH6t44k01higLwDm4x5uJYllF5sO8mAI2
GRgz2oI5EiPpyB3E4V5Lljx9QRVK7PYB7pj6oy+wl4HosHM0XDHTceoa+QnV/mh/
oBA7Mp8ttJixxGUS3Q+RWn2sZWMHRlFvYbEM8wJIadaEGvUXvl0ry/zKGpcB34Mq
aFBfggez4DVY65oaSNsMsfU4ZIdtCW7TzQ+OqK9AHJF7n2tNF5OGi9VlRg+2qAQL
D3bXXRjaRez/HfAsi86DjdJczoezDQCiPuQiR6q8P5gmDV5CUB5/lZnDRjNpSTqt
1pqRGmrhP3eRdkkshkETiOCSOY2e6ZVbwrfZB9WAm9adVac88GvBU7dUxcxcRzPc
DWFyAbJB+woQyEg3FZlWhq04X/U7ieec9bRIusfgGXOynreOZG1tphsvYgUKfvAt
7PjzqkCb4AV7It9gGNEV
=q+5p
-----END PGP SIGNATURE-----

ab wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> If Yast ever says that, it’s wrong. I too am looking on OpenSUSE 11.3
> under ‘Security and Users’ and then under ‘Local Security’ and finally
> in the ‘Miscellaneous Settings’ area. The help information there does
> not state this is/was a default at any time, and also outlines some of
> the security considerations.
>
Look at
yast → system → /etc/sysconfig editor → system → suseconfig →
cwd_in_user_path
to see it.


PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
| 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.2 | nVidia
ION | 3GB Ram

On 2011-10-26 19:46, orrinsam wrote:
>
> I found that in YAST, the option for adding the ‘dot’ to the user path
> is suppose to be default to YES.

IIRC it was changed to NO, for good reason.

> Since this is a single user system, the security risk is minimal.

Not quite.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

There are three places in YAST where this option can be set.

  1. Security Center and Hardening, in the Overview section.

  2. Security Center and Hardening, in the Miscellaneous Settings sections.

  3. In the etc/sysconfig editor, SuSEconfig CWD_IN_USER_PATH where it is exactly as orrinsam says.

Even though the default in (3) is “Yes” and will change to “Yes” if you click on the default button, it is in fact set to “No” during install.

The potential for confusion is obvious. At least the description in the etc/sysconfig editor needs to be changed to warn of the security implication.