Re: C set-user-ID program wrapper for Perl script and security



"Malcolm McLean" <regniztar@xxxxxxxxxxxxxx> writes:

<s0suk3@xxxxxxxxx> wrote in message news:
On Aug 31, 3:18 am, Keith Thompson <kst-u@xxxxxxx> wrote:
Peter Michaux <petermichaux@xxxxxxxxx> writes:
On Aug 30, 3:03 pm, "Malcolm McLean" <regniz...@xxxxxxxxxxxxxx> wrote:
it is reasonable to hardcode paths in a Perl script,
much less sensible to do so in a C program.

Why is that?

Speaking as both a C programmer and a Perl programmer, I can't think
of any good reason.


Perl is typically used as a "scripting language", i.e., a glue
language, a language to automate typical tasks, a test driver, etc.

C programs are usually targeted at more serious tasks and are
therefore better structured and developed with maintainability and
reusability in mind. Thus, there's no reason why such a program would
have hard-coded paths, except for example during testing.

That's the answer. Hardcoded paths are a nuisance in a C
program. Typically C source is thousands of lines long, and the
executable might be detached from the source for use. So its a big job
to change the paths.
On the other hand users expect Perl scripts to contain
paths. Typically they are quite short and farm out most of the
"serious" work to other programs. Perl started as a glorified shell
script, after all.

You have just stated that they exist. There is still no good reason why
hard coded paths *should* exist in Perl any more than they should in C.
.



Relevant Pages

  • Re: OT: script languages
    ... I wonder what scrip language is better: Perl or Phyton? ... }> Additionally, Python ... compact solutions to common scripting problems. ...
    (Debian-User)
  • Choosing Perl/Python for my particular niche
    ... expedient than C++, bash scripting, or sed scripting. ... hardware desscription language and converts it ... Perl is used alot in digital IC design, ... to avoid reinventing things, or impediments to sharing ...
    (comp.lang.perl.misc)
  • Choosing Perl/Python for my particular niche
    ... expedient than C++, bash scripting, or sed scripting. ... hardware desscription language and converts it ... Perl is used alot in digital IC design, ... to avoid reinventing things, or impediments to sharing ...
    (comp.lang.python)
  • Re: Happy 7-8-9!
    ... see a lot of - JAVA, JAVA+, PERL, etc. HTML - just the formatting basic ... language for web presentation. ... learn to write PERL scripts - was not a joy for me - I'm not a web geek. ... is an amazingly elegant and effective scripting language. ...
    (rec.crafts.textiles.needlework)
  • Re: Object Rexx to become Open Source
    ... VBScript is less likely to result in overly ... If you call it a beginner's language because beginner's are able to pick it ... as provided by some other scripting languages, I have found it a significant ... Microsoft even use PERL internally. ...
    (microsoft.public.scripting.wsh)