由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - how to use setuid permission for a perl program?
相关主题
[转载] Re: [转载] a UNIX permission question[转载] Re: about incoming email
文件删不掉How to open *.bin files?
please help, CGI..偷偷地问个超低级问题
from ftp, how to change permission怎么才能在Unix里连续跑10个c写的程序 (转载)
System Environment variables in PerlKorn shell script
问个删除文件的问题how to get rid of the ^M in files?
Re: [转载] a UNIX permission question[转载] Help! About PERL system()
怎么在FTP里改变文件属性?问一个关于批处理的问题,谢了!
相关话题的讨论汇总
话题: setuid话题: perl话题: program话题: permission话题: euid
进入Unix版参与讨论
1 (共1页)
s*******l
发帖数: 8
1
I have a perl program which will create a file. I set the setuid permission
for the perl program, say: chmod 6755 myperl.pl
Then, when I execute it as other users, either the created file is owned by
another user (say, root), or an error happened and the program can not be
run by others:
Insecure ENV{$PATH} ....
How to deal with this? Thanks a lot.
p******f
发帖数: 162
2

you are adviced to explicitly set the $PATH env var in a setuid perl
program, read 'man perlsec' for details.

【在 s*******l 的大作中提到】
: I have a perl program which will create a file. I set the setuid permission
: for the perl program, say: chmod 6755 myperl.pl
: Then, when I execute it as other users, either the created file is owned by
: another user (say, root), or an error happened and the program can not be
: run by others:
: Insecure ENV{$PATH} ....
: How to deal with this? Thanks a lot.

s*******l
发帖数: 8
3
What if the perl tries to install some program? Who will be the owner?
Thanks a lot.

【在 p******f 的大作中提到】
:
: you are adviced to explicitly set the $PATH env var in a setuid perl
: program, read 'man perlsec' for details.

p******f
发帖数: 162
4
the owner of the perl executable, if setuid.
the person who runs the executable, otherwies.

【在 s*******l 的大作中提到】
: What if the perl tries to install some program? Who will be the owner?
: Thanks a lot.

o***z
发帖数: 133
5
save the effective uid at the beginning by $euid=$EUID (if you use English)
then set it back to the real UID by saying $EUID=$UID
switch back to enhanced permission by $EUID=$euid only when necessary
and reduce to normal permission as early as possible

【在 s*******l 的大作中提到】
: I have a perl program which will create a file. I set the setuid permission
: for the perl program, say: chmod 6755 myperl.pl
: Then, when I execute it as other users, either the created file is owned by
: another user (say, root), or an error happened and the program can not be
: run by others:
: Insecure ENV{$PATH} ....
: How to deal with this? Thanks a lot.

1 (共1页)
进入Unix版参与讨论
相关主题
问一个关于批处理的问题,谢了!System Environment variables in Perl
how come this stupid question?问个删除文件的问题
C++5.0的初级问题Re: [转载] a UNIX permission question
where is libstdc++怎么在FTP里改变文件属性?
[转载] Re: [转载] a UNIX permission question[转载] Re: about incoming email
文件删不掉How to open *.bin files?
please help, CGI..偷偷地问个超低级问题
from ftp, how to change permission怎么才能在Unix里连续跑10个c写的程序 (转载)
相关话题的讨论汇总
话题: setuid话题: perl话题: program话题: permission话题: euid