Some adpations to FreeBSD
and a temporary dummy of iconv (which is not installed on the test box)
This commit is contained in:
parent
8d459c7f77
commit
4c13522783
@ -16,6 +16,11 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifndef Libisofs_with_aaip_acL
|
||||
/* It seems ACL is fixely integrated in FreeBSD libc. There is no libacl. */
|
||||
#define Libisofs_with_aaip_acL yes
|
||||
#endif
|
||||
|
||||
#ifdef Libisofs_with_aaip_acL
|
||||
#include <sys/acl.h>
|
||||
#endif
|
||||
@ -140,6 +145,7 @@ int aaip_get_attr_list(char *path, size_t *num_attrs, char ***names,
|
||||
*value_lengths= NULL;
|
||||
*values= NULL;
|
||||
|
||||
num_names= 0;
|
||||
if(flag & 1)
|
||||
num_names++;
|
||||
if(num_names == 0)
|
||||
|
@ -299,7 +299,7 @@ static ssize_t aaip_encode_acl_text(char *acl_text, mode_t st_mode,
|
||||
size_t result_size, unsigned char *result, int flag)
|
||||
{
|
||||
char *rpt, *npt, *cpt;
|
||||
int qualifier= 0, perms, type, i, qualifier_len= 0, num_recs, needed;
|
||||
int qualifier= 0, perms, type, i, qualifier_len= 0, num_recs, needed= 0;
|
||||
unsigned int has_u= 0, has_g= 0, has_o= 0, has_m= 0, is_trivial= 1;
|
||||
uid_t uid, huid;
|
||||
gid_t gid, hgid;
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <iconv.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
@ -31,6 +30,51 @@
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* ts A901203 */
|
||||
/* A dummy non-implementation of iconv API as used by libisofs.
|
||||
Needed for FreeBSD experiments on a slightly misconfigured public server.
|
||||
#define Libisofs_iconv_dummY yes
|
||||
*/
|
||||
#ifdef Libisofs_iconv_dummY
|
||||
|
||||
typedef int iconv_t;
|
||||
|
||||
static
|
||||
iconv_t iconv_open(const char *tocode, const char *fromcode)
|
||||
{
|
||||
return (iconv_t)(999);
|
||||
}
|
||||
static
|
||||
size_t iconv(iconv_t cd,
|
||||
char **inbuf, size_t *inbytesleft,
|
||||
char **outbuf, size_t *outbytesleft)
|
||||
{
|
||||
size_t todo;
|
||||
|
||||
todo = *inbytesleft;
|
||||
if (todo > *outbytesleft)
|
||||
todo = *outbytesleft;
|
||||
memcpy(*outbuf, *inbuf, todo);
|
||||
*outbytesleft -= todo;
|
||||
*outbuf += todo;
|
||||
*inbuf -= todo;
|
||||
*inbytesleft = 0;
|
||||
return todo;
|
||||
}
|
||||
static
|
||||
int iconv_close(iconv_t cd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else /* Libisofs_iconv_dummY */
|
||||
|
||||
#include <iconv.h>
|
||||
|
||||
#endif /* ! Libisofs_iconv_dummY */
|
||||
|
||||
|
||||
int int_pow(int base, int power)
|
||||
{
|
||||
int result = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user