suidperl.
From: Rod Za (rodzadra_at_yahoo.com)
Date: 03/25/05
- Previous message: Jeff 'japhy' Pinyan: "Re: Module questions (perhaps a module creation mini-tutorial)"
- Next in thread: Jonathan Paton: "Re: suidperl."
- Reply: Jonathan Paton: "Re: suidperl."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 25 Mar 2005 11:52:06 -0800 (PST) To: beginners@perl.org
Hello all.
I'm trying to make changes in a file (smb.conf) that is owner by root (chmod=644). I'm using the
Config::IniFiles module to do the work and the script run as 'lp' user.
This is a piece of code:
<code>
if($self->{config}{AUTO_SMB_PRINTER}){
$self->log_it('DEBUG',"(D): Auto SAMBA printer on.");
my $smb_cfg = new Config::IniFiles( -file => '/etc/samba/smb.conf');
if (!$smb_cfg){
$self->log_it('DEBUG',"(D) Error on open '/etc/samba/smb.conf'");
$self->log_it('DEBUG',Dumper(@Config::IniFiles::errors));
}
if(!$smb_cfg->SectionExists("$self->{printer}")){
$smb_cfg->AddSection($self->{printer});
$smb_cfg->newval($self->{printer},'comment','Auto printer');
$smb_cfg->newval($self->{printer},'path','/var/tmp');
$smb_cfg->newval($self->{printer},'printable','yes');
$smb_cfg->newval($self->{printer},'browseable','yes');
$smb_cfg->newval($self->{printer},'guest ok','yes');
$smb_cfg->newval($self->{printer},'public','yes');
if($smb_cfg->WriteConfig('/etc/samba/smb.conf')){
$self->log_it('DEBUG',"(D): - Auto SAMBA printer OK.");
} else {
$self->log_it('ERR',"(E): - Error on Auto SAMBA printer: $!");
}
} else {
$self->log_it('DEBUG',"The printer exists.");
}
} else {
$self->log_it('DEBUG',"Auto SAMBA printer off.");
}
</code>
This doesnt works becouse the owner of the file is 'root'. How can i solve this? using suidperl?
thank you very much
Rodrigo
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
- Previous message: Jeff 'japhy' Pinyan: "Re: Module questions (perhaps a module creation mini-tutorial)"
- Next in thread: Jonathan Paton: "Re: suidperl."
- Reply: Jonathan Paton: "Re: suidperl."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|