netatalk  4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
unix.c File Reference
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
#include <atalk/acl.h>
#include <atalk/adouble.h>
#include <atalk/afp.h>
#include <atalk/logger.h>
#include <atalk/unix.h>
#include <atalk/util.h>
#include <atalk/vfs.h>
#include "acls.h"
#include "auth.h"
#include "directory.h"
#include "fork.h"
#include "unix.h"
#include "volume.h"

Functions

int ustatfs_getvolspace (const struct vol *vol, VolSpace *bfree, VolSpace *btotal, uint32_t *bsize)
 
static int utombits (mode_t bits)
 
static void utommode (const AFPObj *obj, const struct stat *stat, struct maccess *ma)
 
void accessmode (const AFPObj *obj, const struct vol *vol, char *path, struct maccess *ma, struct dir *dir, struct stat *st)
 Calculate the mode for a directory using a stat() call to estimate permission.
 
static mode_t mtoubits (uint8_t bits)
 
mode_t mtoumode (struct maccess *ma)
 
int setfilunixmode (const struct vol *vol, struct path *path, mode_t mode)
 
int setdirunixmode (const struct vol *vol, char *name, mode_t mode)
 
int setfilowner (const struct vol *vol, const uid_t uid, const gid_t gid, struct path *path)
 
int setdirowner (const struct vol *vol, const char *name, const uid_t uid, const gid_t gid)
 

Function Documentation

◆ accessmode()

void accessmode ( const AFPObj obj,
const struct vol vol,
char *  path,
struct maccess ma,
struct dir dir,
struct stat *  st 
)

Calculate the mode for a directory using a stat() call to estimate permission.

Note
the previous method, using access(), does not work correctly over NFS.

◆ mtoubits()

static mode_t mtoubits ( uint8_t  bits)
static

◆ mtoumode()

mode_t mtoumode ( struct maccess ma)

◆ setdirowner()

int setdirowner ( const struct vol vol,
const char *  name,
const uid_t  uid,
const gid_t  gid 
)

◆ setdirunixmode()

int setdirunixmode ( const struct vol vol,
char *  name,
mode_t  mode 
)

◆ setfilowner()

int setfilowner ( const struct vol vol,
const uid_t  uid,
const gid_t  gid,
struct path path 
)

◆ setfilunixmode()

int setfilunixmode ( const struct vol vol,
struct path path,
mode_t  mode 
)

◆ ustatfs_getvolspace()

int ustatfs_getvolspace ( const struct vol vol,
VolSpace bfree,
VolSpace btotal,
uint32_t *  bsize 
)

Get the free space on a partition.

◆ utombits()

static int utombits ( mode_t  bits)
static

◆ utommode()

static void utommode ( const AFPObj obj,
const struct stat *  stat,
struct maccess ma 
)
static