Changeset 988 for vendor/current/source4/libcli/clifile.c
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/libcli/clifile.c
r740 r988 52 52 53 53 /**************************************************************************** 54 Map standard UNIX permissions onto wire representations.55 ****************************************************************************/56 uint32_t unix_perms_to_wire(mode_t perms)57 {58 unsigned int ret = 0;59 60 ret |= ((perms & S_IXOTH) ? UNIX_X_OTH : 0);61 ret |= ((perms & S_IWOTH) ? UNIX_W_OTH : 0);62 ret |= ((perms & S_IROTH) ? UNIX_R_OTH : 0);63 ret |= ((perms & S_IXGRP) ? UNIX_X_GRP : 0);64 ret |= ((perms & S_IWGRP) ? UNIX_W_GRP : 0);65 ret |= ((perms & S_IRGRP) ? UNIX_R_GRP : 0);66 ret |= ((perms & S_IXUSR) ? UNIX_X_USR : 0);67 ret |= ((perms & S_IWUSR) ? UNIX_W_USR : 0);68 ret |= ((perms & S_IRUSR) ? UNIX_R_USR : 0);69 #ifdef S_ISVTX70 ret |= ((perms & S_ISVTX) ? UNIX_STICKY : 0);71 #endif72 #ifdef S_ISGID73 ret |= ((perms & S_ISGID) ? UNIX_SET_GID : 0);74 #endif75 #ifdef S_ISUID76 ret |= ((perms & S_ISUID) ? UNIX_SET_UID : 0);77 #endif78 return ret;79 }80 81 /****************************************************************************82 54 Symlink a file (UNIX extensions). 83 55 ****************************************************************************/ … … 682 654 TALLOC_CTX *mem_ctx; 683 655 NTSTATUS status; 656 int ret = -1; 684 657 685 658 mem_ctx = talloc_init("raw_open"); 686 if (!mem_ctx) return -1;659 if (!mem_ctx) return ret; 687 660 688 661 open_parms.openx.level = RAW_OPEN_CTEMP; … … 692 665 693 666 status = smb_raw_open(tree, mem_ctx, &open_parms); 694 if (tmp_path) { 695 *tmp_path = strdup(open_parms.ctemp.out.name); 667 if (NT_STATUS_IS_OK(status)) { 668 if (tmp_path) { 669 *tmp_path = strdup(open_parms.ctemp.out.name); 670 } 671 ret = open_parms.ctemp.out.file.fnum; 696 672 } 697 673 talloc_free(mem_ctx); 698 if (NT_STATUS_IS_OK(status)) { 699 return open_parms.ctemp.out.file.fnum; 700 } 701 return -1; 702 } 674 return ret; 675 }
Note:
See TracChangeset
for help on using the changeset viewer.