Script

Gerhard Häring gh at ghaering.de
Mon Aug 4 09:31:34 EDT 2003


zze-Support activite PCL RAMSI A ext DvSI/SIReS/LAN wrote:
> Hello everybody,
> 
> I try to execute an ifconfig command in my python code using:
> stat, wdsout = commands.getstatusoutput("./script.sh " + interface + " " 
> + ipadrr)
> 
> The script.sh executes the ifconfig command as:
> Ifconfig $1 plumb && ifconfig $1 $2 netmawk 255.255.255.0 up
> 
> this script is created by the root, and have 4755 as chmod.
> 
> When the script is executed by th root, it works normaly but when it's 
> launched from the python file it doesn't work:
> and i have a Permission denied message.
> 
> Is something wrong in what I do?

Yes, non-root users cannot set IP addresses or netmasks on Unix.

All they can do is query this information, but not change it.

-- Gerhard





More information about the Python-list mailing list