how to change the effective user identficator

Discussion in 'Perl' started by Daneel Yaitskov, Jul 20, 2008.

  1. Hi,


    I can't change the EUID of a perl process which performs a perl script.
    I used the manual perlsec and wrote the script:

    #!/usr/bin/perl

    use English '-no_match_vars';

    $EUID = 0;
    open(THEFILE, ">/var/log/messages") || die "can't open file";
    print "The file was opened\n";
    #end of the script

    The script file has the rights:
    $chown root:root test.pl
    $chmod a+xs test.pl
    The script gives the error "can't open file"


    Daneel
     
    Daneel Yaitskov, Jul 20, 2008
    #1
    1. Advertisements

  2. [Forwarding to CLPM because CLP is obsolete]
     
    Jürgen Exner, Jul 20, 2008
    #2
    1. Advertisements

  3. [Forwarding to CLPM because CLP is obsolete]
     
    Jürgen Exner, Jul 20, 2008
    #3

  4. I don't know what is CLPM. I didn't find definition of CLPM or CLP in
    manuals: perl, perltoc and perldoc CLPM. Please, hint where can I read
    about it.



    Daneel
     
    Daneel Yaitskov, Jul 20, 2008
    #4

  5. I don't know what is CLPM. I didn't find definition of CLPM or CLP in
    manuals: perl, perltoc and perldoc CLPM. Please, hint where can I read
    about it.



    Daneel
     
    Daneel Yaitskov, Jul 20, 2008
    #5
  6. comp.lang.perl.misc

    comp.lang.perl has been rmgroup'ed and replaced with the
    comp.lang.perl.* hierarchy over a decade ago.
    perldoc -q usenet

    jue
     
    Jürgen Exner, Jul 20, 2008
    #6
  7. comp.lang.perl.misc

    comp.lang.perl has been rmgroup'ed and replaced with the
    comp.lang.perl.* hierarchy over a decade ago.
    perldoc -q usenet

    jue
     
    Jürgen Exner, Jul 20, 2008
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.