[prev in list] [next in list] [prev in thread] [next in thread] 

List:       novalug
Subject:    Re: [ma-linux] su question
From:       Don Libes <don () libes ! com>
Date:       2004-06-29 15:16:08
Message-ID: 40E187B8.1040101 () libes ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


You could do this with an Expectk script.  The script itself would not 
be setuid.  It would merely su at the appropriate time and feed the 
password and commands to it.

The tkpasswd example in the Expect distribution demonstrates this idea.  
It presents the user with a GUI which prompts for a password.  The 
script then passes it off to the setuid program as if the user had typed it.

Don


Linux wrote:

> My question is how to implement a function or program, which can 
> change its state to superuser mode and E.g. install an application 
> under /usr/bin
>
> a bash script (which does not work because I can not pass the password 
> through a programm to the tty (as su is not using stdin)) would look 
> something like
> > su - root -c /tmp/make_install.sh
>
> However the user would have to type the password on the shell where he 
> started the program fcrom and I can not use a GUI interface to ask or 
> the password.
>
> However since the su command exists it is proof that this would be 
> possible somehow.
>
> Varol :(
>
> John S J Anderson wrote:
>
>>Linux <linux@movingsatellites.com> writes:
>>
>>  
>>
>>>Guys I got a question,
>>>
>>>I am writing a GUI to install a SW and I want to let the user type in
>>>the root password and then do the install in the specified
>>>directories. When I google I get a zillion hits but I could not find
>>>the right one.
>>>
>>>I am using Trolltech's Qt but any C / C++, or even bash solution will help.
>>>    
>>>
>>
>>  what is your actual question? you don't seem to have asked one, just
>>  said what you're trying to do. 
>>
>>john.
>>  
>>
>------------------------------------------------------------------------
>
>_______________________________________________
>ma-linux mailing list
>ma-linux@tux.org
>http://www.tux.org/mailman/listinfo/ma-linux
>  
>


[Attachment #5 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
You could do this with an Expectk script.&nbsp; The script itself would not
be setuid.&nbsp; It would merely su at the appropriate time and feed the
password and commands to it.<br>
<br>
The tkpasswd example in the Expect distribution demonstrates this
idea.&nbsp; It presents the user with a GUI which prompts for a password.&nbsp;
The script then passes it off to the setuid program as if the user had
typed it.<br>
<br>
Don<br>
<br>
<br>
Linux wrote:
<blockquote cite="mid40E1704D.7080506@movingsatellites.com" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
My question is how to implement a function or program, which can change
its state to superuser mode and E.g. install an application under
/usr/bin<br>
  <br>
a bash script (which does not work because I can not pass the password
through a programm to the tty (as su is not using stdin)) would look
something like <br>
&gt; su - root -c /tmp/make_install.sh<br>
  <br>
However the user would have to type the password on the shell where he
started the program fcrom and I can not use a GUI interface to ask or
the password.<br>
  <br>
However since the su command exists it is proof that this would be
possible somehow.<br>
  <br>
Varol :(<br>
  <br>
John S J Anderson wrote:<br>
  <blockquote cite="mid86n02mblto.fsf@mendel.genehack.org" type="cite">
    <pre wrap="">Linux <a class="moz-txt-link-rfc2396E"
 href="mailto:linux@movingsatellites.com">&lt;linux@movingsatellites.com&gt;</a> \
writes:

  </pre>
    <blockquote type="cite">
      <pre wrap="">Guys I got a question,

I am writing a GUI to install a SW and I want to let the user type in
the root password and then do the install in the specified
directories. When I google I get a zillion hits but I could not find
the right one.

I am using Trolltech's Qt but any C / C++, or even bash solution will help.
    </pre>
    </blockquote>
    <pre wrap=""><!---->
  what is your actual question? you don't seem to have asked one, just
  said what you're trying to do. 

john.
  </pre>
  </blockquote>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
ma-linux mailing list
<a class="moz-txt-link-abbreviated" \
href="mailto:ma-linux@tux.org">ma-linux@tux.org</a> <a class="moz-txt-link-freetext" \
href="http://www.tux.org/mailman/listinfo/ma-linux">http://www.tux.org/mailman/listinfo/ma-linux</a>
  </pre>
</blockquote>
<br>
</body>
</html>



_______________________________________________
ma-linux mailing list
ma-linux@tux.org
http://www.tux.org/mailman/listinfo/ma-linux


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic