fsaccess.c revision 15a44745412679c30a6d022733925af70a38b715
/*
* Copyright (C) 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: fsaccess.c,v 1.4 2000/07/27 09:53:14 tale Exp $ */
#include <windows.h>
#include <winerror.h>
#include <aclapi.h>
/*
* This file is entirely theoretical. It has never been compiled or tested.
* At the very least, even if this is all perfect (HAH!), isc__winerror2result
* needs to be written.
*/
/*
*/
#include "../fsaccess.c"
int i;
};
/* XXXDCL -- NEED TO SET is_dir! Maybe use stat; what is native way? */
if (result != ISC_R_SUCCESS)
return (result);
/*
* "ERROR_SUCCESS". Heh heh heh.
*/
if (winerror != ERROR_SUCCESS)
return (isc__winerror2result(winerror));
/*
*/
for (i = mask = 0; i < ISC__FSACCESS_PERMISSIONBITS; i++) {
mask <<= 1;
mask |= 1;
}
}
for (i = 0; i < 2; i++) {
if (i == 0)
/*
* Owner-only permissions.
*/
/*
* File access rights.
*/
/*
* Directory access rights.
*/
/*
* Ensure no other bits were set.
*/
if (i == 2) {
/*
* Setting world.
*/
0, 0, 0, 0, 0, 0, 0,
&world)
== 0)
winerror = GetLastError();
else
/*
* This should already be ERROR_SUCCESS.
*/
}
if (winerror == ERROR_SUCCESS) {
}
if (winerror == ERROR_SUCCESS)
winerror =
if (winerror == ERROR_SUCCESS)
else
break;
}
if (winerror == ERROR_SUCCESS) {
/*
* Ensure no other bits were set.
*/
return (ISC_R_SUCCESS);
} else
return (isc__winerror2result(winerror));
}