• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
authopen or not
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

authopen or not


  • Subject: authopen or not
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Sat, 24 Jul 2004 14:48:33 +0200

I have an app which does:
int fd = open( "/dev/rdisk0s9", O_RDONLY, 0);
followed by several:
pread( fd, buffer, nbytes, adress);

Currently this app is setuid root, which is necessary in order to make the open() work.

But the fine (or fucking?) manuals tell me that: "running code as root is very dangerous and should be done as seldom as possible.
Setting the setuid bit on an entire application is especially dangerous because you are trusting that your entire application, and the code your application links to, is free of security holes."

So I looked at "/usr/libexec/authopen -stdoutpipe /dev/rdisk0s9".

But I do not quite understand the man page.

Do I get a open stream, so that I can read sequentially until EOF?
This would not do.

Or do I get a file-descriptor which I can pass to pread()?
This would be perfect.

In the latter case, could some kind soul tell me how to make this?
I am thinking of:
popen( "/usr/libexec/authopen -stdoutpipe /dev/rdisk0s9", 'r' );
but what about the dup2() mentioned in the authopen man page?

Or is fork(), and execle() the way to go?


Gerriet.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: authopen or not
      • From: Finlay Dobbie <email@hidden>
    • Re: authopen or not
      • From: Steve Checkoway <email@hidden>
  • Prev by Date: Re: The lock paradigm
  • Next by Date: Re: Forwarding to Super
  • Previous by thread: Re: Do drawers have controllers?
  • Next by thread: Re: authopen or not
  • Index(es):
    • Date
    • Thread