• 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
Re: Environment/permissions on NSTask-launched app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Environment/permissions on NSTask-launched app


  • Subject: Re: Environment/permissions on NSTask-launched app
  • From: Brad Peterson <email@hidden>
  • Date: Wed, 19 Jul 2006 17:26:04 -0700 (PDT)

Hi,

Well, now I'm not sure that setuid() the right
approach either. A quick test from the sub-task's
output shows that

NSLog(@"gid = %d", getgid());

also shows 501.

A further quick & dirty test shows that the main app
is also unable to write data to the address book. So,
it's likely that the sub-task is inheriting something
from the parent despite the fact that (a) that's not
how it's supposed to work and (b) the sub-task insists
it's running as 501 and not as root.

Any thoughts would be appreciated. :)

Many thanks!

B

--- Sherm Pendley <email@hidden> wrote:

> On Jul 18, 2006, at 9:35 PM, Brad Peterson wrote:
>
> > I've confirmed that the sub-task isn't running as
> root
> > (though I don't know why that would make a
> difference)
> > by logging the results of a getgid() call. (501
> was
> > the result.)
>
> Getgid() gets the group id. And, it gets the *real*
> group id, not the
> effective group id, which is what running with
> elevated group
> privileges would change.
>
> Getuid() and geteuid() report the real and effective
> user id, and you
> can use setuid() to lower the privileges of a
> running app, if you
> need to.
>
> sherm--
>
> Web Hosting by West Virginians, for West Virginians:
> http://wv-www.net
> Cocoa programming in Perl:
> http://camelbones.sourceforge.net
>
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Environment/permissions on NSTask-launched app
      • From: Sherm Pendley <email@hidden>
References: 
 >Re: Environment/permissions on NSTask-launched app (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: Re: Capturing windows in an NSImage
  • Next by Date: Re: Capturing windows in an NSImage
  • Previous by thread: Re: Environment/permissions on NSTask-launched app
  • Next by thread: Re: Environment/permissions on NSTask-launched app
  • Index(es):
    • Date
    • Thread