Lines Matching full:security
101 #include "security.h"
285 * Fill a security context as needed by security functions
297 scx->mapping[MAPUSERS] = ctx->security.mapping[MAPUSERS]; in ntfs_fuse_fill_security_context()
298 scx->mapping[MAPGROUPS] = ctx->security.mapping[MAPGROUPS]; in ntfs_fuse_fill_security_context()
312 return (ctx->security.mapping[MAPUSERS] != (struct MAPPING*)NULL); in ntfs_fuse_fill_security_context()
814 struct SECURITY_CONTEXT security; in ntfs_fuse_getattr() local
825 withusermapping = ntfs_fuse_fill_security_context(&security); in ntfs_fuse_getattr()
831 && !ntfs_allowed_dir_access(&security,path, in ntfs_fuse_getattr()
1034 if (ntfs_get_owner_mode(&security,ni,stbuf) < 0) in ntfs_fuse_getattr()
1379 struct SECURITY_CONTEXT security; in ntfs_fuse_opendir() local
1386 if (ntfs_fuse_fill_security_context(&security)) { in ntfs_fuse_opendir()
1399 ? !ntfs_allowed_dir_access(&security, in ntfs_fuse_opendir()
1401 : !ntfs_allowed_dir_access(&security, path, in ntfs_fuse_opendir()
1403 || !ntfs_allowed_access(&security, in ntfs_fuse_opendir()
1478 struct SECURITY_CONTEXT security; in ntfs_fuse_open() local
1494 if (ntfs_fuse_fill_security_context(&security)) { in ntfs_fuse_open()
1506 if (!ntfs_allowed_dir_access(&security, in ntfs_fuse_open()
1508 || !ntfs_allowed_access(&security, in ntfs_fuse_open()
1819 struct SECURITY_CONTEXT security; in ntfs_fuse_trunc() local
1861 if (ntfs_fuse_fill_security_context(&security) in ntfs_fuse_trunc()
1862 && (!ntfs_allowed_dir_access(&security, path, in ntfs_fuse_trunc()
1865 && !ntfs_allowed_access(&security, ni, S_IWRITE)))) { in ntfs_fuse_trunc()
1922 struct SECURITY_CONTEXT security; in ntfs_fuse_chmod() local
1932 || !ntfs_fuse_fill_security_context(&security)) { in ntfs_fuse_chmod()
1940 if (ntfs_allowed_dir_access(&security,path, in ntfs_fuse_chmod()
1947 if (ntfs_set_mode(&security,ni,mode)) in ntfs_fuse_chmod()
1967 struct SECURITY_CONTEXT security; in ntfs_fuse_chown() local
1976 || !ntfs_fuse_fill_security_context(&security)) { in ntfs_fuse_chown()
1988 if (ntfs_allowed_dir_access(&security,path, in ntfs_fuse_chown()
1995 if (ntfs_set_owner(&security, in ntfs_fuse_chown()
2019 struct SECURITY_CONTEXT security; in ntfs_fuse_access() local
2025 if (!ntfs_fuse_fill_security_context(&security)) { in ntfs_fuse_access()
2032 if (ntfs_allowed_dir_access(&security,path,(ntfs_inode*)NULL, in ntfs_fuse_access()
2043 if (!ntfs_allowed_access(&security, in ntfs_fuse_access()
2073 struct SECURITY_CONTEXT security; in ntfs_fuse_create() local
2109 if (!ntfs_fuse_fill_security_context(&security) in ntfs_fuse_create()
2110 || ntfs_allowed_create(&security, in ntfs_fuse_create()
2113 ntfs_fuse_fill_security_context(&security); in ntfs_fuse_create()
2114 ntfs_allowed_create(&security, dir_ni, &gid, &dsetgid); in ntfs_fuse_create()
2126 * Try to get a security id available for in ntfs_fuse_create()
2129 * have to build a security attribute later. in ntfs_fuse_create()
2131 if (!ctx->security.mapping[MAPUSERS]) in ntfs_fuse_create()
2135 securid = ntfs_inherited_id(&security, in ntfs_fuse_create()
2139 securid = ntfs_alloc_securid(&security, in ntfs_fuse_create()
2140 security.uid, gid, in ntfs_fuse_create()
2143 securid = ntfs_alloc_securid(&security, in ntfs_fuse_create()
2144 security.uid, gid, in ntfs_fuse_create()
2145 perm & ~security.umask, S_ISDIR(type)); in ntfs_fuse_create()
2192 * set the security attribute if a security id in ntfs_fuse_create()
2195 if (ctx->security.mapping[MAPUSERS]) { in ntfs_fuse_create()
2198 && ntfs_set_inherited_posix(&security, ni, in ntfs_fuse_create()
2199 security.uid, gid, in ntfs_fuse_create()
2204 && ntfs_set_owner_mode(&security, ni, in ntfs_fuse_create()
2205 security.uid, gid, in ntfs_fuse_create()
2206 perm & ~security.umask) < 0) in ntfs_fuse_create()
2364 struct SECURITY_CONTEXT security; in ntfs_fuse_link() local
2403 if (ntfs_fuse_fill_security_context(&security) in ntfs_fuse_link()
2404 && ((!samedir && !ntfs_allowed_dir_access(&security,old_path, in ntfs_fuse_link()
2406 || !ntfs_allowed_access(&security,dir_ni,S_IWRITE + S_IEXEC))) in ntfs_fuse_link()
2456 struct SECURITY_CONTEXT security; in ntfs_fuse_rm() local
2496 if (!ntfs_fuse_fill_security_context(&security) in ntfs_fuse_rm()
2497 || ntfs_allowed_dir_access(&security, org_path, dir_ni, ni, in ntfs_fuse_rm()
2555 struct SECURITY_CONTEXT security; in ntfs_fuse_unlink() local
2569 if (!ntfs_fuse_fill_security_context(&security) in ntfs_fuse_unlink()
2570 || ntfs_allowed_dir_access(&security, path, in ntfs_fuse_unlink()
2641 struct SECURITY_CONTEXT security; in ntfs_fuse_rename_existing_dest() local
2664 if (!ntfs_fuse_fill_security_context(&security) in ntfs_fuse_rename_existing_dest()
2665 || ntfs_allowed_dir_access(&security, new_path, in ntfs_fuse_rename_existing_dest()
2774 struct SECURITY_CONTEXT security; in ntfs_fuse_utimens() local
2781 if (ntfs_fuse_fill_security_context(&security) in ntfs_fuse_utimens()
2782 && !ntfs_allowed_dir_access(&security,path, in ntfs_fuse_utimens()
2794 if (ntfs_allowed_as_owner(&security, ni) in ntfs_fuse_utimens()
2797 && ntfs_allowed_access(&security, ni, S_IWRITE))) { in ntfs_fuse_utimens()
2835 struct SECURITY_CONTEXT security; in ntfs_fuse_utime() local
2842 if (ntfs_fuse_fill_security_context(&security) in ntfs_fuse_utime()
2843 && !ntfs_allowed_dir_access(&security,path, in ntfs_fuse_utime()
2853 ownerok = ntfs_allowed_as_owner(&security, ni); in ntfs_fuse_utime()
2863 && ntfs_allowed_access(&security, ni, S_IWRITE); in ntfs_fuse_utime()
2879 && ntfs_allowed_access(&security, ni, S_IWRITE); in ntfs_fuse_utime()
3017 static ntfs_inode *ntfs_check_access_xattr(struct SECURITY_CONTEXT *security, in ntfs_check_access_xattr() argument
3036 if (((!ntfs_fuse_fill_security_context(security) in ntfs_check_access_xattr()
3042 if (ctx->silent && !ctx->security.mapping[MAPUSERS]) in ntfs_check_access_xattr()
3060 if (ntfs_allowed_real_dir_access(security, path, in ntfs_check_access_xattr()
3122 * security, trusted and unmapped system name spaces : in fix_xattr_prefix()
3153 struct SECURITY_CONTEXT security; in ntfs_fuse_listxattr() local
3157 if (ntfs_fuse_fill_security_context(&security) in ntfs_fuse_listxattr()
3158 && !ntfs_allowed_dir_access(&security,path,(ntfs_inode*)NULL, in ntfs_fuse_listxattr()
3171 if (!ntfs_allowed_access(&security,ni,S_IREAD)) { in ntfs_fuse_listxattr()
3207 struct SECURITY_CONTEXT security; in ntfs_fuse_getxattr_windows() local
3214 if (ntfs_fuse_fill_security_context(&security) in ntfs_fuse_getxattr_windows()
3215 && !ntfs_allowed_dir_access(&security,path,(ntfs_inode*)NULL, in ntfs_fuse_getxattr_windows()
3224 if (!ntfs_allowed_access(&security,ni,S_IREAD)) { in ntfs_fuse_getxattr_windows()
3298 struct SECURITY_CONTEXT security; in ntfs_fuse_getxattr() local
3317 ni = ntfs_check_access_xattr(&security, path, attr, FALSE); in ntfs_fuse_getxattr()
3319 if (ntfs_allowed_access(&security,ni,S_IREAD)) { in ntfs_fuse_getxattr()
3324 res = ntfs_xattr_system_getxattr(&security, in ntfs_fuse_getxattr()
3347 ntfs_fuse_fill_security_context(&security); in ntfs_fuse_getxattr()
3352 res = ntfs_xattr_system_getxattr(&security, in ntfs_fuse_getxattr()
3373 if (ntfs_fuse_fill_security_context(&security) in ntfs_fuse_getxattr()
3374 && !ntfs_allowed_dir_access(&security,path,(ntfs_inode*)NULL, in ntfs_fuse_getxattr()
3380 && security.uid) in ntfs_fuse_getxattr()
3393 if (!ntfs_allowed_access(&security, ni, S_IREAD)) { in ntfs_fuse_getxattr()
3457 struct SECURITY_CONTEXT security; in ntfs_fuse_setxattr() local
3478 ni = ntfs_check_access_xattr(&security,path,attr,TRUE); in ntfs_fuse_setxattr()
3480 if (ntfs_allowed_as_owner(&security,ni)) { in ntfs_fuse_setxattr()
3485 res = ntfs_xattr_system_setxattr(&security, in ntfs_fuse_setxattr()
3512 ni = ntfs_check_access_xattr(&security,path,attr,TRUE); in ntfs_fuse_setxattr()
3520 if (!ntfs_fuse_fill_security_context(&security) in ntfs_fuse_setxattr()
3521 || ntfs_allowed_as_owner(&security,ni)) { in ntfs_fuse_setxattr()
3526 res = ntfs_xattr_system_setxattr(&security, in ntfs_fuse_setxattr()
3555 if (ntfs_fuse_fill_security_context(&security) in ntfs_fuse_setxattr()
3556 && !ntfs_allowed_dir_access(&security,path,(ntfs_inode*)NULL, in ntfs_fuse_setxattr()
3560 /* security and trusted only settable by root */ in ntfs_fuse_setxattr()
3563 && security.uid) in ntfs_fuse_setxattr()
3573 if (security.uid) { in ntfs_fuse_setxattr()
3579 if (!ntfs_allowed_as_owner(&security,ni)) { in ntfs_fuse_setxattr()
3590 if (!ntfs_allowed_access(&security,ni,S_IWRITE)) { in ntfs_fuse_setxattr()
3689 struct SECURITY_CONTEXT security; in ntfs_fuse_removexattr() local
3716 ni = ntfs_check_access_xattr(&security,path,attr,TRUE); in ntfs_fuse_removexattr()
3718 if (ntfs_allowed_as_owner(&security,ni)) { in ntfs_fuse_removexattr()
3723 res = ntfs_xattr_system_removexattr(&security, in ntfs_fuse_removexattr()
3747 ni = ntfs_check_access_xattr(&security, in ntfs_fuse_removexattr()
3762 if (!ntfs_fuse_fill_security_context(&security) in ntfs_fuse_removexattr()
3763 || ntfs_allowed_as_owner(&security,ni)) { in ntfs_fuse_removexattr()
3768 res = ntfs_xattr_system_removexattr(&security, in ntfs_fuse_removexattr()
3797 if (ntfs_fuse_fill_security_context(&security) in ntfs_fuse_removexattr()
3798 && !ntfs_allowed_dir_access(&security,path,(ntfs_inode*)NULL, in ntfs_fuse_removexattr()
3802 /* security and trusted only settable by root */ in ntfs_fuse_removexattr()
3805 && security.uid) in ntfs_fuse_removexattr()
3815 if (security.uid) { in ntfs_fuse_removexattr()
3821 if (!ntfs_allowed_as_owner(&security,ni)) { in ntfs_fuse_removexattr()
3832 if (!ntfs_allowed_access(&security,ni,S_IWRITE)) { in ntfs_fuse_removexattr()
3908 struct SECURITY_CONTEXT security; in ntfs_close() local
3919 if (ntfs_fuse_fill_security_context(&security)) { in ntfs_close()
3931 ntfs_destroy_security_context(&security); in ntfs_close()
4413 ctx->security.uid = 0; in main()
4414 ctx->security.gid = 0; in main()
4418 ctx->security.uid = sbuf.st_uid; in main()
4419 ctx->security.gid = sbuf.st_gid; in main()
4474 ctx->security.vol = ctx->vol; in main()
4480 if (!ntfs_build_mapping(&ctx->security,ctx->usermap_path, in main()
4504 * force default security in main()
4517 ctx->security.uid = ctx->uid; in main()
4518 ctx->security.gid = ctx->gid; in main()
4520 ctx->security.mapping[MAPUSERS] = (struct MAPPING*)NULL; in main()
4521 ctx->security.mapping[MAPGROUPS] = (struct MAPPING*)NULL; in main()