Author Topic: efuns?  (Read 5956 times)

Offline petriomelony

  • Acquaintance
  • *
  • Posts: 34
    • View Profile
efuns?
« on: April 11, 2009, 09:16:59 PM »
Hello everyone,

I just started looking at Skylib, and so far it looks awesome.  A big thanks to Cratylus for making the bundle that works on windows :)

I ran into a bit of a problem with the 'grep' command internal to the mud, and traced it back to an external_start efun.  The mud says:

Code: [Select]
/secure/cmds/creator/grep.c line 61: Undefined function external_start before ;

where line 61 is where grep.c uses external_start:

Code: [Select]
    if( nfiles || !search )
        fd = external_start( 6, arg, "read_call_back",
            "write_call_back", "close_call_back");
    else
        return notify_fail("Grep needs at least one file.\n");

    if( fd == -1 )
        return notify_fail("Grep failed for some reason.\n");

looking at the help file for external_start, it says the first parameter passed should be an int, for one of five external commands specified in the config file.  could the fact that it's a 6 be messing it up?

i'm running skylib right out of the bundle (with the included fluffos-2.9).

any advice would be greatly appreciated! :)

Offline Ajandurah

  • Acquaintance
  • *
  • Posts: 22
    • View Profile
Re: efuns?
« Reply #1 on: April 12, 2009, 07:08:40 AM »
Sounds like the driver was compiled without PACKAGE_EXTERNAL defined in local_options hence the undefined function error.  Since your using windows, I would assume this is due to support for exec() within whatever compiler was used to build it.

The only way to enable this is to re-compile the driver from source and make sure that PACKAGE_EXTERNAL is defined.

Offline petriomelony

  • Acquaintance
  • *
  • Posts: 34
    • View Profile
Re: efuns?
« Reply #2 on: April 12, 2009, 08:03:20 AM »
Sounds like the driver was compiled without PACKAGE_EXTERNAL defined in local_options hence the undefined function error.  Since your using windows, I would assume this is due to support for exec() within whatever compiler was used to build it.

The only way to enable this is to re-compile the driver from source and make sure that PACKAGE_EXTERNAL is defined.

You are correct!  I found the local_options file (local_options.skylib) and it has #undef PACKAGE_EXTERNAL.

Now I'm wondering if it's really worth it to try and recompile with the changed option, or whether Cratylus disabled it for a good reason.  I guess it's not that big of a deal if I can't use grep.

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1020
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: efuns?
« Reply #3 on: April 12, 2009, 08:03:32 AM »
Sounds like the driver was compiled without PACKAGE_EXTERNAL defined in local_options hence the undefined function error.  Since your using windows, I would assume this is due to support for exec() within whatever compiler was used to build it.

The only way to enable this is to re-compile the driver from source and make sure that PACKAGE_EXTERNAL is defined.

Righto. I'm sorry to sound unaccommodating, but I'm not planning to
make a compiled executable release of Fluff for Win with external
commands enabled.

I don't even know if it's especially tricky to do, but I'm afraid I have to
confess a religious preference against the mud running external
programs unless you are not only leet enough to understand what you're
doing thoroughly, but also leet enough to enable it for yourself.

This might be bad of me....if so I apologize for the elityness or whatever.
But I do feel strongly about this.

I'm also kind of surprised that any lib would do this as a matter of course.
Apparently the dw lib does this too. Maybe if I have time I'll replace the
grep in those distlibs with an LPC only grep. Don't hold your breath tho :(

-Crat

Offline petriomelony

  • Acquaintance
  • *
  • Posts: 34
    • View Profile
Re: efuns?
« Reply #4 on: April 12, 2009, 08:09:01 AM »
Crat, you're not unaccommodating!  Don't be silly.

I think that I'm a fair newbie at LPC, so I appreciate the fact that you're watching out for us, making sure we don't do more damage than necessary.

And like you said in another post, I can always just use windows explorer to search through files, if I'm desperate :)

Offline quixadhal

  • BFF
  • ***
  • Posts: 642
    • View Profile
    • WileyMUD
Re: efuns?
« Reply #5 on: April 12, 2009, 12:35:26 PM »
I'm also kind of surprised that any lib would do this as a matter of course.
Apparently the dw lib does this too. Maybe if I have time I'll replace the
grep in those distlibs with an LPC only grep. Don't hold your breath tho :(

*holds his breath*
...
...
*gasps*

So, when you gonna give in and just port bash to lpc???  Huh?

*holds his breath*
...

Offline Raudhrskal

  • BFF
  • ***
  • Posts: 214
  • The MUD community needs YOUR help!
    • View Profile
Re: efuns?
« Reply #6 on: April 12, 2009, 12:48:23 PM »
Bleh, bash. ZSH ftw! (not to mention that bash in on a @#$%#$% GPL, as opposed to MIT-like in case of zsh).
I think, therefore i may be wrong.
Please note that if you met a Raudhrskal in a place that's not related to muds, it wasn't me. *sigh*... back when I started there was zero hits on google for that name...

Offline Ajandurah

  • Acquaintance
  • *
  • Posts: 22
    • View Profile
Re: efuns?
« Reply #7 on: April 12, 2009, 12:53:03 PM »
lol, that would be a fun undertaking ;D

I've already ported GNU getopt (with long and short option parsing), the full ls command and a few other GNU tools to lpc for use on Demonslair.  The creators shell is much more Linux alike than most, though not up to bash levels.  I too do not like the external commands addition, and took to writing lpc versions of the commands we used, hence the getopt port, things kinda went overboard once that was working.  ::)

Offline quixadhal

  • BFF
  • ***
  • Posts: 642
    • View Profile
    • WileyMUD
Re: efuns?
« Reply #8 on: April 12, 2009, 08:16:16 PM »
Bleh, bash. ZSH ftw! (not to mention that bash in on a @#$%#$% GPL, as opposed to MIT-like in case of zsh).

bash **BASHES** zsh over the head!

I do, however, agree with the evils of GPL.  However, if it were re-implemented in lpc, it wouldn't be GPL anymore (assuming it were re-coded and not just line-for-line translated).

Offline Qwer

  • Acquaintance
  • *
  • Posts: 9
    • View Profile
Re: efuns?
« Reply #9 on: April 15, 2009, 07:05:27 AM »
Righto. I'm sorry to sound unaccommodating, but I'm not planning to
make a compiled executable release of Fluff for Win with external
commands enabled.

I don't even know if it's especially tricky to do, but I'm afraid I have to
confess a religious preference against the mud running external
programs unless you are not only leet enough to understand what you're
doing thoroughly, but also leet enough to enable it for yourself.

This might be bad of me....if so I apologize for the elityness or whatever.
But I do feel strongly about this.

I'm also kind of surprised that any lib would do this as a matter of course.
Apparently the dw lib does this too. Maybe if I have time I'll replace the
grep in those distlibs with an LPC only grep. Don't hold your breath tho :(

-Crat

Discworld comes with an LPC based grep already, but not an LPC version of the diff utility.

If you're worried about security in the packages you provide, one option is that you could enable the external commands but comment out the "external_cmd_n" entries from the provided configuration file.
« Last Edit: April 15, 2009, 07:07:36 AM by Qwer »