Em primeiro lugar, o que esse teu shell script tenta fazer?

 Checou pra ver se tem algum "comando" dentro deste shell que s� o root pode 
executar?

 Abra�o

 Yucatan

Legends tell that on Monday 15 November 2004 22:16, [EMAIL PROTECTED] 
wrote:
> Blz, pessoal, estou com um problema aqui com um script, que estou fazendo,
> ele at� que executa legal como root, mas como usu�rio normal, ele n�o vai,
> j� setei suid no arquivo, mas mesmo assim.... nada
>
> Qdo executo como usu�rio normal, d� esse erro :
>
>
> Deseja adquirir um endereco virtual? (s)im ou (n)ao ?
> s
>
> Indique um endereco IP
> 192.168.0.3
>
> SIOCSIFADDR: Permiss�o negada
> SIOCSIFFLAGS: Permiss�o negada
>
> ______________________________________________________________________
>
> Aqui vai o script...
>
>
> #!/bin/bash
> #Script em bash para atribuicao de ip a uma interface virtual
>
> i=`/sbin/ifconfig -a |grep eth0:* |cut -c 6|sort|tail -1`
> export i
>
>     n_root="su -c 'ifconfig eth0:`expr $i + 1` $IP'"
> opt=s
>
> clear
>
> while [ "$opt" = s ] ; do
> echo "Deseja adquirir um endereco virtual? (s)im ou (n)ao ?"
> read opt
>
>     if [ "$opt" = s ] ; then
>      echo "Indique um endereco IP"
>      read IP ; export IP
>
>   id | cut -c 5 > /dev/null
>
>       if [ "$?" = 0 ] ; then
>        /sbin/ifconfig eth0:`expr $i + 1` $IP > /dev/null
>         opt=n
>
>        else
>
>         echo "Entre com a senha de root"
>         exec $n_root
>        clear
>
> opt=n
>
>      fi
>
>       elif [ "$opt" = n ] ; then
>        echo "Ate a proxima :)"
>
>        elif [ "$#" = 0 ] ; then
>           echo "Erro ! Responda apenas (s) ou (n)"
>         opt=s ; sleep 2
> clear
>      fi
>          done
>
> ___________________________________________________________________________
>______
>
> [EMAIL PROTECTED]:~$ ls -l tmp/shellscript/eth0_virtual.sh
> -rwsr-sr-x  1 root root 1034 2004-11-15 22:00
> tmp/shellscript/eth0_virtual.sh
>
>
>
> Obrigado pela aten��o...
> Guilherme
>
> ---
> iBestMail, agora com POP3/SMTP e 120MB de espa�o!
> Experimente: http://www.ibestmail.com.br

-- 
(http://kenjiro.web.terra.com.br)
Linux Counter: #163748

==========================================
There is no Emotion, there is Peace
There is no Ignorance, there is Knowledge
There is no Passion, there is Serenity
There is no Death, there is the Force

--
GUS-BR - Grupo de Usuarios Slackware - BR
http://www.slackwarebrasil.org/
http://www.linuxmag.com.br/mailman/listinfo/slack-users

Responder a