]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Move UNIX constants to smb3posix.idl
authorVolker Lendecke <vl@samba.org>
Fri, 20 Sep 2024 23:22:54 +0000 (01:22 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2024 15:22:46 +0000 (15:22 +0000)
Make them available to python

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
libcli/smb/smb_unix_ext.h
librpc/idl/smb3posix.idl

index 1145fd3cad6446cb69c71d4dca445d5ef8533f0b..ca0470672ab2a242a98197401de2b254039fc562 100644 (file)
@@ -24,6 +24,9 @@
 #ifndef __SMB_UNIX_EXT_H__
 #define __SMB_UNIX_EXT_H__
 
+#include <replace.h>
+#include "librpc/gen_ndr/smb3posix.h"
+
 /* UNIX CIFS Extensions - created by HP */
 /*
  * UNIX CIFS Extensions have the range 0x200 - 0x2FF reserved.
@@ -80,47 +83,6 @@ Offset Size         Name
 
 #define SMB_FILE_UNIX_BASIC_SIZE 100
 
-/* UNIX filetype mappings. */
-
-#define UNIX_TYPE_FILE 0
-#define UNIX_TYPE_DIR 1
-#define UNIX_TYPE_SYMLINK 2
-#define UNIX_TYPE_CHARDEV 3
-#define UNIX_TYPE_BLKDEV 4
-#define UNIX_TYPE_FIFO 5
-#define UNIX_TYPE_SOCKET 6
-#define UNIX_TYPE_UNKNOWN 0xFFFFFFFF
-
-/*
- * Oh this is fun. "Standard UNIX permissions" has no
- * meaning in POSIX. We need to define the mapping onto
- * and off the wire as this was not done in the original HP
- * spec. JRA.
- */
-
-#define UNIX_X_OTH                     0000001
-#define UNIX_W_OTH                     0000002
-#define UNIX_R_OTH                     0000004
-#define UNIX_X_GRP                     0000010
-#define UNIX_W_GRP                      0000020
-#define UNIX_R_GRP                      0000040
-#define UNIX_X_USR                      0000100
-#define UNIX_W_USR                      0000200
-#define UNIX_R_USR                      0000400
-#define UNIX_STICKY                     0001000
-#define UNIX_SET_GID                    0002000
-#define UNIX_SET_UID                    0004000
-
-/* Masks for the above */
-#define UNIX_OTH_MASK                   0000007
-#define UNIX_GRP_MASK                   0000070
-#define UNIX_USR_MASK                   0000700
-#define UNIX_PERM_MASK                  0000777
-#define UNIX_EXTRA_MASK                 0007000
-#define UNIX_FILETYPE_MASK              0070000
-#define UNIX_FILETYPE_SHIFT             12
-#define UNIX_ALL_MASK                   0077777
-
 /* Flags for chflags (CIFS_UNIX_EXTATTR_CAP capability) and
  * SMB_QUERY_FILE_UNIX_INFO2.
  */
index ad88cc16bca58907f5fea98546727be1ed2c112c..262565848a1d8f57783ee77ad01755a7ec9a8c6c 100644 (file)
@@ -13,6 +13,37 @@ import "security.idl";
 ]
 interface smb3posix
 {
+       const int UNIX_TYPE_FILE                = 0;
+       const int UNIX_TYPE_DIR                 = 1;
+       const int UNIX_TYPE_SYMLINK             = 2;
+       const int UNIX_TYPE_CHARDEV             = 3;
+       const int UNIX_TYPE_BLKDEV              = 4;
+       const int UNIX_TYPE_FIFO                = 5;
+       const int UNIX_TYPE_SOCKET              = 6;
+       const int UNIX_TYPE_UNKNOWN             = 0xFFFFFFFF;
+
+       const int UNIX_X_OTH                    = 0000001;
+       const int UNIX_W_OTH                    = 0000002;
+       const int UNIX_R_OTH                    = 0000004;
+       const int UNIX_X_GRP                    = 0000010;
+       const int UNIX_W_GRP                    = 0000020;
+       const int UNIX_R_GRP                    = 0000040;
+       const int UNIX_X_USR                    = 0000100;
+       const int UNIX_W_USR                    = 0000200;
+       const int UNIX_R_USR                    = 0000400;
+       const int UNIX_STICKY                   = 0001000;
+       const int UNIX_SET_GID                  = 0002000;
+       const int UNIX_SET_UID                  = 0004000;
+
+       const int UNIX_OTH_MASK                 = 0000007;
+       const int UNIX_GRP_MASK                 = 0000070;
+       const int UNIX_USR_MASK                 = 0000700;
+       const int UNIX_PERM_MASK                = 0000777;
+       const int UNIX_EXTRA_MASK               = 0007000;
+       const int UNIX_FILETYPE_MASK            = 0070000;
+       const int UNIX_FILETYPE_SHIFT           = 12;
+       const int UNIX_ALL_MASK                 = 0077777;
+
        typedef [public,flag(NDR_NOALIGN)] struct {
                uint32 nlinks;
                uint32 reparse_tag;