getting ACLs
getting ACLs
- Subject: getting ACLs
- From: John Michael Zorko <email@hidden>
- Date: Mon, 05 Jan 2009 07:45:49 -0800
Hello, all ...
I'm exploring the acl_* POSIX APIs on Leopard (and assuming the same
code will work on TIger, please correct me if i'm wrong), and so far,
all I get from acl_get_file() is error 22, "invalid argument". Here's
my (very short) test, can someone tell me what i'm doing wrong?
#include <sys/types.h>
#include <sys/acl.h>
#include <string>
#include <iostream>
#include <errno.h>
using namespace std;
int main( int argc, char **pcargv )
{
// get file to operate on
if ( argc == 2 )
{
std::string strFile = pcargv[ 1 ];
// get ACL from file ...
acl_t acl = acl_get_file( strFile.c_str(),
ACL_TYPE_DEFAULT ); // also tried ACL_TYPE_ACCESS, same error
if ( acl )
{
acl_free( acl );
}
else
{
cout << "couldn't get ACL from " << strFile.c_str() << " errno
is " << errno << endl;
}
}
return 0;
}
... and when I run it, I get:
pugsadilly:unittests jmzorko$ c++ acl_test.cpp -o acl_test
pugsadilly:unittests jmzorko$ ./acl_test /Users/jmzorko/php4.4.7.pkg.zip
couldn't get ACL from /Users/jmzorko/php4.4.7.pkg.zip errno is 22
pugsadilly:unittests jmzorko$ ./acl_test /Users/jmzorko/work/fw40/
trunk/unittests/acl_test
couldn't get ACL from /Users/jmzorko/work/fw40/trunk/unittests/
acl_test errno is 22
pugsadilly:unittests jmzorko$ ./acl_test /Users/jmzorko/work/fw40/
trunk/unittests/acl_test.cpp
couldn't get ACL from /Users/jmzorko/work/fw40/trunk/unittests/
acl_test.cpp errno is 22
pugsadilly:unittests jmzorko$
Regards,
John
Falling You - exploring the beauty of voice and sound
http://www.fallingyou.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden