Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: chown problem



On Thu, 5 Sep 2002, Michael Domino wrote:
> When I check to see who owns the file using ls -l, sure enough it is
> owned by the current console login, with -rw-r--r-- permissions, but
> when I am logged in as that user, rm reports "permission denied" when I
> try to delete the file. Can anyone explain why this is happening?

To delete a file you need to have write (and access) permission in the
directory it resdides in.

> Also, how would I go about getting a list of the groups a user is a
> member of, from a c program? I know I could do a system call "id -Gn
> username" and write the output to a file, but is there a way to get the
> list directly?
>

This was discussed pretty recently, basically you need to go through all
groups to see if the user is a member of them one at a time. See
getgrent(3).
_______________________________________________
darwin-userlevel mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-userlevel
Do not post admin requests to the list. They will be ignored.

References: 
 >chown problem (From: Michael Domino <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.