Lines Matching defs:path
172 void accessmode(char *path, struct maccess *ma, struct dir *dir _U_, struct stat *st)
178 if (lstat(path, &sb) != 0)
184 acltoownermode(path, st, ma);
313 int setfilunixmode (const struct vol *vol, struct path* path, mode_t mode)
315 if (!path->st_valid) {
316 of_stat(path);
319 if (path->st_errno) {
325 if (setfilmode( path->u_name, mode, &path->st, vol->v_umask) < 0)
328 return vol->vfs->vfs_setfilmode(vol, path->u_name, mode, &path->st);
477 int setfilowner(const struct vol *vol, const uid_t uid, const gid_t gid, struct path* path)
480 if (!path->st_valid) {
481 of_stat(path);
484 if (path->st_errno) {
488 if ( lchown( path->u_name, uid, gid ) < 0 && errno != EPERM ) {
490 uid, gid, path->u_name, strerror(errno) );
494 if (vol->vfs->vfs_chown(vol, path->u_name, uid, gid ) < 0 && errno != EPERM) {
496 uid, gid, path->u_name, strerror(errno) );
554 static int recursive_chown(const char *path, uid_t uid, gid_t gid) {
563 if (chown(path, uid, gid) < 0) {
564 LOG(log_error, logtype_afpd, "cannot chown() file [%s] (uid = %d): %s", path, uid, strerror(errno));
568 if (lstat(path, &sbuf) < 0) {
569 LOG(log_error, logtype_afpd, "cannot chown() file [%s] (uid = %d): %s", path, uid, strerror(errno));
574 odir = opendir(path);
576 LOG(log_error, logtype_afpd, "cannot opendir() [%s] (uid = %d): %s", path, uid, strerror(errno));
585 sprintf(newpath, "%s/%s", path, name);