Changeset 988 for vendor/current/examples
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/examples
- Files:
-
- 8 added
- 13 deleted
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/examples/LDAP/samba-nds.schema
r860 r988 36 36 changetype: modify 37 37 add: attributetypes 38 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.26 NAME 'sambaAcctFlags' DESC 'Account Flags' EQUALITY caseIgnoreIA5Match S UBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} SINGLE-VALUE )38 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.26 NAME 'sambaAcctFlags' DESC 'Account Flags' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} SINGLE-VALUE ) 39 39 40 40 ## … … 129 129 changetype: modify 130 130 add: attributetypes 131 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.54 NAME 'sambaPasswordHistory' DESC 'Concatenated MD 4 hashes of the unicodepasswords used on this account' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{1024} )131 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.54 NAME 'sambaPasswordHistory' DESC 'Concatenated MD5 hashes of the salted NT passwords used on this account' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{1024} ) 132 132 133 133 ## … … 138 138 changetype: modify 139 139 add: attributetypes 140 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.20 NAME 'sambaSID' DESC 'Security ID' EQUALITY caseIgnoreIA5Match SUBSTR case IgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64} SINGLE-VALUE )140 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.20 NAME 'sambaSID' DESC 'Security ID' EQUALITY caseIgnoreIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64} SINGLE-VALUE ) 141 141 142 142 ## … … 288 288 changetype: modify 289 289 add: attributetypes 290 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.68 NAME 'sambaClearTextPassword' DESC 'Clear text password (used for trusted domain passwords)' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 ) 291 292 dn: cn=schema 293 changetype: modify 294 add: attributetypes 295 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.69 NAME 'sambaPreviousClearTextPassword' DESC 'Previous clear text password (used for trusted domain passwords)' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 ) 296 297 dn: cn=schema 298 changetype: modify 299 add: attributetypes 290 300 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.70 NAME 'sambaTrustType' DESC 'Type of trust' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) 291 301 … … 329 339 add: attributetypes 330 340 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.78 NAME 'sambaTrustForestTrustInfo' DESC 'Forest trust information for a trusted domain object' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1050} ) 341 342 dn: cn=schema 343 changetype: modify 344 add: attributetypes 345 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.79 NAME 'sambaTrustPosixOffset' DESC 'POSIX offset of a trust' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) 346 347 dn: cn=schema 348 changetype: modify 349 add: attributetypes 350 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.80 NAME 'sambaSupportedEncryptionTypes' DESC 'Supported encryption types of a trust' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) 331 351 332 352 ####################################################################### … … 358 378 359 379 ## 380 ## Trust password for trusted domains 381 ## (to be stored beneath the trusting sambaDomain object in the DIT) 382 ## 383 384 dn: cn=schema 385 changetype: modify 386 add: objectClasses 387 objectClasses: ( 1.3.6.1.4.1.7165.2.2.15 NAME 'sambaTrustedDomainPassword' SUP top STRUCTURAL DESC 'Samba Trusted Domain Password' MUST ( sambaDomainName $ sambaSID $ sambaClearTextPassword $ sambaPwdLastSet ) MAY ( sambaPreviousClearTextPassword )) 388 389 ## 360 390 ## Whole-of-domain info 361 391 ## … … 373 403 changetype: modify 374 404 add: objectClasses 375 objectClasses: ( 1.3.6.1.4.1.7165. 2.2.7 NAME 'sambaUnixIdPool' DESC 'Pool for allocating UNIX uids/gids' SUP top AUXILIARY MUST ( uidNumber $ gidNumber ))376 377 dn: cn=schema 378 changetype: modify 379 add: objectClasses 380 objectClasses: ( 1.3.6.1.4.1.7165. 2.2.8 NAME 'sambaIdmapEntry' DESC 'Mapping from a SID to an ID' SUP top AUXILIARY MUST ( sambaSID ) MAY ( uidNumber $ gidNumber ))381 382 dn: cn=schema 383 changetype: modify 384 add: objectClasses 385 objectClasses: ( 1.3.6.1.4.1.7165. 2.2.9 NAME 'sambaSidEntry' DESC 'Structural Class for a SID' SUP top STRUCTURAL MUST ( sambaSID ))386 387 dn: cn=schema 388 changetype: modify 389 add: objectClasses 390 objectClasses: ( 1.3.6.1.4.1.7165. 2.2.10 NAME 'sambaConfig' DESC 'Samba Configuration Section' SUP top AUXILIARY MAY ( description ))405 objectClasses: ( 1.3.6.1.4.1.7165.1.2.2.7 NAME 'sambaUnixIdPool' DESC 'Pool for allocating UNIX uids/gids' SUP top AUXILIARY MUST ( uidNumber $ gidNumber )) 406 407 dn: cn=schema 408 changetype: modify 409 add: objectClasses 410 objectClasses: ( 1.3.6.1.4.1.7165.1.2.2.8 NAME 'sambaIdmapEntry' DESC 'Mapping from a SID to an ID' SUP top AUXILIARY MUST ( sambaSID ) MAY ( uidNumber $ gidNumber )) 411 412 dn: cn=schema 413 changetype: modify 414 add: objectClasses 415 objectClasses: ( 1.3.6.1.4.1.7165.1.2.2.9 NAME 'sambaSidEntry' DESC 'Structural Class for a SID' SUP top STRUCTURAL MUST ( sambaSID )) 416 417 dn: cn=schema 418 changetype: modify 419 add: objectClasses 420 objectClasses: ( 1.3.6.1.4.1.7165.1.2.2.10 NAME 'sambaConfig' DESC 'Samba Configuration Section' SUP top AUXILIARY MAY ( description )) 391 421 392 422 dn: cn=schema … … 408 438 changetype: modify 409 439 add: objectClasses 410 objectClasses: ( 1.3.6.1.4.1.7165.2.2.16 NAME 'sambaTrustedDomain' SUP top STRUCTURAL DESC 'Samba Trusted Domain Object' MUST ( cn ) MAY ( sambaTrustType $ sambaTrustAttributes $ sambaTrustDirection $ sambaTrustPartner $ sambaFlatName $ sambaTrustAuthOutgoing $ sambaTrustAuthIncoming $ sambaSecurityIdentifier $ sambaTrustForestTrustInfo ) )440 objectClasses: ( 1.3.6.1.4.1.7165.2.2.16 NAME 'sambaTrustedDomain' SUP top STRUCTURAL DESC 'Samba Trusted Domain Object' MUST ( cn ) MAY ( sambaTrustType $ sambaTrustAttributes $ sambaTrustDirection $ sambaTrustPartner $ sambaFlatName $ sambaTrustAuthOutgoing $ sambaTrustAuthIncoming $ sambaSecurityIdentifier $ sambaTrustForestTrustInfo $ sambaTrustPosixOffset $ sambaSupportedEncryptionTypes ) ) -
vendor/current/examples/LDAP/samba-schema-FDS.ldif
r860 r988 138 138 # 139 139 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.78 NAME 'sambaTrustForestTrustInfo' DESC 'Forest trust information for a trusted domain object' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1050} ) 140 # 141 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.79 NAME 'sambaTrustPosixOffset' DESC 'POSIX offset of a trust' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) 142 # 143 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.80 NAME 'sambaSupportedEncryptionTypes' DESC 'Supported encryption types of a trust' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) 140 144 ## 141 145 ####################################################################### … … 184 188 ## used for IPA_ldapsam 185 189 ## 186 objectClasses: ( 1.3.6.1.4.1.7165.2.2.16 NAME 'sambaTrustedDomain' SUP top STRUCTURAL DESC 'Samba Trusted Domain Object' MUST ( cn ) MAY ( sambaTrustType $ sambaTrustAttributes $ sambaTrustDirection $ sambaTrustPartner $ sambaFlatName $ sambaTrustAuthOutgoing $ sambaTrustAuthIncoming $ sambaSecurityIdentifier $ sambaTrustForestTrustInfo ) )190 objectClasses: ( 1.3.6.1.4.1.7165.2.2.16 NAME 'sambaTrustedDomain' SUP top STRUCTURAL DESC 'Samba Trusted Domain Object' MUST ( cn ) MAY ( sambaTrustType $ sambaTrustAttributes $ sambaTrustDirection $ sambaTrustPartner $ sambaFlatName $ sambaTrustAuthOutgoing $ sambaTrustAuthIncoming $ sambaSecurityIdentifier $ sambaTrustForestTrustInfo $ sambaTrustPosixOffset $ sambaSupportedEncryptionTypes) ) -
vendor/current/examples/LDAP/samba.ldif
r860 r988 170 170 fo' DESC 'Forest trust information for a trusted domain object' EQUALITY case 171 171 ExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1050} ) 172 olcAttributeTypes: {56}( 1.3.6.1.4.1.7165.2.1.79 NAME 'sambaTrustPosixOffset' 173 DESC 'POSIX offset of a trust' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466. 174 115.121.1.27 SINGLE-VALUE ) 175 olcAttributeTypes: {57}( 1.3.6.1.4.1.7165.2.1.80 NAME 'sambaSupportedEncryptio 176 nTypes' DESC 'Supported encryption types of a trust' EQUALITY integerMatch SY 177 NTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) 172 178 olcObjectClasses: {0}( 1.3.6.1.4.1.7165.2.2.6 NAME 'sambaSamAccount' DESC 'Sam 173 179 ba 3.0 Auxilary SAM Account' SUP top AUXILIARY MUST ( uid $ sambaSID ) MAY ( … … 215 221 e $ sambaTrustAttributes $ sambaTrustDirection $ sambaTrustPartner $ sambaFla 216 222 tName $ sambaTrustAuthOutgoing $ sambaTrustAuthIncoming $ sambaSecurityIdenti 217 fier $ sambaTrustForestTrustInfo ) ) 223 fier $ sambaTrustForestTrustInfo $ sambaTrustPosixOffset $ sambaSupportedEncr 224 yptionTypes) ) -
vendor/current/examples/LDAP/samba.schema
r860 r988 21 21 ## 1.3.6.1.4.1.7165.4.4.x - LDB/LDAP Extended Operations 22 22 ## 1.3.6.1.4.1.7165.4.255.x - mapped OIDs due to conflicts between AD and standards-track 23 ## 24 ## External projects 25 ## 1.3.6.1.4.1.7165.655.x 26 ## 1.3.6.1.4.1.7165.655.1.x - GSS-NTLMSSP 23 27 ## 24 28 ## ----- READ THIS WHEN ADDING A NEW ATTRIBUTE OR OBJECT CLASS ------ … … 515 519 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1050} ) 516 520 521 attributetype ( 1.3.6.1.4.1.7165.2.1.79 NAME 'sambaTrustPosixOffset' 522 DESC 'POSIX offset of a trust' 523 EQUALITY integerMatch 524 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) 525 526 attributetype ( 1.3.6.1.4.1.7165.2.1.80 NAME 'sambaSupportedEncryptionTypes' 527 DESC 'Supported encryption types of a trust' 528 EQUALITY integerMatch 529 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) 517 530 518 531 ####################################################################### … … 628 641 sambaTrustPartner $ sambaFlatName $ sambaTrustAuthOutgoing $ 629 642 sambaTrustAuthIncoming $ sambaSecurityIdentifier $ 630 sambaTrustForestTrustInfo) ) 643 sambaTrustForestTrustInfo $ sambaTrustPosixOffset $ 644 sambaSupportedEncryptionTypes) ) -
vendor/current/examples/LDAP/samba.schema.at.IBM-DS
r860 r988 111 111 112 112 attributetypes=( 1.3.6.1.4.1.7165.2.1.78 NAME 'sambaTrustForestTrustInfo' DESC 'Forest trust information for a trusted domain object' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1050} ) 113 114 attributetypes=( 1.3.6.1.4.1.7165.2.1.79 NAME 'sambaTrustPosixOffset' DESC 'POSIX offset of a trust' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) 115 116 attributetypes=( 1.3.6.1.4.1.7165.2.1.80 NAME 'sambaSupportedEncryptionTypes' DESC 'Supported encryption types of a trust' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) -
vendor/current/examples/LDAP/samba.schema.oc.IBM-DS
r860 r988 21 21 objectclasses=( 1.3.6.1.4.1.7165.2.2.14 NAME 'sambaTrustPassword' SUP top STRUCTURAL DESC 'Samba Trust Password' MUST ( sambaDomainName $ sambaNTPassword $ sambaTrustFlags ) MAY ( sambaSID $ sambaPwdLastSet )) 22 22 23 objectclasses=( 1.3.6.1.4.1.7165.2.2.16 NAME 'sambaTrustedDomain' SUP top STRUCTURAL DESC 'Samba Trusted Domain Object' MUST ( cn ) MAY ( sambaTrustType $ sambaTrustAttributes $ sambaTrustDirection $ sambaTrustPartner $ sambaFlatName $ sambaTrustAuthOutgoing $ sambaTrustAuthIncoming $ sambaSecurityIdentifier $ sambaTrustForestTrustInfo ) )23 objectclasses=( 1.3.6.1.4.1.7165.2.2.16 NAME 'sambaTrustedDomain' SUP top STRUCTURAL DESC 'Samba Trusted Domain Object' MUST ( cn ) MAY ( sambaTrustType $ sambaTrustAttributes $ sambaTrustDirection $ sambaTrustPartner $ sambaFlatName $ sambaTrustAuthOutgoing $ sambaTrustAuthIncoming $ sambaSecurityIdentifier $ sambaTrustForestTrustInfo $ sambaTrustPosixOffset $ sambaSupportedEncryptionTypes ) ) -
vendor/current/examples/README
r414 r988 7 7 information regarding global and share parameter settings. 8 8 9 Send additions to: samba @samba.org9 Send additions to: samba-technical@lists.samba.org 10 10 11 11 -
vendor/current/examples/VFS/README
r414 r988 11 11 final functions, like a database filesystem. 12 12 13 Please look at skel_transp ort.c when you want your module to provide13 Please look at skel_transparent.c when you want your module to provide 14 14 passthrough functions, like audit modules. 15 15 -
vendor/current/examples/VFS/shadow_copy_test.c
r860 r988 19 19 */ 20 20 21 #include " includes.h"21 #include "../source3/include/includes.h" 22 22 #include "ntioctl.h" 23 #include "smbd/proto.h"24 23 25 24 #undef DBGC_CLASS … … 58 57 bool labels) 59 58 { 60 uint32 num = 3;61 uint32 i;59 uint32_t num = 3; 60 uint32_t i; 62 61 63 62 shadow_copy_data->num_volumes = num; … … 65 64 if (labels) { 66 65 if (num) { 67 shadow_copy_data->labels = TALLOC_ZERO_ARRAY(shadow_copy_data,SHADOW_COPY_LABEL,num);66 shadow_copy_data->labels = talloc_zero_array(shadow_copy_data,SHADOW_COPY_LABEL,num); 68 67 } else { 69 68 shadow_copy_data->labels = NULL; … … 82 81 83 82 static struct vfs_fn_pointers vfs_test_shadow_copy_fns = { 84 .get_shadow_copy_data = test_get_shadow_copy_data83 .get_shadow_copy_data_fn = test_get_shadow_copy_data 85 84 }; 86 85 86 static_decl_vfs; 87 87 NTSTATUS vfs_shadow_copy_test_init(void) 88 88 { -
vendor/current/examples/VFS/skel_opaque.c
r860 r988 22 22 */ 23 23 24 25 #include "includes.h" 26 #include "smbd/proto.h" 24 #include "../source3/include/includes.h" 25 #include "lib/util/tevent_ntstatus.h" 27 26 28 27 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE … … 34 33 */ 35 34 36 static int skel_connect(vfs_handle_struct *handle, const char *service, const char *user) 35 static int skel_connect(vfs_handle_struct *handle, const char *service, 36 const char *user) 37 37 { 38 38 errno = ENOSYS; … … 45 45 } 46 46 47 static uint64_t skel_disk_free(vfs_handle_struct *handle, 48 bool small_query,uint64_t *bsize,49 uint64_t *dfree, uint64_t *dsize)47 static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path, 48 uint64_t *bsize, 49 uint64_t *dfree, uint64_t *dsize) 50 50 { 51 51 *bsize = 0; … … 55 55 } 56 56 57 static int skel_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq) 58 { 59 errno = ENOSYS; 60 return -1; 61 } 62 63 static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq) 64 { 65 errno = ENOSYS; 66 return -1; 67 } 68 69 static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, struct shadow_copy_data *shadow_copy_data, bool labels) 70 { 71 errno = ENOSYS; 72 return -1; 73 } 74 75 static int skel_statvfs(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf) 76 { 77 errno = ENOSYS; 78 return -1; 79 } 80 81 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res) 57 static int skel_get_quota(vfs_handle_struct *handle, const char *path, 58 enum SMB_QUOTA_TYPE qtype, unid_t id, 59 SMB_DISK_QUOTA *dq) 60 { 61 errno = ENOSYS; 62 return -1; 63 } 64 65 static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, 66 unid_t id, SMB_DISK_QUOTA *dq) 67 { 68 errno = ENOSYS; 69 return -1; 70 } 71 72 static int skel_get_shadow_copy_data(vfs_handle_struct *handle, 73 files_struct *fsp, 74 struct shadow_copy_data *shadow_copy_data, 75 bool labels) 76 { 77 errno = ENOSYS; 78 return -1; 79 } 80 81 static int skel_statvfs(struct vfs_handle_struct *handle, 82 const char *path, struct vfs_statvfs_struct *statbuf) 83 { 84 errno = ENOSYS; 85 return -1; 86 } 87 88 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle, 89 enum timestamp_set_resolution *p_ts_res) 82 90 { 83 91 return 0; 84 92 } 85 93 86 static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr) 94 static NTSTATUS skel_get_dfs_referrals(struct vfs_handle_struct *handle, 95 struct dfs_GetDFSReferral *r) 96 { 97 return NT_STATUS_NOT_IMPLEMENTED; 98 } 99 100 static DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, 101 const char *mask, uint32_t attr) 87 102 { 88 103 return NULL; 89 104 } 90 105 91 static SMB_STRUCT_DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr) 106 static NTSTATUS skel_snap_check_path(struct vfs_handle_struct *handle, 107 TALLOC_CTX *mem_ctx, 108 const char *service_path, 109 char **base_volume) 110 { 111 return NT_STATUS_NOT_SUPPORTED; 112 } 113 114 static NTSTATUS skel_snap_create(struct vfs_handle_struct *handle, 115 TALLOC_CTX *mem_ctx, 116 const char *base_volume, 117 time_t *tstamp, 118 bool rw, 119 char **base_path, 120 char **snap_path) 121 { 122 return NT_STATUS_NOT_SUPPORTED; 123 } 124 125 static NTSTATUS skel_snap_delete(struct vfs_handle_struct *handle, 126 TALLOC_CTX *mem_ctx, 127 char *base_path, 128 char *snap_path) 129 { 130 return NT_STATUS_NOT_SUPPORTED; 131 } 132 133 static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, 134 const char *mask, uint32_t attr) 92 135 { 93 136 return NULL; 94 137 } 95 138 96 static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, 97 SMB_STRUCT_DIR *dirp, 98 SMB_STRUCT_STAT *sbuf) 139 static struct dirent *skel_readdir(vfs_handle_struct *handle, 140 DIR *dirp, SMB_STRUCT_STAT *sbuf) 99 141 { 100 142 return NULL; 101 143 } 102 144 103 static void skel_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset)145 static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset) 104 146 { 105 147 ; 106 148 } 107 149 108 static long skel_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)150 static long skel_telldir(vfs_handle_struct *handle, DIR *dirp) 109 151 { 110 152 return (long)-1; 111 153 } 112 154 113 static void skel_rewind_dir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)155 static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp) 114 156 { 115 157 ; 116 158 } 117 159 118 static int skel_mkdir(vfs_handle_struct *handle, 119 { 120 errno = ENOSYS; 121 return -1; 122 } 123 124 static int skel_rmdir(vfs_handle_struct *handle, 125 { 126 errno = ENOSYS; 127 return -1; 128 } 129 130 static int skel_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dir)131 { 132 errno = ENOSYS; 133 return -1; 134 } 135 136 static void skel_init_search_op(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)160 static int skel_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode) 161 { 162 errno = ENOSYS; 163 return -1; 164 } 165 166 static int skel_rmdir(vfs_handle_struct *handle, const char *path) 167 { 168 errno = ENOSYS; 169 return -1; 170 } 171 172 static int skel_closedir(vfs_handle_struct *handle, DIR *dir) 173 { 174 errno = ENOSYS; 175 return -1; 176 } 177 178 static void skel_init_search_op(struct vfs_handle_struct *handle, DIR *dirp) 137 179 { 138 180 ; … … 147 189 148 190 static NTSTATUS skel_create_file(struct vfs_handle_struct *handle, 149 struct smb_request *req, 150 uint16_t root_dir_fid, 151 struct smb_filename *smb_fname, 152 uint32_t access_mask, 153 uint32_t share_access, 154 uint32_t create_disposition, 155 uint32_t create_options, 156 uint32_t file_attributes, 157 uint32_t oplock_request, 158 uint64_t allocation_size, 159 uint32_t private_flags, 160 struct security_descriptor *sd, 161 struct ea_list *ea_list, 162 files_struct **result, 163 int *pinfo) 191 struct smb_request *req, 192 uint16_t root_dir_fid, 193 struct smb_filename *smb_fname, 194 uint32_t access_mask, 195 uint32_t share_access, 196 uint32_t create_disposition, 197 uint32_t create_options, 198 uint32_t file_attributes, 199 uint32_t oplock_request, 200 struct smb2_lease *lease, 201 uint64_t allocation_size, 202 uint32_t private_flags, 203 struct security_descriptor *sd, 204 struct ea_list *ea_list, 205 files_struct **result, int *pinfo, 206 const struct smb2_create_blobs *in_context_blobs, 207 struct smb2_create_blobs *out_context_blobs) 164 208 { 165 209 return NT_STATUS_NOT_IMPLEMENTED; … … 172 216 } 173 217 174 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n) 175 { 176 errno = ENOSYS; 177 return -1; 178 } 179 180 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset) 181 { 182 errno = ENOSYS; 183 return -1; 184 } 185 186 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n) 187 { 188 errno = ENOSYS; 189 return -1; 190 } 191 192 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset) 193 { 194 errno = ENOSYS; 195 return -1; 196 } 197 198 static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence) 199 { 200 errno = ENOSYS; 201 return (SMB_OFF_T)-1; 202 } 203 204 static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n) 205 { 206 errno = ENOSYS; 207 return -1; 208 } 209 210 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n) 218 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, 219 void *data, size_t n) 220 { 221 errno = ENOSYS; 222 return -1; 223 } 224 225 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, 226 void *data, size_t n, off_t offset) 227 { 228 errno = ENOSYS; 229 return -1; 230 } 231 232 static struct tevent_req *skel_pread_send(struct vfs_handle_struct *handle, 233 TALLOC_CTX *mem_ctx, 234 struct tevent_context *ev, 235 struct files_struct *fsp, 236 void *data, size_t n, off_t offset) 237 { 238 return NULL; 239 } 240 241 static ssize_t skel_pread_recv(struct tevent_req *req, int *err) 242 { 243 *err = ENOSYS; 244 return -1; 245 } 246 247 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, 248 const void *data, size_t n) 249 { 250 errno = ENOSYS; 251 return -1; 252 } 253 254 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, 255 const void *data, size_t n, off_t offset) 256 { 257 errno = ENOSYS; 258 return -1; 259 } 260 261 static struct tevent_req *skel_pwrite_send(struct vfs_handle_struct *handle, 262 TALLOC_CTX *mem_ctx, 263 struct tevent_context *ev, 264 struct files_struct *fsp, 265 const void *data, 266 size_t n, off_t offset) 267 { 268 return NULL; 269 } 270 271 static ssize_t skel_pwrite_recv(struct tevent_req *req, int *err) 272 { 273 *err = ENOSYS; 274 return -1; 275 } 276 277 static off_t skel_lseek(vfs_handle_struct *handle, files_struct *fsp, 278 off_t offset, int whence) 279 { 280 errno = ENOSYS; 281 return (off_t) - 1; 282 } 283 284 static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, 285 files_struct *fromfsp, const DATA_BLOB *hdr, 286 off_t offset, size_t n) 287 { 288 errno = ENOSYS; 289 return -1; 290 } 291 292 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, 293 files_struct *tofsp, off_t offset, size_t n) 211 294 { 212 295 errno = ENOSYS; … … 228 311 } 229 312 313 static struct tevent_req *skel_fsync_send(struct vfs_handle_struct *handle, 314 TALLOC_CTX *mem_ctx, 315 struct tevent_context *ev, 316 struct files_struct *fsp) 317 { 318 return NULL; 319 } 320 321 static int skel_fsync_recv(struct tevent_req *req, int *err) 322 { 323 *err = ENOSYS; 324 return -1; 325 } 326 230 327 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname) 231 328 { … … 234 331 } 235 332 236 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf) 237 { 238 errno = ENOSYS; 239 return -1; 240 } 241 242 static int skel_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname) 243 { 244 errno = ENOSYS; 245 return -1; 246 } 247 248 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf) 333 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, 334 SMB_STRUCT_STAT *sbuf) 335 { 336 errno = ENOSYS; 337 return -1; 338 } 339 340 static int skel_lstat(vfs_handle_struct *handle, 341 struct smb_filename *smb_fname) 342 { 343 errno = ENOSYS; 344 return -1; 345 } 346 347 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle, 348 struct files_struct *fsp, 349 const SMB_STRUCT_STAT *sbuf) 249 350 { 250 351 errno = ENOSYS; … … 259 360 } 260 361 261 static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode) 262 { 263 errno = ENOSYS; 264 return -1; 265 } 266 267 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode) 268 { 269 errno = ENOSYS; 270 return -1; 271 } 272 273 static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid) 274 { 275 errno = ENOSYS; 276 return -1; 277 } 278 279 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid) 280 { 281 errno = ENOSYS; 282 return -1; 283 } 284 285 static int skel_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid) 286 { 287 errno = ENOSYS; 288 return -1; 289 } 290 291 static int skel_chdir(vfs_handle_struct *handle, const char *path) 292 { 293 errno = ENOSYS; 294 return -1; 295 } 296 297 static char *skel_getwd(vfs_handle_struct *handle, char *buf) 362 static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode) 363 { 364 errno = ENOSYS; 365 return -1; 366 } 367 368 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, 369 mode_t mode) 370 { 371 errno = ENOSYS; 372 return -1; 373 } 374 375 static int skel_chown(vfs_handle_struct *handle, const char *path, 376 uid_t uid, gid_t gid) 377 { 378 errno = ENOSYS; 379 return -1; 380 } 381 382 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, 383 uid_t uid, gid_t gid) 384 { 385 errno = ENOSYS; 386 return -1; 387 } 388 389 static int skel_lchown(vfs_handle_struct *handle, const char *path, 390 uid_t uid, gid_t gid) 391 { 392 errno = ENOSYS; 393 return -1; 394 } 395 396 static int skel_chdir(vfs_handle_struct *handle, const char *path) 397 { 398 errno = ENOSYS; 399 return -1; 400 } 401 402 static char *skel_getwd(vfs_handle_struct *handle) 298 403 { 299 404 errno = ENOSYS; … … 309 414 } 310 415 311 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset) 416 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, 417 off_t offset) 312 418 { 313 419 errno = ENOSYS; … … 316 422 317 423 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp, 318 enum vfs_fallocate_mode mode,319 SMB_OFF_T offset, SMB_OFF_T len) 320 { 321 errno = ENOSYS;322 return -1; 323 } 324 325 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_Tcount, int type)424 uint32_t mode, off_t offset, off_t len) 425 { 426 errno = ENOSYS; 427 return -1; 428 } 429 430 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, 431 off_t offset, off_t count, int type) 326 432 { 327 433 errno = ENOSYS; … … 329 435 } 330 436 331 static int skel_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode, uint32 access_mask) 332 { 333 errno = ENOSYS; 334 return -1; 335 } 336 337 static int skel_linux_setlease(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype) 338 { 339 errno = ENOSYS; 340 return -1; 341 } 342 343 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid) 437 static int skel_kernel_flock(struct vfs_handle_struct *handle, 438 struct files_struct *fsp, 439 uint32_t share_mode, uint32_t access_mask) 440 { 441 errno = ENOSYS; 442 return -1; 443 } 444 445 static int skel_linux_setlease(struct vfs_handle_struct *handle, 446 struct files_struct *fsp, int leasetype) 447 { 448 errno = ENOSYS; 449 return -1; 450 } 451 452 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, 453 off_t *poffset, off_t *pcount, int *ptype, 454 pid_t *ppid) 344 455 { 345 456 errno = ENOSYS; … … 347 458 } 348 459 349 static int skel_symlink(vfs_handle_struct *handle, const char *oldpath, const char *newpath) 350 { 351 errno = ENOSYS; 352 return -1; 353 } 354 355 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz) 356 { 357 errno = ENOSYS; 358 return -1; 359 } 360 361 static int skel_link(vfs_handle_struct *handle, const char *oldpath, const char *newpath) 362 { 363 errno = ENOSYS; 364 return -1; 365 } 366 367 static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev) 368 { 369 errno = ENOSYS; 370 return -1; 371 } 372 373 static char *skel_realpath(vfs_handle_struct *handle, const char *path) 460 static int skel_symlink(vfs_handle_struct *handle, const char *oldpath, 461 const char *newpath) 462 { 463 errno = ENOSYS; 464 return -1; 465 } 466 467 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path, 468 char *buf, size_t bufsiz) 469 { 470 errno = ENOSYS; 471 return -1; 472 } 473 474 static int skel_link(vfs_handle_struct *handle, const char *oldpath, 475 const char *newpath) 476 { 477 errno = ENOSYS; 478 return -1; 479 } 480 481 static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode, 482 SMB_DEV_T dev) 483 { 484 errno = ENOSYS; 485 return -1; 486 } 487 488 static char *skel_realpath(vfs_handle_struct *handle, const char *path) 374 489 { 375 490 errno = ENOSYS; … … 377 492 } 378 493 379 static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle, 380 struct sys_notify_context *ctx, struct notify_entry *e, 381 void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev), 382 void *private_data, void *handle_p) 383 { 384 return NT_STATUS_NOT_IMPLEMENTED; 385 } 386 387 static int skel_chflags(vfs_handle_struct *handle, const char *path, uint flags) 494 static int skel_chflags(vfs_handle_struct *handle, const char *path, 495 uint flags) 388 496 { 389 497 errno = ENOSYS; … … 398 506 errno = ENOSYS; 399 507 return id; 508 } 509 510 struct skel_cc_state { 511 uint64_t unused; 512 }; 513 static struct tevent_req *skel_copy_chunk_send(struct vfs_handle_struct *handle, 514 TALLOC_CTX *mem_ctx, 515 struct tevent_context *ev, 516 struct files_struct *src_fsp, 517 off_t src_off, 518 struct files_struct *dest_fsp, 519 off_t dest_off, 520 off_t num) 521 { 522 struct tevent_req *req; 523 struct skel_cc_state *cc_state; 524 525 req = tevent_req_create(mem_ctx, &cc_state, struct skel_cc_state); 526 if (req == NULL) { 527 return NULL; 528 } 529 530 tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED); 531 return tevent_req_post(req, ev); 532 } 533 534 static NTSTATUS skel_copy_chunk_recv(struct vfs_handle_struct *handle, 535 struct tevent_req *req, 536 off_t *copied) 537 { 538 NTSTATUS status; 539 540 if (tevent_req_is_nterror(req, &status)) { 541 tevent_req_received(req); 542 return status; 543 } 544 tevent_req_received(req); 545 546 return NT_STATUS_OK; 547 } 548 549 static NTSTATUS skel_get_compression(struct vfs_handle_struct *handle, 550 TALLOC_CTX *mem_ctx, 551 struct files_struct *fsp, 552 struct smb_filename *smb_fname, 553 uint16_t *_compression_fmt) 554 { 555 return NT_STATUS_INVALID_DEVICE_REQUEST; 556 } 557 558 static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle, 559 TALLOC_CTX *mem_ctx, 560 struct files_struct *fsp, 561 uint16_t compression_fmt) 562 { 563 return NT_STATUS_INVALID_DEVICE_REQUEST; 400 564 } 401 565 … … 411 575 412 576 static int skel_get_real_filename(struct vfs_handle_struct *handle, 413 const char *path, 414 const char *name, 577 const char *path, 578 const char *name, 579 TALLOC_CTX *mem_ctx, char **found_name) 580 { 581 errno = ENOSYS; 582 return -1; 583 } 584 585 static const char *skel_connectpath(struct vfs_handle_struct *handle, 586 const char *filename) 587 { 588 errno = ENOSYS; 589 return NULL; 590 } 591 592 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle, 593 struct byte_range_lock *br_lck, 594 struct lock_struct *plock, 595 bool blocking_lock) 596 { 597 return NT_STATUS_NOT_IMPLEMENTED; 598 } 599 600 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle, 601 struct messaging_context *msg_ctx, 602 struct byte_range_lock *br_lck, 603 const struct lock_struct *plock) 604 { 605 errno = ENOSYS; 606 return false; 607 } 608 609 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle, 610 struct byte_range_lock *br_lck, 611 struct lock_struct *plock) 612 { 613 errno = ENOSYS; 614 return false; 615 } 616 617 static bool skel_strict_lock(struct vfs_handle_struct *handle, 618 struct files_struct *fsp, 619 struct lock_struct *plock) 620 { 621 errno = ENOSYS; 622 return false; 623 } 624 625 static void skel_strict_unlock(struct vfs_handle_struct *handle, 626 struct files_struct *fsp, 627 struct lock_struct *plock) 628 { 629 ; 630 } 631 632 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle, 633 const char *mapped_name, 634 enum vfs_translate_direction direction, 635 TALLOC_CTX *mem_ctx, char **pmapped_name) 636 { 637 return NT_STATUS_NOT_IMPLEMENTED; 638 } 639 640 static NTSTATUS skel_fsctl(struct vfs_handle_struct *handle, 641 struct files_struct *fsp, 642 TALLOC_CTX *ctx, 643 uint32_t function, 644 uint16_t req_flags, /* Needed for UNICODE ... */ 645 const uint8_t *_in_data, 646 uint32_t in_len, 647 uint8_t **_out_data, 648 uint32_t max_out_len, uint32_t *out_len) 649 { 650 return NT_STATUS_NOT_IMPLEMENTED; 651 } 652 653 static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle, 654 const struct smb_filename *fname, 655 TALLOC_CTX *mem_ctx, 656 struct readdir_attr_data **pattr_data) 657 { 658 return NT_STATUS_NOT_IMPLEMENTED; 659 } 660 661 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, 662 uint32_t security_info, 663 TALLOC_CTX *mem_ctx, 664 struct security_descriptor **ppdesc) 665 { 666 return NT_STATUS_NOT_IMPLEMENTED; 667 } 668 669 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle, 670 const char *name, uint32_t security_info, 415 671 TALLOC_CTX *mem_ctx, 416 char **found_name) 417 { 418 errno = ENOSYS; 419 return -1; 420 } 421 422 static const char *skel_connectpath(struct vfs_handle_struct *handle, 423 const char *filename) 424 { 425 errno = ENOSYS; 426 return NULL; 427 } 428 429 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle, 430 struct byte_range_lock *br_lck, 431 struct lock_struct *plock, 432 bool blocking_lock, 433 struct blocking_lock_record *blr) 672 struct security_descriptor **ppdesc) 434 673 { 435 674 return NT_STATUS_NOT_IMPLEMENTED; 436 675 } 437 676 438 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle, 439 struct messaging_context *msg_ctx, 440 struct byte_range_lock *br_lck, 441 const struct lock_struct *plock) 677 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, 678 uint32_t security_info_sent, 679 const struct security_descriptor *psd) 680 { 681 return NT_STATUS_NOT_IMPLEMENTED; 682 } 683 684 static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, 685 mode_t mode) 686 { 687 errno = ENOSYS; 688 return -1; 689 } 690 691 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, 692 mode_t mode) 693 { 694 errno = ENOSYS; 695 return -1; 696 } 697 698 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, 699 const char *path_p, 700 SMB_ACL_TYPE_T type, 701 TALLOC_CTX *mem_ctx) 702 { 703 errno = ENOSYS; 704 return (SMB_ACL_T) NULL; 705 } 706 707 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, 708 files_struct *fsp, TALLOC_CTX *mem_ctx) 709 { 710 errno = ENOSYS; 711 return (SMB_ACL_T) NULL; 712 } 713 714 static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle, 715 const char *path_p, TALLOC_CTX *mem_ctx, 716 char **blob_description, DATA_BLOB *blob) 717 { 718 errno = ENOSYS; 719 return -1; 720 } 721 722 static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle, 723 files_struct *fsp, TALLOC_CTX *mem_ctx, 724 char **blob_description, DATA_BLOB *blob) 725 { 726 errno = ENOSYS; 727 return -1; 728 } 729 730 static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name, 731 SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl) 732 { 733 errno = ENOSYS; 734 return -1; 735 } 736 737 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, 738 SMB_ACL_T theacl) 739 { 740 errno = ENOSYS; 741 return -1; 742 } 743 744 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, 745 const char *path) 746 { 747 errno = ENOSYS; 748 return -1; 749 } 750 751 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, 752 const char *name, void *value, size_t size) 753 { 754 errno = ENOSYS; 755 return -1; 756 } 757 758 static ssize_t skel_fgetxattr(vfs_handle_struct *handle, 759 struct files_struct *fsp, const char *name, 760 void *value, size_t size) 761 { 762 errno = ENOSYS; 763 return -1; 764 } 765 766 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, 767 char *list, size_t size) 768 { 769 errno = ENOSYS; 770 return -1; 771 } 772 773 static ssize_t skel_flistxattr(vfs_handle_struct *handle, 774 struct files_struct *fsp, char *list, 775 size_t size) 776 { 777 errno = ENOSYS; 778 return -1; 779 } 780 781 static int skel_removexattr(vfs_handle_struct *handle, const char *path, 782 const char *name) 783 { 784 errno = ENOSYS; 785 return -1; 786 } 787 788 static int skel_fremovexattr(vfs_handle_struct *handle, 789 struct files_struct *fsp, const char *name) 790 { 791 errno = ENOSYS; 792 return -1; 793 return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name); 794 } 795 796 static int skel_setxattr(vfs_handle_struct *handle, const char *path, 797 const char *name, const void *value, size_t size, 798 int flags) 799 { 800 errno = ENOSYS; 801 return -1; 802 } 803 804 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, 805 const char *name, const void *value, size_t size, 806 int flags) 807 { 808 errno = ENOSYS; 809 return -1; 810 } 811 812 static bool skel_aio_force(struct vfs_handle_struct *handle, 813 struct files_struct *fsp) 442 814 { 443 815 errno = ENOSYS; … … 445 817 } 446 818 447 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle, 448 struct byte_range_lock *br_lck, 449 struct lock_struct *plock, 450 struct blocking_lock_record *blr) 819 static bool skel_is_offline(struct vfs_handle_struct *handle, 820 const struct smb_filename *fname, 821 SMB_STRUCT_STAT *sbuf) 451 822 { 452 823 errno = ENOSYS; … … 454 825 } 455 826 456 static bool skel_strict_lock(struct vfs_handle_struct *handle, 457 struct files_struct *fsp, 458 struct lock_struct *plock) 459 { 460 errno = ENOSYS; 461 return false; 462 } 463 464 static void skel_strict_unlock(struct vfs_handle_struct *handle, 465 struct files_struct *fsp, 466 struct lock_struct *plock) 467 { 468 ; 469 } 470 471 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle, 472 const char *mapped_name, 473 enum vfs_translate_direction direction, 474 TALLOC_CTX *mem_ctx, 475 char **pmapped_name) 476 { 477 return NT_STATUS_NOT_IMPLEMENTED; 478 } 479 480 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, 481 uint32 security_info, struct security_descriptor **ppdesc) 482 { 483 return NT_STATUS_NOT_IMPLEMENTED; 484 } 485 486 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle, 487 const char *name, uint32 security_info, struct security_descriptor **ppdesc) 488 { 489 return NT_STATUS_NOT_IMPLEMENTED; 490 } 491 492 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, 493 uint32 security_info_sent, const struct security_descriptor *psd) 494 { 495 return NT_STATUS_NOT_IMPLEMENTED; 496 } 497 498 static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode) 499 { 500 errno = ENOSYS; 501 return -1; 502 } 503 504 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode) 505 { 506 errno = ENOSYS; 507 return -1; 508 } 509 510 static int skel_sys_acl_get_entry(vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p) 511 { 512 errno = ENOSYS; 513 return -1; 514 } 515 516 static int skel_sys_acl_get_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p) 517 { 518 errno = ENOSYS; 519 return -1; 520 } 521 522 static int skel_sys_acl_get_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p) 523 { 524 errno = ENOSYS; 525 return -1; 526 } 527 528 static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d) 529 { 530 errno = ENOSYS; 531 return NULL; 532 } 533 534 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type) 535 { 536 errno = ENOSYS; 537 return (SMB_ACL_T)NULL; 538 } 539 540 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp) 541 { 542 errno = ENOSYS; 543 return (SMB_ACL_T)NULL; 544 } 545 546 static int skel_sys_acl_clear_perms(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset) 547 { 548 errno = ENOSYS; 549 return -1; 550 } 551 552 static int skel_sys_acl_add_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) 553 { 554 errno = ENOSYS; 555 return -1; 556 } 557 558 static char *skel_sys_acl_to_text(vfs_handle_struct *handle, SMB_ACL_T theacl, ssize_t *plen) 559 { 560 errno = ENOSYS; 561 return NULL; 562 } 563 564 static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle, int count) 565 { 566 errno = ENOSYS; 567 return (SMB_ACL_T)NULL; 568 } 569 570 static int skel_sys_acl_create_entry(vfs_handle_struct *handle, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry) 571 { 572 errno = ENOSYS; 573 return -1; 574 } 575 576 static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype) 577 { 578 errno = ENOSYS; 579 return -1; 580 } 581 582 static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, void *qual) 583 { 584 errno = ENOSYS; 585 return -1; 586 } 587 588 static int skel_sys_acl_set_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset) 589 { 590 errno = ENOSYS; 591 return -1; 592 } 593 594 static int skel_sys_acl_valid(vfs_handle_struct *handle, SMB_ACL_T theacl ) 595 { 596 errno = ENOSYS; 597 return -1; 598 } 599 600 static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl) 601 { 602 errno = ENOSYS; 603 return -1; 604 } 605 606 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl) 607 { 608 errno = ENOSYS; 609 return -1; 610 } 611 612 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *path) 613 { 614 errno = ENOSYS; 615 return -1; 616 } 617 618 static int skel_sys_acl_get_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) 619 { 620 errno = ENOSYS; 621 return -1; 622 } 623 624 static int skel_sys_acl_free_text(vfs_handle_struct *handle, char *text) 625 { 626 errno = ENOSYS; 627 return -1; 628 } 629 630 static int skel_sys_acl_free_acl(vfs_handle_struct *handle, SMB_ACL_T posix_acl) 631 { 632 errno = ENOSYS; 633 return -1; 634 } 635 636 static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle, void *qualifier, SMB_ACL_TAG_T tagtype) 637 { 638 errno = ENOSYS; 639 return -1; 640 } 641 642 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size) 643 { 644 errno = ENOSYS; 645 return -1; 646 } 647 648 static ssize_t skel_lgetxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t 649 size) 650 { 651 errno = ENOSYS; 652 return -1; 653 } 654 655 static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size) 656 { 657 errno = ENOSYS; 658 return -1; 659 } 660 661 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size) 662 { 663 errno = ENOSYS; 664 return -1; 665 } 666 667 static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size) 668 { 669 errno = ENOSYS; 670 return -1; 671 } 672 673 static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size) 674 { 675 errno = ENOSYS; 676 return -1; 677 } 678 679 static int skel_removexattr(vfs_handle_struct *handle, const char *path, const char *name) 680 { 681 errno = ENOSYS; 682 return -1; 683 } 684 685 static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const char *name) 686 { 687 errno = ENOSYS; 688 return -1; 689 } 690 691 static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name) 692 { 693 errno = ENOSYS; 694 return -1; 695 return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name); 696 } 697 698 static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags) 699 { 700 errno = ENOSYS; 701 return -1; 702 } 703 704 static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags) 705 { 706 errno = ENOSYS; 707 return -1; 708 } 709 710 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags) 711 { 712 errno = ENOSYS; 713 return -1; 714 } 715 716 static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) 717 { 718 errno = ENOSYS; 719 return -1; 720 } 721 722 static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) 723 { 724 errno = ENOSYS; 725 return -1; 726 } 727 728 static ssize_t skel_aio_return_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) 729 { 730 errno = ENOSYS; 731 return -1; 732 } 733 734 static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) 735 { 736 errno = ENOSYS; 737 return -1; 738 } 739 740 static int skel_aio_error_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) 741 { 742 errno = ENOSYS; 743 return -1; 744 } 745 746 static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb) 747 { 748 errno = ENOSYS; 749 return -1; 750 } 751 752 static int skel_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts) 753 { 754 errno = ENOSYS; 755 return -1; 756 } 757 758 static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp) 759 { 760 errno = ENOSYS; 761 return false; 762 } 763 764 static bool skel_is_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname, SMB_STRUCT_STAT *sbuf) 765 { 766 errno = ENOSYS; 767 return false; 768 } 769 770 static int skel_set_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname) 827 static int skel_set_offline(struct vfs_handle_struct *handle, 828 const struct smb_filename *fname) 771 829 { 772 830 errno = ENOSYS; … … 776 834 /* VFS operations structure */ 777 835 778 struct vfs_fn_pointers skel_ transparent_fns = {836 struct vfs_fn_pointers skel_opaque_fns = { 779 837 /* Disk operations */ 780 838 781 839 .connect_fn = skel_connect, 782 .disconnect = skel_disconnect, 783 .disk_free = skel_disk_free, 784 .get_quota = skel_get_quota, 785 .set_quota = skel_set_quota, 786 .get_shadow_copy_data = skel_get_shadow_copy_data, 787 .statvfs = skel_statvfs, 788 .fs_capabilities = skel_fs_capabilities, 840 .disconnect_fn = skel_disconnect, 841 .disk_free_fn = skel_disk_free, 842 .get_quota_fn = skel_get_quota, 843 .set_quota_fn = skel_set_quota, 844 .get_shadow_copy_data_fn = skel_get_shadow_copy_data, 845 .statvfs_fn = skel_statvfs, 846 .fs_capabilities_fn = skel_fs_capabilities, 847 .get_dfs_referrals_fn = skel_get_dfs_referrals, 848 .snap_check_path_fn = skel_snap_check_path, 849 .snap_create_fn = skel_snap_create, 850 .snap_delete_fn = skel_snap_delete, 789 851 790 852 /* Directory operations */ 791 853 792 .opendir = skel_opendir,793 .fdopendir = skel_fdopendir,794 .readdir = skel_readdir,795 .seekdir = skel_seekdir,796 .telldir = skel_telldir,797 .rewind_dir = skel_rewind_dir,798 .mkdir = skel_mkdir,799 .rmdir = skel_rmdir,800 .closedir = skel_closedir,801 .init_search_op = skel_init_search_op,854 .opendir_fn = skel_opendir, 855 .fdopendir_fn = skel_fdopendir, 856 .readdir_fn = skel_readdir, 857 .seekdir_fn = skel_seekdir, 858 .telldir_fn = skel_telldir, 859 .rewind_dir_fn = skel_rewind_dir, 860 .mkdir_fn = skel_mkdir, 861 .rmdir_fn = skel_rmdir, 862 .closedir_fn = skel_closedir, 863 .init_search_op_fn = skel_init_search_op, 802 864 803 865 /* File operations */ 804 866 805 867 .open_fn = skel_open, 806 .create_file = skel_create_file,868 .create_file_fn = skel_create_file, 807 869 .close_fn = skel_close_fn, 808 .vfs_read = skel_vfs_read, 809 .pread = skel_pread, 810 .write = skel_write, 811 .pwrite = skel_pwrite, 812 .lseek = skel_lseek, 813 .sendfile = skel_sendfile, 814 .recvfile = skel_recvfile, 815 .rename = skel_rename, 816 .fsync = skel_fsync, 817 .stat = skel_stat, 818 .fstat = skel_fstat, 819 .lstat = skel_lstat, 820 .get_alloc_size = skel_get_alloc_size, 821 .unlink = skel_unlink, 822 .chmod = skel_chmod, 823 .fchmod = skel_fchmod, 824 .chown = skel_chown, 825 .fchown = skel_fchown, 826 .lchown = skel_lchown, 827 .chdir = skel_chdir, 828 .getwd = skel_getwd, 829 .ntimes = skel_ntimes, 830 .ftruncate = skel_ftruncate, 831 .fallocate = skel_fallocate, 832 .lock = skel_lock, 833 .kernel_flock = skel_kernel_flock, 834 .linux_setlease = skel_linux_setlease, 835 .getlock = skel_getlock, 836 .symlink = skel_symlink, 837 .vfs_readlink = skel_vfs_readlink, 838 .link = skel_link, 839 .mknod = skel_mknod, 840 .realpath = skel_realpath, 841 .notify_watch = skel_notify_watch, 842 .chflags = skel_chflags, 843 .file_id_create = skel_file_id_create, 844 845 .streaminfo = skel_streaminfo, 846 .get_real_filename = skel_get_real_filename, 847 .connectpath = skel_connectpath, 848 .brl_lock_windows = skel_brl_lock_windows, 849 .brl_unlock_windows = skel_brl_unlock_windows, 850 .brl_cancel_windows = skel_brl_cancel_windows, 851 .strict_lock = skel_strict_lock, 852 .strict_unlock = skel_strict_unlock, 853 .translate_name = skel_translate_name, 870 .read_fn = skel_vfs_read, 871 .pread_fn = skel_pread, 872 .pread_send_fn = skel_pread_send, 873 .pread_recv_fn = skel_pread_recv, 874 .write_fn = skel_write, 875 .pwrite_fn = skel_pwrite, 876 .pwrite_send_fn = skel_pwrite_send, 877 .pwrite_recv_fn = skel_pwrite_recv, 878 .lseek_fn = skel_lseek, 879 .sendfile_fn = skel_sendfile, 880 .recvfile_fn = skel_recvfile, 881 .rename_fn = skel_rename, 882 .fsync_fn = skel_fsync, 883 .fsync_send_fn = skel_fsync_send, 884 .fsync_recv_fn = skel_fsync_recv, 885 .stat_fn = skel_stat, 886 .fstat_fn = skel_fstat, 887 .lstat_fn = skel_lstat, 888 .get_alloc_size_fn = skel_get_alloc_size, 889 .unlink_fn = skel_unlink, 890 .chmod_fn = skel_chmod, 891 .fchmod_fn = skel_fchmod, 892 .chown_fn = skel_chown, 893 .fchown_fn = skel_fchown, 894 .lchown_fn = skel_lchown, 895 .chdir_fn = skel_chdir, 896 .getwd_fn = skel_getwd, 897 .ntimes_fn = skel_ntimes, 898 .ftruncate_fn = skel_ftruncate, 899 .fallocate_fn = skel_fallocate, 900 .lock_fn = skel_lock, 901 .kernel_flock_fn = skel_kernel_flock, 902 .linux_setlease_fn = skel_linux_setlease, 903 .getlock_fn = skel_getlock, 904 .symlink_fn = skel_symlink, 905 .readlink_fn = skel_vfs_readlink, 906 .link_fn = skel_link, 907 .mknod_fn = skel_mknod, 908 .realpath_fn = skel_realpath, 909 .chflags_fn = skel_chflags, 910 .file_id_create_fn = skel_file_id_create, 911 .copy_chunk_send_fn = skel_copy_chunk_send, 912 .copy_chunk_recv_fn = skel_copy_chunk_recv, 913 .get_compression_fn = skel_get_compression, 914 .set_compression_fn = skel_set_compression, 915 916 .streaminfo_fn = skel_streaminfo, 917 .get_real_filename_fn = skel_get_real_filename, 918 .connectpath_fn = skel_connectpath, 919 .brl_lock_windows_fn = skel_brl_lock_windows, 920 .brl_unlock_windows_fn = skel_brl_unlock_windows, 921 .brl_cancel_windows_fn = skel_brl_cancel_windows, 922 .strict_lock_fn = skel_strict_lock, 923 .strict_unlock_fn = skel_strict_unlock, 924 .translate_name_fn = skel_translate_name, 925 .fsctl_fn = skel_fsctl, 926 .readdir_attr_fn = skel_readdir_attr, 854 927 855 928 /* NT ACL operations. */ 856 929 857 .fget_nt_acl = skel_fget_nt_acl,858 .get_nt_acl = skel_get_nt_acl,859 .fset_nt_acl = skel_fset_nt_acl,930 .fget_nt_acl_fn = skel_fget_nt_acl, 931 .get_nt_acl_fn = skel_get_nt_acl, 932 .fset_nt_acl_fn = skel_fset_nt_acl, 860 933 861 934 /* POSIX ACL operations. */ 862 935 863 .chmod_acl = skel_chmod_acl, 864 .fchmod_acl = skel_fchmod_acl, 865 866 .sys_acl_get_entry = skel_sys_acl_get_entry, 867 .sys_acl_get_tag_type = skel_sys_acl_get_tag_type, 868 .sys_acl_get_permset = skel_sys_acl_get_permset, 869 .sys_acl_get_qualifier = skel_sys_acl_get_qualifier, 870 .sys_acl_get_file = skel_sys_acl_get_file, 871 .sys_acl_get_fd = skel_sys_acl_get_fd, 872 .sys_acl_clear_perms = skel_sys_acl_clear_perms, 873 .sys_acl_add_perm = skel_sys_acl_add_perm, 874 .sys_acl_to_text = skel_sys_acl_to_text, 875 .sys_acl_init = skel_sys_acl_init, 876 .sys_acl_create_entry = skel_sys_acl_create_entry, 877 .sys_acl_set_tag_type = skel_sys_acl_set_tag_type, 878 .sys_acl_set_qualifier = skel_sys_acl_set_qualifier, 879 .sys_acl_set_permset = skel_sys_acl_set_permset, 880 .sys_acl_valid = skel_sys_acl_valid, 881 .sys_acl_set_file = skel_sys_acl_set_file, 882 .sys_acl_set_fd = skel_sys_acl_set_fd, 883 .sys_acl_delete_def_file = skel_sys_acl_delete_def_file, 884 .sys_acl_get_perm = skel_sys_acl_get_perm, 885 .sys_acl_free_text = skel_sys_acl_free_text, 886 .sys_acl_free_acl = skel_sys_acl_free_acl, 887 .sys_acl_free_qualifier = skel_sys_acl_free_qualifier, 936 .chmod_acl_fn = skel_chmod_acl, 937 .fchmod_acl_fn = skel_fchmod_acl, 938 939 .sys_acl_get_file_fn = skel_sys_acl_get_file, 940 .sys_acl_get_fd_fn = skel_sys_acl_get_fd, 941 .sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file, 942 .sys_acl_blob_get_fd_fn = skel_sys_acl_blob_get_fd, 943 .sys_acl_set_file_fn = skel_sys_acl_set_file, 944 .sys_acl_set_fd_fn = skel_sys_acl_set_fd, 945 .sys_acl_delete_def_file_fn = skel_sys_acl_delete_def_file, 888 946 889 947 /* EA operations. */ 890 .getxattr = skel_getxattr, 891 .lgetxattr = skel_lgetxattr, 892 .fgetxattr = skel_fgetxattr, 893 .listxattr = skel_listxattr, 894 .llistxattr = skel_llistxattr, 895 .flistxattr = skel_flistxattr, 896 .removexattr = skel_removexattr, 897 .lremovexattr = skel_lremovexattr, 898 .fremovexattr = skel_fremovexattr, 899 .setxattr = skel_setxattr, 900 .lsetxattr = skel_lsetxattr, 901 .fsetxattr = skel_fsetxattr, 948 .getxattr_fn = skel_getxattr, 949 .fgetxattr_fn = skel_fgetxattr, 950 .listxattr_fn = skel_listxattr, 951 .flistxattr_fn = skel_flistxattr, 952 .removexattr_fn = skel_removexattr, 953 .fremovexattr_fn = skel_fremovexattr, 954 .setxattr_fn = skel_setxattr, 955 .fsetxattr_fn = skel_fsetxattr, 902 956 903 957 /* aio operations */ 904 .aio_read = skel_aio_read, 905 .aio_write = skel_aio_write, 906 .aio_return_fn = skel_aio_return_fn, 907 .aio_cancel = skel_aio_cancel, 908 .aio_error_fn = skel_aio_error_fn, 909 .aio_fsync = skel_aio_fsync, 910 .aio_suspend = skel_aio_suspend, 911 .aio_force = skel_aio_force, 958 .aio_force_fn = skel_aio_force, 912 959 913 960 /* offline operations */ 914 .is_offline = skel_is_offline,915 .set_offline = skel_set_offline961 .is_offline_fn = skel_is_offline, 962 .set_offline_fn = skel_set_offline 916 963 }; 917 964 918 NTSTATUS vfs_skel_transparent_init(void) 919 { 920 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_transparent", &skel_transparent_fns); 921 } 965 static_decl_vfs; 966 NTSTATUS vfs_skel_opaque_init(void) 967 { 968 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_opaque", 969 &skel_opaque_fns); 970 } -
vendor/current/examples/VFS/skel_transparent.c
r860 r988 22 22 */ 23 23 24 25 #include " includes.h"26 #include " smbd/proto.h"24 #include "../source3/include/includes.h" 25 #include "lib/util/tevent_unix.h" 26 #include "lib/util/tevent_ntstatus.h" 27 27 28 28 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE … … 38 38 */ 39 39 40 static int skel_connect(vfs_handle_struct *handle, const char *service, const char *user) 40 static int skel_connect(vfs_handle_struct *handle, const char *service, 41 const char *user) 41 42 { 42 43 return SMB_VFS_NEXT_CONNECT(handle, service, user); … … 48 49 } 49 50 50 static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path, 51 bool small_query, uint64_t *bsize, 52 uint64_t *dfree, uint64_t *dsize) 53 { 54 return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize, 55 dfree, dsize); 56 } 57 58 static int skel_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq) 59 { 60 return SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, dq); 61 } 62 63 static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq) 51 static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path, 52 uint64_t *bsize, 53 uint64_t *dfree, uint64_t *dsize) 54 { 55 return SMB_VFS_NEXT_DISK_FREE(handle, path, bsize, dfree, dsize); 56 } 57 58 static int skel_get_quota(vfs_handle_struct *handle, const char *path, 59 enum SMB_QUOTA_TYPE qtype, unid_t id, 60 SMB_DISK_QUOTA *dq) 61 { 62 return SMB_VFS_NEXT_GET_QUOTA(handle, path, qtype, id, dq); 63 } 64 65 static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, 66 unid_t id, SMB_DISK_QUOTA *dq) 64 67 { 65 68 return SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, dq); 66 69 } 67 70 68 static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, struct shadow_copy_data *shadow_copy_data, bool labels) 69 { 70 return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels); 71 } 72 73 static int skel_statvfs(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf) 71 static int skel_get_shadow_copy_data(vfs_handle_struct *handle, 72 files_struct *fsp, 73 struct shadow_copy_data *shadow_copy_data, 74 bool labels) 75 { 76 return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, 77 labels); 78 } 79 80 static int skel_statvfs(struct vfs_handle_struct *handle, const char *path, 81 struct vfs_statvfs_struct *statbuf) 74 82 { 75 83 return SMB_VFS_NEXT_STATVFS(handle, path, statbuf); 76 84 } 77 85 78 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res) 86 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle, 87 enum timestamp_set_resolution *p_ts_res) 79 88 { 80 89 return SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res); 81 90 } 82 91 83 static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr) 92 static NTSTATUS skel_get_dfs_referrals(struct vfs_handle_struct *handle, 93 struct dfs_GetDFSReferral *r) 94 { 95 return SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r); 96 } 97 98 static DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, 99 const char *mask, uint32_t attr) 84 100 { 85 101 return SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr); 86 102 } 87 103 88 static SMB_STRUCT_DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr) 104 static NTSTATUS skel_snap_check_path(struct vfs_handle_struct *handle, 105 TALLOC_CTX *mem_ctx, 106 const char *service_path, 107 char **base_volume) 108 { 109 return SMB_VFS_NEXT_SNAP_CHECK_PATH(handle, mem_ctx, service_path, 110 base_volume); 111 } 112 113 static NTSTATUS skel_snap_create(struct vfs_handle_struct *handle, 114 TALLOC_CTX *mem_ctx, 115 const char *base_volume, 116 time_t *tstamp, 117 bool rw, 118 char **base_path, 119 char **snap_path) 120 { 121 return SMB_VFS_NEXT_SNAP_CREATE(handle, mem_ctx, base_volume, tstamp, 122 rw, base_path, snap_path); 123 } 124 125 static NTSTATUS skel_snap_delete(struct vfs_handle_struct *handle, 126 TALLOC_CTX *mem_ctx, 127 char *base_path, 128 char *snap_path) 129 { 130 return SMB_VFS_NEXT_SNAP_DELETE(handle, mem_ctx, base_path, snap_path); 131 } 132 133 static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, 134 const char *mask, uint32_t attr) 89 135 { 90 136 return SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr); 91 137 } 92 138 93 static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, 94 SMB_STRUCT_DIR *dirp, 95 SMB_STRUCT_STAT *sbuf) 139 static struct dirent *skel_readdir(vfs_handle_struct *handle, 140 DIR *dirp, SMB_STRUCT_STAT *sbuf) 96 141 { 97 142 return SMB_VFS_NEXT_READDIR(handle, dirp, sbuf); 98 143 } 99 144 100 static void skel_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset)145 static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset) 101 146 { 102 147 SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset); 103 148 } 104 149 105 static long skel_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)150 static long skel_telldir(vfs_handle_struct *handle, DIR *dirp) 106 151 { 107 152 return SMB_VFS_NEXT_TELLDIR(handle, dirp); 108 153 } 109 154 110 static void skel_rewind_dir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)155 static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp) 111 156 { 112 157 SMB_VFS_NEXT_REWINDDIR(handle, dirp); 113 158 } 114 159 115 static int skel_mkdir(vfs_handle_struct *handle, 160 static int skel_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode) 116 161 { 117 162 return SMB_VFS_NEXT_MKDIR(handle, path, mode); 118 163 } 119 164 120 static int skel_rmdir(vfs_handle_struct *handle, 165 static int skel_rmdir(vfs_handle_struct *handle, const char *path) 121 166 { 122 167 return SMB_VFS_NEXT_RMDIR(handle, path); 123 168 } 124 169 125 static int skel_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dir)170 static int skel_closedir(vfs_handle_struct *handle, DIR *dir) 126 171 { 127 172 return SMB_VFS_NEXT_CLOSEDIR(handle, dir); 128 173 } 129 174 130 static void skel_init_search_op(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)175 static void skel_init_search_op(struct vfs_handle_struct *handle, DIR *dirp) 131 176 { 132 177 SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp); … … 140 185 141 186 static NTSTATUS skel_create_file(struct vfs_handle_struct *handle, 142 struct smb_request *req, 143 uint16_t root_dir_fid, 144 struct smb_filename *smb_fname, 145 uint32_t access_mask, 146 uint32_t share_access, 147 uint32_t create_disposition, 148 uint32_t create_options, 149 uint32_t file_attributes, 150 uint32_t oplock_request, 151 uint64_t allocation_size, 152 uint32_t private_flags, 153 struct security_descriptor *sd, 154 struct ea_list *ea_list, 155 files_struct **result, 156 int *pinfo) 187 struct smb_request *req, 188 uint16_t root_dir_fid, 189 struct smb_filename *smb_fname, 190 uint32_t access_mask, 191 uint32_t share_access, 192 uint32_t create_disposition, 193 uint32_t create_options, 194 uint32_t file_attributes, 195 uint32_t oplock_request, 196 struct smb2_lease *lease, 197 uint64_t allocation_size, 198 uint32_t private_flags, 199 struct security_descriptor *sd, 200 struct ea_list *ea_list, 201 files_struct ** result, int *pinfo, 202 const struct smb2_create_blobs *in_context_blobs, 203 struct smb2_create_blobs *out_context_blobs) 157 204 { 158 205 return SMB_VFS_NEXT_CREATE_FILE(handle, 159 req, 160 root_dir_fid, 161 smb_fname, 162 access_mask, 163 share_access, 164 create_disposition, 165 create_options, 166 file_attributes, 167 oplock_request, 168 allocation_size, 169 private_flags, 170 sd, 171 ea_list, 172 result, 173 pinfo); 206 req, 207 root_dir_fid, 208 smb_fname, 209 access_mask, 210 share_access, 211 create_disposition, 212 create_options, 213 file_attributes, 214 oplock_request, 215 lease, 216 allocation_size, 217 private_flags, 218 sd, ea_list, result, pinfo, 219 in_context_blobs, out_context_blobs); 174 220 } 175 221 … … 179 225 } 180 226 181 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n) 227 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, 228 void *data, size_t n) 182 229 { 183 230 return SMB_VFS_NEXT_READ(handle, fsp, data, n); 184 231 } 185 232 186 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset) 233 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, 234 void *data, size_t n, off_t offset) 187 235 { 188 236 return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset); 189 237 } 190 238 191 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n) 239 struct skel_pread_state { 240 ssize_t ret; 241 int err; 242 }; 243 244 static void skel_pread_done(struct tevent_req *subreq); 245 246 static struct tevent_req *skel_pread_send(struct vfs_handle_struct *handle, 247 TALLOC_CTX *mem_ctx, 248 struct tevent_context *ev, 249 struct files_struct *fsp, 250 void *data, size_t n, off_t offset) 251 { 252 struct tevent_req *req, *subreq; 253 struct skel_pread_state *state; 254 255 req = tevent_req_create(mem_ctx, &state, struct skel_pread_state); 256 if (req == NULL) { 257 return NULL; 258 } 259 subreq = SMB_VFS_NEXT_PREAD_SEND(state, ev, handle, fsp, data, 260 n, offset); 261 if (tevent_req_nomem(subreq, req)) { 262 return tevent_req_post(req, ev); 263 } 264 tevent_req_set_callback(subreq, skel_pread_done, req); 265 return req; 266 } 267 268 static void skel_pread_done(struct tevent_req *subreq) 269 { 270 struct tevent_req *req = 271 tevent_req_callback_data(subreq, struct tevent_req); 272 struct skel_pread_state *state = 273 tevent_req_data(req, struct skel_pread_state); 274 275 state->ret = SMB_VFS_PREAD_RECV(subreq, &state->err); 276 TALLOC_FREE(subreq); 277 tevent_req_done(req); 278 } 279 280 static ssize_t skel_pread_recv(struct tevent_req *req, int *err) 281 { 282 struct skel_pread_state *state = 283 tevent_req_data(req, struct skel_pread_state); 284 285 if (tevent_req_is_unix_error(req, err)) { 286 return -1; 287 } 288 *err = state->err; 289 return state->ret; 290 } 291 292 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, 293 const void *data, size_t n) 192 294 { 193 295 return SMB_VFS_NEXT_WRITE(handle, fsp, data, n); 194 296 } 195 297 196 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset) 298 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, 299 const void *data, size_t n, off_t offset) 197 300 { 198 301 return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset); 199 302 } 200 303 201 static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence) 304 struct skel_pwrite_state { 305 ssize_t ret; 306 int err; 307 }; 308 309 static void skel_pwrite_done(struct tevent_req *subreq); 310 311 static struct tevent_req *skel_pwrite_send(struct vfs_handle_struct *handle, 312 TALLOC_CTX *mem_ctx, 313 struct tevent_context *ev, 314 struct files_struct *fsp, 315 const void *data, 316 size_t n, off_t offset) 317 { 318 struct tevent_req *req, *subreq; 319 struct skel_pwrite_state *state; 320 321 req = tevent_req_create(mem_ctx, &state, struct skel_pwrite_state); 322 if (req == NULL) { 323 return NULL; 324 } 325 subreq = SMB_VFS_NEXT_PWRITE_SEND(state, ev, handle, fsp, data, 326 n, offset); 327 if (tevent_req_nomem(subreq, req)) { 328 return tevent_req_post(req, ev); 329 } 330 tevent_req_set_callback(subreq, skel_pwrite_done, req); 331 return req; 332 } 333 334 static void skel_pwrite_done(struct tevent_req *subreq) 335 { 336 struct tevent_req *req = 337 tevent_req_callback_data(subreq, struct tevent_req); 338 struct skel_pwrite_state *state = 339 tevent_req_data(req, struct skel_pwrite_state); 340 341 state->ret = SMB_VFS_PWRITE_RECV(subreq, &state->err); 342 TALLOC_FREE(subreq); 343 tevent_req_done(req); 344 } 345 346 static ssize_t skel_pwrite_recv(struct tevent_req *req, int *err) 347 { 348 struct skel_pwrite_state *state = 349 tevent_req_data(req, struct skel_pwrite_state); 350 351 if (tevent_req_is_unix_error(req, err)) { 352 return -1; 353 } 354 *err = state->err; 355 return state->ret; 356 } 357 358 static off_t skel_lseek(vfs_handle_struct *handle, files_struct *fsp, 359 off_t offset, int whence) 202 360 { 203 361 return SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence); 204 362 } 205 363 206 static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n) 364 static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, 365 files_struct *fromfsp, const DATA_BLOB *hdr, 366 off_t offset, size_t n) 207 367 { 208 368 return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n); 209 369 } 210 370 211 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n) 371 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, 372 files_struct *tofsp, off_t offset, size_t n) 212 373 { 213 374 return SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n); … … 226 387 } 227 388 389 struct skel_fsync_state { 390 int ret; 391 int err; 392 }; 393 394 static void skel_fsync_done(struct tevent_req *subreq); 395 396 static struct tevent_req *skel_fsync_send(struct vfs_handle_struct *handle, 397 TALLOC_CTX *mem_ctx, 398 struct tevent_context *ev, 399 struct files_struct *fsp) 400 { 401 struct tevent_req *req, *subreq; 402 struct skel_fsync_state *state; 403 404 req = tevent_req_create(mem_ctx, &state, struct skel_fsync_state); 405 if (req == NULL) { 406 return NULL; 407 } 408 subreq = SMB_VFS_NEXT_FSYNC_SEND(state, ev, handle, fsp); 409 if (tevent_req_nomem(subreq, req)) { 410 return tevent_req_post(req, ev); 411 } 412 tevent_req_set_callback(subreq, skel_fsync_done, req); 413 return req; 414 } 415 416 static void skel_fsync_done(struct tevent_req *subreq) 417 { 418 struct tevent_req *req = 419 tevent_req_callback_data(subreq, struct tevent_req); 420 struct skel_fsync_state *state = 421 tevent_req_data(req, struct skel_fsync_state); 422 423 state->ret = SMB_VFS_FSYNC_RECV(subreq, &state->err); 424 TALLOC_FREE(subreq); 425 tevent_req_done(req); 426 } 427 428 static int skel_fsync_recv(struct tevent_req *req, int *err) 429 { 430 struct skel_fsync_state *state = 431 tevent_req_data(req, struct skel_fsync_state); 432 433 if (tevent_req_is_unix_error(req, err)) { 434 return -1; 435 } 436 *err = state->err; 437 return state->ret; 438 } 439 228 440 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname) 229 441 { … … 231 443 } 232 444 233 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf) 445 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, 446 SMB_STRUCT_STAT *sbuf) 234 447 { 235 448 return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf); 236 449 } 237 450 238 static int skel_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname) 451 static int skel_lstat(vfs_handle_struct *handle, 452 struct smb_filename *smb_fname) 239 453 { 240 454 return SMB_VFS_NEXT_LSTAT(handle, smb_fname); 241 455 } 242 456 243 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf) 457 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle, 458 struct files_struct *fsp, 459 const SMB_STRUCT_STAT *sbuf) 244 460 { 245 461 return SMB_VFS_NEXT_GET_ALLOC_SIZE(handle, fsp, sbuf); … … 252 468 } 253 469 254 static int skel_chmod(vfs_handle_struct *handle, 470 static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode) 255 471 { 256 472 return SMB_VFS_NEXT_CHMOD(handle, path, mode); 257 473 } 258 474 259 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode) 475 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, 476 mode_t mode) 260 477 { 261 478 return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode); 262 479 } 263 480 264 static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid) 481 static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, 482 gid_t gid) 265 483 { 266 484 return SMB_VFS_NEXT_CHOWN(handle, path, uid, gid); 267 485 } 268 486 269 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid) 487 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, 488 uid_t uid, gid_t gid) 270 489 { 271 490 return SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid); 272 491 } 273 492 274 static int skel_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid) 493 static int skel_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, 494 gid_t gid) 275 495 { 276 496 return SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid); 277 497 } 278 498 279 static int skel_chdir(vfs_handle_struct *handle, 499 static int skel_chdir(vfs_handle_struct *handle, const char *path) 280 500 { 281 501 return SMB_VFS_NEXT_CHDIR(handle, path); 282 502 } 283 503 284 static char *skel_getwd(vfs_handle_struct *handle , char *buf)285 { 286 return SMB_VFS_NEXT_GETWD(handle , buf);504 static char *skel_getwd(vfs_handle_struct *handle) 505 { 506 return SMB_VFS_NEXT_GETWD(handle); 287 507 } 288 508 … … 294 514 } 295 515 296 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset) 516 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, 517 off_t offset) 297 518 { 298 519 return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset); … … 300 521 301 522 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp, 302 enum vfs_fallocate_mode mode, 303 SMB_OFF_T offset, 304 SMB_OFF_T len) 523 uint32_t mode, off_t offset, off_t len) 305 524 { 306 525 return SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len); 307 526 } 308 527 309 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) 528 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, 529 off_t offset, off_t count, int type) 310 530 { 311 531 return SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type); 312 532 } 313 533 314 static int skel_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode, uint32 access_mask) 534 static int skel_kernel_flock(struct vfs_handle_struct *handle, 535 struct files_struct *fsp, uint32_t share_mode, 536 uint32_t access_mask) 315 537 { 316 538 return SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask); 317 539 } 318 540 319 static int skel_linux_setlease(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype) 541 static int skel_linux_setlease(struct vfs_handle_struct *handle, 542 struct files_struct *fsp, int leasetype) 320 543 { 321 544 return SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype); 322 545 } 323 546 324 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid) 547 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, 548 off_t *poffset, off_t *pcount, int *ptype, 549 pid_t *ppid) 325 550 { 326 551 return SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid); 327 552 } 328 553 329 static int skel_symlink(vfs_handle_struct *handle, const char *oldpath, const char *newpath) 554 static int skel_symlink(vfs_handle_struct *handle, const char *oldpath, 555 const char *newpath) 330 556 { 331 557 return SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath); 332 558 } 333 559 334 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz) 560 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path, 561 char *buf, size_t bufsiz) 335 562 { 336 563 return SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz); 337 564 } 338 565 339 static int skel_link(vfs_handle_struct *handle, const char *oldpath, const char *newpath) 566 static int skel_link(vfs_handle_struct *handle, const char *oldpath, 567 const char *newpath) 340 568 { 341 569 return SMB_VFS_NEXT_LINK(handle, oldpath, newpath); 342 570 } 343 571 344 static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev) 572 static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode, 573 SMB_DEV_T dev) 345 574 { 346 575 return SMB_VFS_NEXT_MKNOD(handle, path, mode, dev); 347 576 } 348 577 349 static char *skel_realpath(vfs_handle_struct *handle, 578 static char *skel_realpath(vfs_handle_struct *handle, const char *path) 350 579 { 351 580 return SMB_VFS_NEXT_REALPATH(handle, path); 352 581 } 353 582 354 static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle, 355 struct sys_notify_context *ctx, struct notify_entry *e, 356 void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev), 357 void *private_data, void *handle_p) 358 { 359 return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, callback, 360 private_data, handle_p); 361 } 362 363 static int skel_chflags(vfs_handle_struct *handle, const char *path, uint flags) 583 static int skel_chflags(vfs_handle_struct *handle, const char *path, 584 uint flags) 364 585 { 365 586 return SMB_VFS_NEXT_CHFLAGS(handle, path, flags); … … 370 591 { 371 592 return SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf); 593 } 594 595 struct skel_cc_state { 596 struct vfs_handle_struct *handle; 597 off_t copied; 598 }; 599 static void skel_copy_chunk_done(struct tevent_req *subreq); 600 601 static struct tevent_req *skel_copy_chunk_send(struct vfs_handle_struct *handle, 602 TALLOC_CTX *mem_ctx, 603 struct tevent_context *ev, 604 struct files_struct *src_fsp, 605 off_t src_off, 606 struct files_struct *dest_fsp, 607 off_t dest_off, 608 off_t num) 609 { 610 struct tevent_req *req; 611 struct tevent_req *subreq; 612 struct skel_cc_state *cc_state; 613 614 req = tevent_req_create(mem_ctx, &cc_state, struct skel_cc_state); 615 if (req == NULL) { 616 return NULL; 617 } 618 619 cc_state->handle = handle; 620 subreq = SMB_VFS_NEXT_COPY_CHUNK_SEND(handle, cc_state, ev, 621 src_fsp, src_off, 622 dest_fsp, dest_off, num); 623 if (tevent_req_nomem(subreq, req)) { 624 return tevent_req_post(req, ev); 625 } 626 627 tevent_req_set_callback(subreq, skel_copy_chunk_done, req); 628 return req; 629 } 630 631 static void skel_copy_chunk_done(struct tevent_req *subreq) 632 { 633 struct tevent_req *req = tevent_req_callback_data( 634 subreq, struct tevent_req); 635 struct skel_cc_state *cc_state 636 = tevent_req_data(req, struct skel_cc_state); 637 NTSTATUS status; 638 639 status = SMB_VFS_NEXT_COPY_CHUNK_RECV(cc_state->handle, 640 subreq, 641 &cc_state->copied); 642 TALLOC_FREE(subreq); 643 if (tevent_req_nterror(req, status)) { 644 return; 645 } 646 tevent_req_done(req); 647 } 648 649 static NTSTATUS skel_copy_chunk_recv(struct vfs_handle_struct *handle, 650 struct tevent_req *req, 651 off_t *copied) 652 { 653 struct skel_cc_state *cc_state 654 = tevent_req_data(req, struct skel_cc_state); 655 NTSTATUS status; 656 657 *copied = cc_state->copied; 658 if (tevent_req_is_nterror(req, &status)) { 659 tevent_req_received(req); 660 return status; 661 } 662 663 tevent_req_received(req); 664 return NT_STATUS_OK; 665 } 666 667 static NTSTATUS skel_get_compression(struct vfs_handle_struct *handle, 668 TALLOC_CTX *mem_ctx, 669 struct files_struct *fsp, 670 struct smb_filename *smb_fname, 671 uint16_t *_compression_fmt) 672 { 673 return SMB_VFS_NEXT_GET_COMPRESSION(handle, mem_ctx, fsp, smb_fname, 674 _compression_fmt); 675 } 676 677 static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle, 678 TALLOC_CTX *mem_ctx, 679 struct files_struct *fsp, 680 uint16_t compression_fmt) 681 { 682 return SMB_VFS_NEXT_SET_COMPRESSION(handle, mem_ctx, fsp, 683 compression_fmt); 372 684 } 373 685 … … 380 692 { 381 693 return SMB_VFS_NEXT_STREAMINFO(handle, 382 fsp, 383 fname, 384 mem_ctx, 385 num_streams, 386 streams); 694 fsp, 695 fname, mem_ctx, num_streams, streams); 387 696 } 388 697 389 698 static int skel_get_real_filename(struct vfs_handle_struct *handle, 390 const char *path, 391 const char *name, 392 TALLOC_CTX *mem_ctx, 393 char **found_name) 699 const char *path, 700 const char *name, 701 TALLOC_CTX *mem_ctx, char **found_name) 394 702 { 395 703 return SMB_VFS_NEXT_GET_REAL_FILENAME(handle, 396 path, 397 name, 398 mem_ctx, 399 found_name); 704 path, name, mem_ctx, found_name); 400 705 } 401 706 402 707 static const char *skel_connectpath(struct vfs_handle_struct *handle, 403 const char *filename)708 const char *filename) 404 709 { 405 710 return SMB_VFS_NEXT_CONNECTPATH(handle, filename); … … 407 712 408 713 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle, 409 struct byte_range_lock *br_lck, 410 struct lock_struct *plock, 411 bool blocking_lock, 412 struct blocking_lock_record *blr) 714 struct byte_range_lock *br_lck, 715 struct lock_struct *plock, 716 bool blocking_lock) 413 717 { 414 718 return SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, 415 br_lck, 416 plock, 417 blocking_lock, 418 blr); 719 br_lck, plock, blocking_lock); 419 720 } 420 721 421 722 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle, 422 struct messaging_context *msg_ctx, 423 struct byte_range_lock *br_lck, 424 const struct lock_struct *plock) 425 { 426 return SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle, 427 msg_ctx, 428 br_lck, 429 plock); 723 struct messaging_context *msg_ctx, 724 struct byte_range_lock *br_lck, 725 const struct lock_struct *plock) 726 { 727 return SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle, msg_ctx, br_lck, plock); 430 728 } 431 729 432 730 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle, 433 struct byte_range_lock *br_lck, 434 struct lock_struct *plock, 435 struct blocking_lock_record *blr) 436 { 437 return SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, 438 br_lck, 439 plock, 440 blr); 731 struct byte_range_lock *br_lck, 732 struct lock_struct *plock) 733 { 734 return SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, br_lck, plock); 441 735 } 442 736 443 737 static bool skel_strict_lock(struct vfs_handle_struct *handle, 444 struct files_struct *fsp, 445 struct lock_struct *plock) 446 { 447 return SMB_VFS_NEXT_STRICT_LOCK(handle, 448 fsp, 449 plock); 738 struct files_struct *fsp, 739 struct lock_struct *plock) 740 { 741 return SMB_VFS_NEXT_STRICT_LOCK(handle, fsp, plock); 450 742 } 451 743 452 744 static void skel_strict_unlock(struct vfs_handle_struct *handle, 453 struct files_struct *fsp, 454 struct lock_struct *plock) 455 { 456 SMB_VFS_NEXT_STRICT_UNLOCK(handle, 457 fsp, 458 plock); 745 struct files_struct *fsp, 746 struct lock_struct *plock) 747 { 748 SMB_VFS_NEXT_STRICT_UNLOCK(handle, fsp, plock); 459 749 } 460 750 461 751 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle, 462 const char *mapped_name, 463 enum vfs_translate_direction direction, 464 TALLOC_CTX *mem_ctx, 465 char **pmapped_name) 752 const char *mapped_name, 753 enum vfs_translate_direction direction, 754 TALLOC_CTX *mem_ctx, char **pmapped_name) 466 755 { 467 756 return SMB_VFS_NEXT_TRANSLATE_NAME(handle, mapped_name, direction, … … 469 758 } 470 759 760 static NTSTATUS skel_fsctl(struct vfs_handle_struct *handle, 761 struct files_struct *fsp, 762 TALLOC_CTX *ctx, 763 uint32_t function, 764 uint16_t req_flags, /* Needed for UNICODE ... */ 765 const uint8_t *_in_data, 766 uint32_t in_len, 767 uint8_t ** _out_data, 768 uint32_t max_out_len, uint32_t *out_len) 769 { 770 return SMB_VFS_NEXT_FSCTL(handle, 771 fsp, 772 ctx, 773 function, 774 req_flags, 775 _in_data, 776 in_len, _out_data, max_out_len, out_len); 777 } 778 779 static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle, 780 const struct smb_filename *fname, 781 TALLOC_CTX *mem_ctx, 782 struct readdir_attr_data **pattr_data) 783 { 784 return SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data); 785 } 786 471 787 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, 472 uint32 security_info, struct security_descriptor **ppdesc) 473 { 474 return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc); 788 uint32_t security_info, 789 TALLOC_CTX *mem_ctx, 790 struct security_descriptor **ppdesc) 791 { 792 return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, mem_ctx, 793 ppdesc); 475 794 } 476 795 477 796 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle, 478 const char *name, uint32 security_info, struct security_descriptor **ppdesc) 479 { 480 return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc); 797 const char *name, uint32_t security_info, 798 TALLOC_CTX *mem_ctx, 799 struct security_descriptor **ppdesc) 800 { 801 return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, mem_ctx, 802 ppdesc); 481 803 } 482 804 483 805 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, 484 uint32 security_info_sent, const struct security_descriptor *psd) 806 uint32_t security_info_sent, 807 const struct security_descriptor *psd) 485 808 { 486 809 return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd); 487 810 } 488 811 489 static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode) 812 static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, 813 mode_t mode) 490 814 { 491 815 return SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode); 492 816 } 493 817 494 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode) 818 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, 819 mode_t mode) 495 820 { 496 821 return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode); 497 822 } 498 823 499 static int skel_sys_acl_get_entry(vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p) 500 { 501 return SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, theacl, entry_id, entry_p); 502 } 503 504 static int skel_sys_acl_get_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p) 505 { 506 return SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, entry_d, tag_type_p); 507 } 508 509 static int skel_sys_acl_get_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p) 510 { 511 return SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, entry_d, permset_p); 512 } 513 514 static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d) 515 { 516 return SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, entry_d); 517 } 518 519 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type) 520 { 521 return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type); 522 } 523 524 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp) 525 { 526 return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp); 527 } 528 529 static int skel_sys_acl_clear_perms(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset) 530 { 531 return SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, permset); 532 } 533 534 static int skel_sys_acl_add_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) 535 { 536 return SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, permset, perm); 537 } 538 539 static char *skel_sys_acl_to_text(vfs_handle_struct *handle, SMB_ACL_T theacl, ssize_t *plen) 540 { 541 return SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, theacl, plen); 542 } 543 544 static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle, int count) 545 { 546 return SMB_VFS_NEXT_SYS_ACL_INIT(handle, count); 547 } 548 549 static int skel_sys_acl_create_entry(vfs_handle_struct *handle, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry) 550 { 551 return SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, pacl, pentry); 552 } 553 554 static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype) 555 { 556 return SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, entry, tagtype); 557 } 558 559 static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, void *qual) 560 { 561 return SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, entry, qual); 562 } 563 564 static int skel_sys_acl_set_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset) 565 { 566 return SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset); 567 } 568 569 static int skel_sys_acl_valid(vfs_handle_struct *handle, SMB_ACL_T theacl ) 570 { 571 return SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl); 572 } 573 574 static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl) 824 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, 825 const char *path_p, 826 SMB_ACL_TYPE_T type, 827 TALLOC_CTX *mem_ctx) 828 { 829 return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type, mem_ctx); 830 } 831 832 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, 833 files_struct *fsp, TALLOC_CTX *mem_ctx) 834 { 835 return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, mem_ctx); 836 } 837 838 static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle, 839 const char *path_p, TALLOC_CTX *mem_ctx, 840 char **blob_description, DATA_BLOB *blob) 841 { 842 return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, mem_ctx, 843 blob_description, blob); 844 } 845 846 static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle, 847 files_struct *fsp, TALLOC_CTX *mem_ctx, 848 char **blob_description, DATA_BLOB *blob) 849 { 850 return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, 851 blob_description, blob); 852 } 853 854 static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name, 855 SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl) 575 856 { 576 857 return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl); 577 858 } 578 859 579 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl) 860 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, 861 SMB_ACL_T theacl) 580 862 { 581 863 return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl); 582 864 } 583 865 584 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *path) 866 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, 867 const char *path) 585 868 { 586 869 return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path); 587 870 } 588 871 589 static int skel_sys_acl_get_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) 590 { 591 return SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm); 592 } 593 594 static int skel_sys_acl_free_text(vfs_handle_struct *handle, char *text) 595 { 596 return SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text); 597 } 598 599 static int skel_sys_acl_free_acl(vfs_handle_struct *handle, SMB_ACL_T posix_acl) 600 { 601 return SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, posix_acl); 602 } 603 604 static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle, void *qualifier, SMB_ACL_TAG_T tagtype) 605 { 606 return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, qualifier, tagtype); 607 } 608 609 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size) 610 { 611 return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size); 612 } 613 614 static ssize_t skel_lgetxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t 615 size) 616 { 617 return SMB_VFS_NEXT_LGETXATTR(handle, path, name, value, size); 618 } 619 620 static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size) 621 { 622 return SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size); 623 } 624 625 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size) 626 { 627 return SMB_VFS_NEXT_LISTXATTR(handle, path, list, size); 628 } 629 630 static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size) 631 { 632 return SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size); 633 } 634 635 static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size) 636 { 637 return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size); 638 } 639 640 static int skel_removexattr(vfs_handle_struct *handle, const char *path, const char *name) 641 { 642 return SMB_VFS_NEXT_REMOVEXATTR(handle, path, name); 643 } 644 645 static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const char *name) 646 { 647 return SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name); 648 } 649 650 static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name) 651 { 652 return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name); 653 } 654 655 static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags) 656 { 657 return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size, flags); 658 } 659 660 static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags) 661 { 662 return SMB_VFS_NEXT_LSETXATTR(handle, path, name, value, size, flags); 663 } 664 665 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags) 666 { 667 return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags); 668 } 669 670 static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) 671 { 672 return SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb); 673 } 674 675 static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) 676 { 677 return SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb); 678 } 679 680 static ssize_t skel_aio_return_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) 681 { 682 return SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb); 683 } 684 685 static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) 686 { 687 return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb); 688 } 689 690 static int skel_aio_error_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) 691 { 692 return SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb); 693 } 694 695 static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb) 696 { 697 return SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb); 698 } 699 700 static int skel_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts) 701 { 702 return SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts); 703 } 704 705 static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp) 706 { 707 return SMB_VFS_NEXT_AIO_FORCE(handle, fsp); 708 } 709 710 static bool skel_is_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname, SMB_STRUCT_STAT *sbuf) 872 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, 873 const char *name, void *value, size_t size) 874 { 875 return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size); 876 } 877 878 static ssize_t skel_fgetxattr(vfs_handle_struct *handle, 879 struct files_struct *fsp, const char *name, 880 void *value, size_t size) 881 { 882 return SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size); 883 } 884 885 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, 886 char *list, size_t size) 887 { 888 return SMB_VFS_NEXT_LISTXATTR(handle, path, list, size); 889 } 890 891 static ssize_t skel_flistxattr(vfs_handle_struct *handle, 892 struct files_struct *fsp, char *list, 893 size_t size) 894 { 895 return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size); 896 } 897 898 static int skel_removexattr(vfs_handle_struct *handle, const char *path, 899 const char *name) 900 { 901 return SMB_VFS_NEXT_REMOVEXATTR(handle, path, name); 902 } 903 904 static int skel_fremovexattr(vfs_handle_struct *handle, 905 struct files_struct *fsp, const char *name) 906 { 907 return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name); 908 } 909 910 static int skel_setxattr(vfs_handle_struct *handle, const char *path, 911 const char *name, const void *value, size_t size, 912 int flags) 913 { 914 return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size, flags); 915 } 916 917 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, 918 const char *name, const void *value, size_t size, 919 int flags) 920 { 921 return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags); 922 } 923 924 static bool skel_aio_force(struct vfs_handle_struct *handle, 925 struct files_struct *fsp) 926 { 927 return SMB_VFS_NEXT_AIO_FORCE(handle, fsp); 928 } 929 930 static bool skel_is_offline(struct vfs_handle_struct *handle, 931 const struct smb_filename *fname, 932 SMB_STRUCT_STAT *sbuf) 711 933 { 712 934 return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf); 713 935 } 714 936 715 static int skel_set_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname) 937 static int skel_set_offline(struct vfs_handle_struct *handle, 938 const struct smb_filename *fname) 716 939 { 717 940 return SMB_VFS_NEXT_SET_OFFLINE(handle, fname); … … 724 947 725 948 .connect_fn = skel_connect, 726 .disconnect = skel_disconnect, 727 .disk_free = skel_disk_free, 728 .get_quota = skel_get_quota, 729 .set_quota = skel_set_quota, 730 .get_shadow_copy_data = skel_get_shadow_copy_data, 731 .statvfs = skel_statvfs, 732 .fs_capabilities = skel_fs_capabilities, 949 .disconnect_fn = skel_disconnect, 950 .disk_free_fn = skel_disk_free, 951 .get_quota_fn = skel_get_quota, 952 .set_quota_fn = skel_set_quota, 953 .get_shadow_copy_data_fn = skel_get_shadow_copy_data, 954 .statvfs_fn = skel_statvfs, 955 .fs_capabilities_fn = skel_fs_capabilities, 956 .get_dfs_referrals_fn = skel_get_dfs_referrals, 957 .snap_check_path_fn = skel_snap_check_path, 958 .snap_create_fn = skel_snap_create, 959 .snap_delete_fn = skel_snap_delete, 733 960 734 961 /* Directory operations */ 735 962 736 .opendir = skel_opendir,737 .fdopendir = skel_fdopendir,738 .readdir = skel_readdir,739 .seekdir = skel_seekdir,740 .telldir = skel_telldir,741 .rewind_dir = skel_rewind_dir,742 .mkdir = skel_mkdir,743 .rmdir = skel_rmdir,744 .closedir = skel_closedir,745 .init_search_op = skel_init_search_op,963 .opendir_fn = skel_opendir, 964 .fdopendir_fn = skel_fdopendir, 965 .readdir_fn = skel_readdir, 966 .seekdir_fn = skel_seekdir, 967 .telldir_fn = skel_telldir, 968 .rewind_dir_fn = skel_rewind_dir, 969 .mkdir_fn = skel_mkdir, 970 .rmdir_fn = skel_rmdir, 971 .closedir_fn = skel_closedir, 972 .init_search_op_fn = skel_init_search_op, 746 973 747 974 /* File operations */ 748 975 749 976 .open_fn = skel_open, 750 .create_file = skel_create_file,977 .create_file_fn = skel_create_file, 751 978 .close_fn = skel_close_fn, 752 .vfs_read = skel_vfs_read, 753 .pread = skel_pread, 754 .write = skel_write, 755 .pwrite = skel_pwrite, 756 .lseek = skel_lseek, 757 .sendfile = skel_sendfile, 758 .recvfile = skel_recvfile, 759 .rename = skel_rename, 760 .fsync = skel_fsync, 761 .stat = skel_stat, 762 .fstat = skel_fstat, 763 .lstat = skel_lstat, 764 .get_alloc_size = skel_get_alloc_size, 765 .unlink = skel_unlink, 766 .chmod = skel_chmod, 767 .fchmod = skel_fchmod, 768 .chown = skel_chown, 769 .fchown = skel_fchown, 770 .lchown = skel_lchown, 771 .chdir = skel_chdir, 772 .getwd = skel_getwd, 773 .ntimes = skel_ntimes, 774 .ftruncate = skel_ftruncate, 775 .fallocate = skel_fallocate, 776 .lock = skel_lock, 777 .kernel_flock = skel_kernel_flock, 778 .linux_setlease = skel_linux_setlease, 779 .getlock = skel_getlock, 780 .symlink = skel_symlink, 781 .vfs_readlink = skel_vfs_readlink, 782 .link = skel_link, 783 .mknod = skel_mknod, 784 .realpath = skel_realpath, 785 .notify_watch = skel_notify_watch, 786 .chflags = skel_chflags, 787 .file_id_create = skel_file_id_create, 788 789 .streaminfo = skel_streaminfo, 790 .get_real_filename = skel_get_real_filename, 791 .connectpath = skel_connectpath, 792 .brl_lock_windows = skel_brl_lock_windows, 793 .brl_unlock_windows = skel_brl_unlock_windows, 794 .brl_cancel_windows = skel_brl_cancel_windows, 795 .strict_lock = skel_strict_lock, 796 .strict_unlock = skel_strict_unlock, 797 .translate_name = skel_translate_name, 979 .read_fn = skel_vfs_read, 980 .pread_fn = skel_pread, 981 .pread_send_fn = skel_pread_send, 982 .pread_recv_fn = skel_pread_recv, 983 .write_fn = skel_write, 984 .pwrite_fn = skel_pwrite, 985 .pwrite_send_fn = skel_pwrite_send, 986 .pwrite_recv_fn = skel_pwrite_recv, 987 .lseek_fn = skel_lseek, 988 .sendfile_fn = skel_sendfile, 989 .recvfile_fn = skel_recvfile, 990 .rename_fn = skel_rename, 991 .fsync_fn = skel_fsync, 992 .fsync_send_fn = skel_fsync_send, 993 .fsync_recv_fn = skel_fsync_recv, 994 .stat_fn = skel_stat, 995 .fstat_fn = skel_fstat, 996 .lstat_fn = skel_lstat, 997 .get_alloc_size_fn = skel_get_alloc_size, 998 .unlink_fn = skel_unlink, 999 .chmod_fn = skel_chmod, 1000 .fchmod_fn = skel_fchmod, 1001 .chown_fn = skel_chown, 1002 .fchown_fn = skel_fchown, 1003 .lchown_fn = skel_lchown, 1004 .chdir_fn = skel_chdir, 1005 .getwd_fn = skel_getwd, 1006 .ntimes_fn = skel_ntimes, 1007 .ftruncate_fn = skel_ftruncate, 1008 .fallocate_fn = skel_fallocate, 1009 .lock_fn = skel_lock, 1010 .kernel_flock_fn = skel_kernel_flock, 1011 .linux_setlease_fn = skel_linux_setlease, 1012 .getlock_fn = skel_getlock, 1013 .symlink_fn = skel_symlink, 1014 .readlink_fn = skel_vfs_readlink, 1015 .link_fn = skel_link, 1016 .mknod_fn = skel_mknod, 1017 .realpath_fn = skel_realpath, 1018 .chflags_fn = skel_chflags, 1019 .file_id_create_fn = skel_file_id_create, 1020 .copy_chunk_send_fn = skel_copy_chunk_send, 1021 .copy_chunk_recv_fn = skel_copy_chunk_recv, 1022 .get_compression_fn = skel_get_compression, 1023 .set_compression_fn = skel_set_compression, 1024 1025 .streaminfo_fn = skel_streaminfo, 1026 .get_real_filename_fn = skel_get_real_filename, 1027 .connectpath_fn = skel_connectpath, 1028 .brl_lock_windows_fn = skel_brl_lock_windows, 1029 .brl_unlock_windows_fn = skel_brl_unlock_windows, 1030 .brl_cancel_windows_fn = skel_brl_cancel_windows, 1031 .strict_lock_fn = skel_strict_lock, 1032 .strict_unlock_fn = skel_strict_unlock, 1033 .translate_name_fn = skel_translate_name, 1034 .fsctl_fn = skel_fsctl, 1035 .readdir_attr_fn = skel_readdir_attr, 798 1036 799 1037 /* NT ACL operations. */ 800 1038 801 .fget_nt_acl = skel_fget_nt_acl,802 .get_nt_acl = skel_get_nt_acl,803 .fset_nt_acl = skel_fset_nt_acl,1039 .fget_nt_acl_fn = skel_fget_nt_acl, 1040 .get_nt_acl_fn = skel_get_nt_acl, 1041 .fset_nt_acl_fn = skel_fset_nt_acl, 804 1042 805 1043 /* POSIX ACL operations. */ 806 1044 807 .chmod_acl = skel_chmod_acl, 808 .fchmod_acl = skel_fchmod_acl, 809 810 .sys_acl_get_entry = skel_sys_acl_get_entry, 811 .sys_acl_get_tag_type = skel_sys_acl_get_tag_type, 812 .sys_acl_get_permset = skel_sys_acl_get_permset, 813 .sys_acl_get_qualifier = skel_sys_acl_get_qualifier, 814 .sys_acl_get_file = skel_sys_acl_get_file, 815 .sys_acl_get_fd = skel_sys_acl_get_fd, 816 .sys_acl_clear_perms = skel_sys_acl_clear_perms, 817 .sys_acl_add_perm = skel_sys_acl_add_perm, 818 .sys_acl_to_text = skel_sys_acl_to_text, 819 .sys_acl_init = skel_sys_acl_init, 820 .sys_acl_create_entry = skel_sys_acl_create_entry, 821 .sys_acl_set_tag_type = skel_sys_acl_set_tag_type, 822 .sys_acl_set_qualifier = skel_sys_acl_set_qualifier, 823 .sys_acl_set_permset = skel_sys_acl_set_permset, 824 .sys_acl_valid = skel_sys_acl_valid, 825 .sys_acl_set_file = skel_sys_acl_set_file, 826 .sys_acl_set_fd = skel_sys_acl_set_fd, 827 .sys_acl_delete_def_file = skel_sys_acl_delete_def_file, 828 .sys_acl_get_perm = skel_sys_acl_get_perm, 829 .sys_acl_free_text = skel_sys_acl_free_text, 830 .sys_acl_free_acl = skel_sys_acl_free_acl, 831 .sys_acl_free_qualifier = skel_sys_acl_free_qualifier, 1045 .chmod_acl_fn = skel_chmod_acl, 1046 .fchmod_acl_fn = skel_fchmod_acl, 1047 1048 .sys_acl_get_file_fn = skel_sys_acl_get_file, 1049 .sys_acl_get_fd_fn = skel_sys_acl_get_fd, 1050 .sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file, 1051 .sys_acl_blob_get_fd_fn = skel_sys_acl_blob_get_fd, 1052 .sys_acl_set_file_fn = skel_sys_acl_set_file, 1053 .sys_acl_set_fd_fn = skel_sys_acl_set_fd, 1054 .sys_acl_delete_def_file_fn = skel_sys_acl_delete_def_file, 832 1055 833 1056 /* EA operations. */ 834 .getxattr = skel_getxattr, 835 .lgetxattr = skel_lgetxattr, 836 .fgetxattr = skel_fgetxattr, 837 .listxattr = skel_listxattr, 838 .llistxattr = skel_llistxattr, 839 .flistxattr = skel_flistxattr, 840 .removexattr = skel_removexattr, 841 .lremovexattr = skel_lremovexattr, 842 .fremovexattr = skel_fremovexattr, 843 .setxattr = skel_setxattr, 844 .lsetxattr = skel_lsetxattr, 845 .fsetxattr = skel_fsetxattr, 1057 .getxattr_fn = skel_getxattr, 1058 .fgetxattr_fn = skel_fgetxattr, 1059 .listxattr_fn = skel_listxattr, 1060 .flistxattr_fn = skel_flistxattr, 1061 .removexattr_fn = skel_removexattr, 1062 .fremovexattr_fn = skel_fremovexattr, 1063 .setxattr_fn = skel_setxattr, 1064 .fsetxattr_fn = skel_fsetxattr, 846 1065 847 1066 /* aio operations */ 848 .aio_read = skel_aio_read, 849 .aio_write = skel_aio_write, 850 .aio_return_fn = skel_aio_return_fn, 851 .aio_cancel = skel_aio_cancel, 852 .aio_error_fn = skel_aio_error_fn, 853 .aio_fsync = skel_aio_fsync, 854 .aio_suspend = skel_aio_suspend, 855 .aio_force = skel_aio_force, 1067 .aio_force_fn = skel_aio_force, 856 1068 857 1069 /* offline operations */ 858 .is_offline = skel_is_offline,859 .set_offline = skel_set_offline1070 .is_offline_fn = skel_is_offline, 1071 .set_offline_fn = skel_set_offline 860 1072 }; 861 1073 1074 static_decl_vfs; 862 1075 NTSTATUS vfs_skel_transparent_init(void) 863 1076 { 864 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_transparent", &skel_transparent_fns); 865 } 1077 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_transparent", 1078 &skel_transparent_fns); 1079 } -
vendor/current/examples/auth/auth_skel.c
r414 r988 20 20 21 21 #include "includes.h" 22 #include "auth.h" 22 23 23 24 #undef DBGC_CLASS … … 27 28 void *my_private_data, 28 29 TALLOC_CTX *mem_ctx, 29 const auth_usersupplied_info *user_info,30 auth_serversupplied_info **server_info)30 const struct auth_usersupplied_info *user_info, 31 struct auth_serversupplied_info **server_info) 31 32 { 32 33 if (!user_info || !auth_context) { … … 42 43 43 44 /* module initialisation */ 44 NTSTATUS auth_init_skel(struct auth_context *auth_context, const char *param, auth_methods **auth_method) 45 static NTSTATUS auth_init_skel(struct auth_context *auth_context, const char *param, auth_methods **auth_method) 45 46 { 46 if (!make_auth_methods(auth_context, auth_method)) { 47 struct auth_methods *result; 48 49 result = talloc_zero(auth_context, struct auth_methods); 50 if (result == NULL) { 47 51 return NT_STATUS_NO_MEMORY; 48 52 } 53 result->name = "skel"; 54 result->auth = check_skel_security; 49 55 50 (*auth_method)->auth = check_skel_security; 51 (*auth_method)->name = "skel"; 56 if (param && *param) { 57 /* we load the 'fallback' module - if skel isn't here, call this 58 module */ 59 auth_methods *priv; 60 if (!load_auth_module(auth_context, param, &priv)) { 61 return NT_STATUS_UNSUCCESSFUL; 62 } 63 result->private_data = (void *)priv; 64 } 65 66 *auth_method = result; 52 67 return NT_STATUS_OK; 53 68 } 54 69 55 NTSTATUS init_module(void) 70 NTSTATUS auth_skel_init(void); 71 NTSTATUS auth_skel_init(void) 56 72 { 57 73 return smb_register_auth(AUTH_INTERFACE_VERSION, "skel", auth_init_skel); -
vendor/current/examples/dce-dfs/smb.conf
r414 r988 6 6 log file = /usr/local/samba/var/log.%m 7 7 log level = 8 8 password level = 89 8 10 9 [homes] -
vendor/current/examples/libsmbclient/Makefile
r414 r988 8 8 EXTLIB_INCL = `gtk-config --cflags` 9 9 10 DEFS = -D_ LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE10 DEFS = -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE 11 11 CFLAGS = -O0 -g $(SAMBA_INCL) $(EXTLIB_INCL) $(DEFS) 12 12 -
vendor/current/examples/libsmbclient/get_auth_data_fn.h
r414 r988 17 17 char username[256] = { '\0' }; 18 18 char password[256] = { '\0' }; 19 char *ret; 19 20 20 21 static int krb5_set = 1; … … 37 38 38 39 fprintf(stdout, "Workgroup: [%s] ", pWorkgroup); 39 fgets(temp, sizeof(temp), stdin); 40 ret = fgets(temp, sizeof(temp), stdin); 41 if (ret == NULL) { 42 return; 43 } 40 44 41 45 if (temp[strlen(temp) - 1] == '\n') /* A new line? */ … … 50 54 51 55 fprintf(stdout, "Username: [%s] ", pUsername); 52 fgets(temp, sizeof(temp), stdin); 56 ret = fgets(temp, sizeof(temp), stdin); 57 if (ret == NULL) { 58 return; 59 } 53 60 54 61 if (temp[strlen(temp) - 1] == '\n') /* A new line? */ … … 63 70 64 71 fprintf(stdout, "Password: "); 65 fgets(temp, sizeof(temp), stdin); 72 ret = fgets(temp, sizeof(temp), stdin); 73 if (ret == NULL) { 74 return; 75 } 66 76 67 77 if (temp[strlen(temp) - 1] == '\n') /* A new line? */ -
vendor/current/examples/libsmbclient/testacl.c
r414 r988 22 22 { 23 23 int opt; 24 int flags ;24 int flags = 0; 25 25 int debug = 0; 26 26 int numeric = 0; … … 28 28 int full_time_names = 0; 29 29 enum acl_mode mode = SMB_ACL_LIST; 30 static c har *the_acl = NULL;30 static const char *the_acl = NULL; 31 31 int ret; 32 32 char *p; 33 c har *debugstr;33 const char *debugstr; 34 34 char path[1024]; 35 35 char value[1024]; -
vendor/current/examples/libsmbclient/testacl2.c
r414 r988 20 20 int main(int argc, const char *argv[]) 21 21 { 22 int i;23 int opt;24 22 int flags; 25 23 int debug = 0; 26 int numeric = 0;27 int full_time_names = 0;28 enum acl_mode mode = SMB_ACL_GET;29 24 static char *the_acl = NULL; 30 25 int ret; 31 char *p; 32 char *debugstr; 26 const char *debugstr; 33 27 char value[1024]; 28 SMBCCTX *context; 34 29 35 30 if (smbc_init(get_auth_data_fn, debug) != 0) … … 39 34 } 40 35 41 SMBCCTX *context = smbc_set_context(NULL);36 context = smbc_set_context(NULL); 42 37 smbc_setOptionFullTimeNames(context, 1); 43 38 -
vendor/current/examples/libsmbclient/testacl3.c
r414 r988 11 11 int main(int argc, char * argv[]) 12 12 { 13 int i;14 int fd;15 13 int ret; 16 14 int debug = 0; 17 int mode = 0666;18 int savedErrno;19 15 char value[2048]; 20 16 char path[2048]; 21 17 char * the_acl; 22 18 char * p; 23 time_t t0;24 time_t t1;25 struct stat st;26 19 SMBCCTX * context; 27 20 -
vendor/current/examples/libsmbclient/testbrowse.c
r414 r988 10 10 #include "get_auth_data_fn.h" 11 11 12 static void13 no_auth_data_fn(const char * pServer,14 const char * pShare,15 char * pWorkgroup,16 int maxLenWorkgroup,17 char * pUsername,18 int maxLenUsername,19 char * pPassword,20 int maxLenPassword);21 22 12 static void browse(char * path, 23 13 int scan, … … 36 26 int maxLenPassword); 37 27 38 int 39 main(int argc, char * argv[]) 28 int main(int argc, const char *argv[]) 40 29 { 41 30 int debug = 0; … … 45 34 int scan = 0; 46 35 int iterations = -1; 47 int again;48 36 int opt; 49 37 char * p; 50 char * q;51 38 char buf[1024]; 52 39 poptContext pc; … … 86 73 setbuf(stdout, NULL); 87 74 88 pc = poptGetContext("opendir", argc, (const char **)argv, long_options, 0);75 pc = poptGetContext("opendir", argc, argv, long_options, 0); 89 76 90 77 poptSetOtherOptionHelp(pc, ""); … … 113 100 smbc_setFunctionAuthDataWithContext(context, 114 101 get_auth_data_with_context_fn); 115 smbc_setOptionUserData(context, "hello world");102 smbc_setOptionUserData(context, strdup("hello world")); 116 103 } else { 117 104 smbc_setFunctionAuthData(context, get_auth_data_fn); … … 139 126 if (scan) 140 127 { 141 for (; 142 iterations == -1 || iterations > 0; 143 iterations = (iterations == -1 ? iterations : --iterations)) 144 { 128 for (; iterations != 0;) { 129 if (iterations > 0) { 130 iterations--; 131 } 132 145 133 snprintf(buf, sizeof(buf), "smb://"); 146 134 browse(buf, scan, 0); … … 149 137 else 150 138 { 151 for (; 152 iterations == -1 || iterations > 0; 153 iterations = (iterations == -1 ? iterations : --iterations)) 154 { 139 for (; iterations != 0;) { 140 if (iterations > 0) { 141 iterations--; 142 } 143 155 144 fputs("url: ", stdout); 156 145 p = fgets(buf, sizeof(buf), stdin); … … 171 160 exit(0); 172 161 } 173 174 175 static void176 no_auth_data_fn(const char * pServer,177 const char * pShare,178 char * pWorkgroup,179 int maxLenWorkgroup,180 char * pUsername,181 int maxLenUsername,182 char * pPassword,183 int maxLenPassword)184 {185 return;186 }187 188 162 189 163 static void … … 214 188 char buf[1024]; 215 189 int dir; 216 struct stat st at;190 struct stat st; 217 191 struct smbc_dirent * dirent; 218 192 … … 269 243 strcat(p, "/"); 270 244 strcat(p+1, dirent->name); 271 if (smbc_stat(path, &st at) < 0)245 if (smbc_stat(path, &st) < 0) 272 246 { 273 247 printf(" unknown size (reason %d: %s)", … … 276 250 else 277 251 { 278 printf(" size %lu", (unsigned long) st at.st_size);252 printf(" size %lu", (unsigned long) st.st_size); 279 253 } 280 254 *p = '\0'; -
vendor/current/examples/libsmbclient/testbrowse2.c
r414 r988 6 6 #include <stdio.h> 7 7 #include <stdlib.h> 8 #include <malloc.h>9 8 #include <string.h> 10 9 #include <libsmbclient.h> 11 10 12 11 int debuglevel = 0; 13 c har *workgroup = "NT";14 c har *username = "guest";15 c har *password = "";12 const char *workgroup = "NT"; 13 const char *username = "guest"; 14 const char *password = ""; 16 15 17 16 typedef struct smbitem smbitem; … … 24 23 }; 25 24 26 int smbitem_cmp(smbitem *elem1, smbitem *elem2){ 27 return strcmp(elem1->name, elem2->name); 28 } 29 30 int smbitem_list_count(smbitem *list){ 31 int count = 0; 32 33 while(list != NULL){ 34 list = list->next; 35 count++; 36 } 37 return count; 38 } 39 40 void smbitem_list_delete(smbitem *list){ 41 smbitem *elem; 42 43 while(list != NULL){ 44 elem = list; 45 list = list->next; 46 free(elem); 47 } 48 } 49 50 smbitem* smbitem_list_sort(smbitem *list){ 51 smbitem *item, **array; 52 int count, i; 53 54 if ((count = smbitem_list_count(list)) == 0) return NULL; 55 if ((array = malloc(count * sizeof(smbitem*))) == NULL){ 56 smbitem_list_delete(list); 57 return NULL; 58 } 59 60 for(i = 0; i < count; i++){ 61 array[i] = list; 62 list = list->next; 63 } 64 qsort(array, count, sizeof(smbitem*), (qsort_cmp)smbitem_cmp); 65 66 for(i = 0; i < count - 1; i++) array[i]->next = array[i + 1]; 67 array[count - 1]->next = NULL; 68 69 list = array[0]; 70 free(array); 71 return list; 72 } 73 74 void smbc_auth_fn( 25 static void smbc_auth_fn( 75 26 const char *server, 76 27 const char *share, … … 89 40 } 90 41 91 SMBCCTX* create_smbctx(){42 static SMBCCTX* create_smbctx(void){ 92 43 SMBCCTX *ctx; 93 44 … … 105 56 } 106 57 107 void delete_smbctx(SMBCCTX* ctx){58 static void delete_smbctx(SMBCCTX* ctx){ 108 59 smbc_getFunctionPurgeCachedServers(ctx)(ctx); 109 60 smbc_free_context(ctx, 1); 110 61 } 111 62 112 s mbitem* get_smbitem_list(SMBCCTX *ctx, char *smb_path){63 static smbitem* get_smbitem_list(SMBCCTX *ctx, char *smb_path){ 113 64 SMBCFILE *fd; 114 65 struct smbc_dirent *dirent; … … 135 86 } 136 87 137 void print_smb_path(char *group,char *path){88 static void print_smb_path(const char *group, const char *path){ 138 89 if ((strlen(group) == 0) && (strlen(path) == 0)) printf("/\n"); 139 90 else if (strlen(path) == 0) printf("/%s\n", group); … … 144 95 } 145 96 146 void recurse(SMBCCTX *ctx,char *smb_group, char *smb_path, int maxlen){97 static void recurse(SMBCCTX *ctx, const char *smb_group, char *smb_path, int maxlen){ 147 98 int len; 148 99 smbitem *list, *item; -
vendor/current/examples/libsmbclient/testchmod.c
r414 r988 9 9 int main(int argc, char * argv[]) 10 10 { 11 int ret;12 11 int debug = 0; 13 12 int mode = 0666; 14 char buffer[16384]; 15 char * pSmbPath = NULL; 13 const char * pSmbPath = NULL; 16 14 struct stat st; 17 15 … … 45 43 } 46 44 47 printf("\nBefore chmod: mode = %04o\n", st.st_mode);45 printf("\nBefore chmod: mode = %04o\n", (unsigned int)st.st_mode); 48 46 49 47 if (smbc_chmod(pSmbPath, mode) < 0) … … 59 57 } 60 58 61 printf("After chmod: mode = %04o\n", st.st_mode);59 printf("After chmod: mode = %04o\n", (unsigned int)st.st_mode); 62 60 63 61 return 0; -
vendor/current/examples/libsmbclient/testctx.c
r740 r988 2 2 #include <stdlib.h> 3 3 #include <stdio.h> 4 #include <string.h> 4 5 5 void create_and_destroy_context (void)6 static void create_and_destroy_context (void) 6 7 { 7 8 int i; … … 10 11 /* Both should do the same thing */ 11 12 smbc_setOptionDebugToStderr(ctx, 1); 12 smbc_option_set(ctx, "debug_to_stderr", 1);13 smbc_option_set(ctx, strdup("debug_to_stderr"), 1); 13 14 smbc_setDebug(ctx, 1); 14 15 i = smbc_getDebug(ctx); -
vendor/current/examples/libsmbclient/testfstatvfs.c
r414 r988 12 12 int main(int argc, char * argv[]) 13 13 { 14 int i;15 14 int fd; 16 15 int ret; … … 88 87 printf("Available Files: %llu\n", 89 88 (unsigned long long) statvfsbuf.f_favail); 89 #ifdef HAVE_FSID_INT 90 90 printf("File System ID: %lu\n", 91 91 (unsigned long) statvfsbuf.f_fsid); 92 #endif 92 93 printf("\n"); 93 94 -
vendor/current/examples/libsmbclient/testread.c
r414 r988 11 11 int main(int argc, char * argv[]) 12 12 { 13 int i;14 13 int fd; 15 14 int ret; 16 15 int debug = 0; 17 int mode = 0666;18 16 int savedErrno; 19 17 char buffer[2048]; 20 18 char path[2048]; 21 19 char * p; 22 time_t t0;23 time_t t1;24 struct stat st;25 20 26 21 smbc_init(get_auth_data_fn, debug); -
vendor/current/examples/libsmbclient/testsmbc.c
r414 r988 30 30 #include "get_auth_data_fn.h" 31 31 32 int global_id = 0;33 34 void print_list_fn(struct print_job_info *pji)35 {36 37 fprintf(stdout, "Print job: ID: %u, Prio: %u, Size: %lu, User: %s, Name: %s\n",38 pji->id,39 pji->priority,40 (unsigned long) pji->size,41 pji->user,42 pji->name);43 44 global_id = pji->id;45 46 }47 48 32 int main(int argc, char *argv[]) 49 33 { 50 int err, fd, dh1, d h2, dh3, dsize, dirc;34 int err, fd, dh1, dsize, dirc; 51 35 const char *file = "smb://samba/public/testfile.txt"; 52 36 const char *file2 = "smb://samba/public/testfile2.txt"; … … 75 59 } 76 60 77 fprintf(stdout, "Directory handle s: %u, %u, %u\n", dh1, dh2, dh3);61 fprintf(stdout, "Directory handle: %u\n", dh1); 78 62 79 63 /* Now, list those directories, but in funny ways ... */ … … 131 115 /* Now, write some date to the file ... */ 132 116 133 bzero(buff, sizeof(buff));117 memset(buff, '\0', sizeof(buff)); 134 118 strcpy(buff, "Some test data for the moment ..."); 135 119 … … 257 241 258 242 fprintf(stdout, "Stat'ed file: %s. Size = %d, mode = %04X\n", file2, 259 (int)st2.st_size, st2.st_mode);243 (int)st2.st_size, (unsigned int)st2.st_mode); 260 244 fprintf(stdout, " time: %s\n", ctime(&st2.st_atime)); 261 245 fprintf(stdout, "Earlier stat: %s, Size = %d, mode = %04X\n", file, 262 (int)st1.st_size, st1.st_mode);246 (int)st1.st_size, (unsigned int)st1.st_mode); 263 247 fprintf(stdout, " time: %s\n", ctime(&st1.st_atime)); 264 248 -
vendor/current/examples/libsmbclient/teststat.c
r414 r988 10 10 { 11 11 int debug = 0; 12 char buffer[16384]; 13 char mtime[32]; 14 char ctime[32]; 15 char atime[32]; 16 char * pSmbPath = NULL; 17 char * pLocalPath = NULL; 12 char m_time[32]; 13 char c_time[32]; 14 char a_time[32]; 15 const char * pSmbPath = NULL; 16 const char * pLocalPath = NULL; 18 17 struct stat st; 19 18 … … 49 48 } 50 49 51 printf("\nSAMBA\n mtime:%l u/%s ctime:%lu/%s atime:%lu/%s\n",52 st.st_mtime, ctime_r(&st.st_mtime, mtime),53 st.st_ctime, ctime_r(&st.st_ctime, ctime),54 st.st_atime, ctime_r(&st.st_atime, atime));50 printf("\nSAMBA\n mtime:%lld/%s ctime:%lld/%s atime:%lld/%s\n", 51 (long long)st.st_mtime, ctime_r(&st.st_mtime, m_time), 52 (long long)st.st_ctime, ctime_r(&st.st_ctime, c_time), 53 (long long)st.st_atime, ctime_r(&st.st_atime, a_time)); 55 54 56 55 if (pLocalPath != NULL) … … 62 61 } 63 62 64 printf("LOCAL\n mtime:%l u/%s ctime:%lu/%s atime:%lu/%s\n",65 st.st_mtime, ctime_r(&st.st_mtime, mtime),66 st.st_ctime, ctime_r(&st.st_ctime, ctime),67 st.st_atime, ctime_r(&st.st_atime, atime));63 printf("LOCAL\n mtime:%lld/%s ctime:%lld/%s atime:%lld/%s\n", 64 (long long)st.st_mtime, ctime_r(&st.st_mtime, m_time), 65 (long long)st.st_ctime, ctime_r(&st.st_ctime, c_time), 66 (long long)st.st_atime, ctime_r(&st.st_atime, a_time)); 68 67 } 69 68 -
vendor/current/examples/libsmbclient/teststat2.c
r740 r988 35 35 const char * pLocalPath) 36 36 { 37 //char *pSmbPath = 0;38 37 struct stat st; 39 char m time[32];40 char c time[32];41 char a time[32];38 char m_time[32]; 39 char c_time[32]; 40 char a_time[32]; 42 41 43 42 smbc_init(get_auth_data_fn, 0); … … 49 48 } 50 49 51 printf("SAMBA\n mtime:%l u/%s ctime:%lu/%s atime:%lu/%s\n",52 st.st_mtime, ctime_r(&st.st_mtime, mtime),53 st.st_ctime, ctime_r(&st.st_ctime, ctime),54 st.st_atime, ctime_r(&st.st_atime, atime));50 printf("SAMBA\n mtime:%lld/%s ctime:%lld/%s atime:%lld/%s\n", 51 (long long)st.st_mtime, ctime_r(&st.st_mtime, m_time), 52 (long long)st.st_ctime, ctime_r(&st.st_ctime, c_time), 53 (long long)st.st_atime, ctime_r(&st.st_atime, a_time)); 55 54 56 55 57 / / check the stat on this file56 /* check the stat on this file */ 58 57 if (stat(pLocalPath, &st) < 0) 59 58 { … … 62 61 } 63 62 64 printf("LOCAL\n mtime:%l u/%s ctime:%lu/%s atime:%lu/%s\n",65 st.st_mtime, ctime_r(&st.st_mtime, mtime),66 st.st_ctime, ctime_r(&st.st_ctime, ctime),67 st.st_atime, ctime_r(&st.st_atime, atime));63 printf("LOCAL\n mtime:%lld/%s ctime:%lld/%s atime:%lld/%s\n", 64 (long long)st.st_mtime, ctime_r(&st.st_mtime, m_time), 65 (long long)st.st_ctime, ctime_r(&st.st_ctime, c_time), 66 (long long)st.st_atime, ctime_r(&st.st_atime, a_time)); 68 67 69 68 70 69 return 0; 71 70 } 72 -
vendor/current/examples/libsmbclient/teststat3.c
r414 r988 18 18 struct stat st1; 19 19 struct stat st2; 20 char mtime[32];21 char ctime[32];22 char atime[32];23 20 char * pUrl = argv[1]; 24 21 -
vendor/current/examples/libsmbclient/teststatvfs.c
r414 r988 12 12 int main(int argc, char * argv[]) 13 13 { 14 int i;15 int fd;16 14 int ret; 17 15 int debug = 0; 18 16 char * p; 19 17 char path[2048]; 20 struct stat statbuf;21 18 struct statvfs statvfsbuf; 22 19 … … 62 59 printf("Available Files: %llu\n", 63 60 (unsigned long long) statvfsbuf.f_favail); 61 #ifdef HAVE_FSID_INT 64 62 printf("File System ID: %lu\n", 65 63 (unsigned long) statvfsbuf.f_fsid); 64 #endif 66 65 printf("\n"); 67 66 -
vendor/current/examples/libsmbclient/testtruncate.c
r414 r988 15 15 int savedErrno; 16 16 char buffer[128]; 17 char * pSmbPath = NULL;18 char * pLocalPath = NULL;19 17 struct stat st; 20 18 -
vendor/current/examples/libsmbclient/testutime.c
r414 r988 1 #include "config.h" 1 2 #include <stdio.h> 2 3 #include <unistd.h> … … 9 10 int main(int argc, char * argv[]) 10 11 { 11 int ret;12 12 int debug = 0; 13 char buffer[16384]; 14 char mtime[32]; 15 char ctime[32]; 16 char atime[32]; 17 char * pSmbPath = NULL; 13 char m_time[32]; 14 char c_time[32]; 15 char a_time[32]; 16 const char * pSmbPath = NULL; 18 17 time_t t = time(NULL); 19 struct tm tm;20 18 struct stat st; 21 19 struct utimbuf utimbuf; … … 50 48 } 51 49 52 printf("Before\n mtime:%l u/%s ctime:%lu/%s atime:%lu/%s\n",53 st.st_mtime, ctime_r(&st.st_mtime, mtime),54 st.st_ctime, ctime_r(&st.st_ctime, ctime),55 st.st_atime, ctime_r(&st.st_atime, atime));50 printf("Before\n mtime:%lld/%s ctime:%lld/%s atime:%lld/%s\n", 51 (long long)st.st_mtime, ctime_r(&st.st_mtime, m_time), 52 (long long)st.st_ctime, ctime_r(&st.st_ctime, c_time), 53 (long long)st.st_atime, ctime_r(&st.st_atime, a_time)); 56 54 57 55 utimbuf.actime = t; /* unchangable (wont change) */ … … 69 67 } 70 68 71 printf("After\n mtime:%l u/%s ctime:%lu/%s atime:%lu/%s\n",72 st.st_mtime, ctime_r(&st.st_mtime, mtime),73 st.st_ctime, ctime_r(&st.st_ctime, ctime),74 st.st_atime, ctime_r(&st.st_atime, atime));69 printf("After\n mtime:%lld/%s ctime:%lld/%s atime:%lld/%s\n", 70 (long long)st.st_mtime, ctime_r(&st.st_mtime, m_time), 71 (long long)st.st_ctime, ctime_r(&st.st_ctime, c_time), 72 (long long)st.st_atime, ctime_r(&st.st_atime, a_time)); 75 73 76 74 return 0; -
vendor/current/examples/libsmbclient/testwrite.c
r414 r988 11 11 int main(int argc, char * argv[]) 12 12 { 13 int i;14 13 int fd; 15 14 int ret; 16 15 int debug = 0; 17 int mode = 0666;18 16 int savedErrno; 19 17 char buffer[2048]; 20 18 char path[2048]; 21 19 char * p; 22 time_t t0;23 time_t t1;24 struct stat st;25 20 26 21 smbc_init(get_auth_data_fn, debug); -
vendor/current/examples/misc/adssearch.pl
r414 r988 43 43 44 44 my $tdbdump = "/usr/bin/tdbdump"; 45 my $ntdbdump = "/usr/bin/ntdbdump"; 45 46 my $testparm = "/usr/bin/testparm"; 46 47 my $net = "/usr/bin/net"; … … 48 49 my $nmblookup = "/usr/bin/nmblookup"; 49 50 my $secrets_tdb = "/etc/samba/secrets.tdb"; 51 my $secrets_ntdb = "/etc/samba/secrets.ntdb"; 50 52 my $klist = "/usr/bin/klist"; 51 53 my $kinit = "/usr/bin/kinit"; … … 724 726 $workgroup = uc($workgroup); 725 727 726 my ($found, $tmp); 727 -x $tdbdump || die "tdbdump is not installed. cannot proceed autodetection\n"; 728 -r $secrets_tdb || die "cannot read $secrets_tdb. cannot proceed autodetection\n"; 728 my ($found, $tmp, $dbdump, $db); 729 if (-r $secrets_ntdb) { 730 -x $ntdbdump || die "ntdbdump is not installed. cannot proceed autodetection\n"; 731 $dbdump = $ntdbdump; 732 $db = $secrets_ntdb; 733 } else { 734 -x $tdbdump || die "tdbdump is not installed. cannot proceed autodetection\n"; 735 -r $secrets_tdb || die "cannot read $secrets_tdb. cannot proceed autodetection\n"; 736 $dbdump = $tdbdump; 737 $db = $secrets_tdb; 738 } 729 739 730 740 # get machine-password 731 741 my $key = sprintf("SECRETS/MACHINE_PASSWORD/%s", $workgroup); 732 open(SECRETS,"$ tdbdump $secrets_tdb |");742 open(SECRETS,"$dbdump $db |"); 733 743 while(my $line = <SECRETS>) { 734 744 chomp($line); -
vendor/current/examples/misc/wall.perl
r746 r988 1 #!/usr/ bin/perl1 #!/usr/local/bin/perl 2 2 # 3 3 #@(#) smb-wall.pl Description: -
vendor/current/examples/pam_winbind/pam_winbind.conf
r414 r988 4 4 # /etc/security/pam_winbind.conf 5 5 # 6 # For more details see man pam_winbind.conf(5) 6 7 7 8 [global] … … 20 21 ;krb5_auth = no 21 22 22 # when using kerberos, request a "FILE" krb5 credential cache type23 # when using kerberos, request a "FILE" or "DIR" krb5 credential cache type 23 24 # (leave empty to just do krb5 authentication but not have a ticket 24 25 # afterwards) -
vendor/current/examples/pdb/test.c
r740 r988 19 19 20 20 #include "includes.h" 21 #include "passdb.h" 21 22 22 23 static int testsam_debug_level = DBGC_ALL; … … 24 25 #undef DBGC_CLASS 25 26 #define DBGC_CLASS testsam_debug_level 26 27 /***************************************************************28 Start enumeration of the passwd list.29 ****************************************************************/30 31 static NTSTATUS testsam_setsampwent(struct pdb_methods *methods, BOOL update, uint32 acb_mask)32 {33 DEBUG(10, ("testsam_setsampwent called\n"));34 return NT_STATUS_NOT_IMPLEMENTED;35 }36 37 /***************************************************************38 End enumeration of the passwd list.39 ****************************************************************/40 41 static void testsam_endsampwent(struct pdb_methods *methods)42 {43 DEBUG(10, ("testsam_endsampwent called\n"));44 }45 46 /*****************************************************************47 Get one struct samu from the list (next in line)48 *****************************************************************/49 50 static NTSTATUS testsam_getsampwent(struct pdb_methods *methods, struct samu *user)51 {52 DEBUG(10, ("testsam_getsampwent called\n"));53 return NT_STATUS_NOT_IMPLEMENTED;54 }55 27 56 28 /****************************************************************** … … 104 76 } 105 77 106 NTSTATUS testsam_init(struct pdb_methods **pdb_method, const char *location)78 static NTSTATUS testsam_init(struct pdb_methods **pdb_method, const char *location) 107 79 { 108 80 NTSTATUS nt_status; … … 117 89 set, make_pdb_methods() already provide suitable defaults for missing functions */ 118 90 119 (*pdb_method)->setsampwent = testsam_setsampwent;120 (*pdb_method)->endsampwent = testsam_endsampwent;121 (*pdb_method)->getsampwent = testsam_getsampwent;122 91 (*pdb_method)->getsampwnam = testsam_getsampwnam; 123 92 (*pdb_method)->getsampwsid = testsam_getsampwsid; … … 139 108 } 140 109 141 NTSTATUS init_module(void) { 110 static_decl_pdb; 111 NTSTATUS pdb_test_init(void) 112 { 142 113 return smb_register_passdb(PASSDB_INTERFACE_VERSION, "testsam", 143 114 testsam_init); -
vendor/current/examples/perfcounter/Makefile
r414 r988 27 27 $(TDB_SRC_DIR)/common/io.o $(TDB_SRC_DIR)/common/lock.o \ 28 28 $(TDB_SRC_DIR)/common/open.o $(TDB_SRC_DIR)/common/transaction.o \ 29 $(TDB_SRC_DIR)/common/traverse.o 29 $(TDB_SRC_DIR)/common/traverse.o $(TDB_SRC_DIR)/common/hash.o 30 30 PERF_WRITER_OBJ = perf_writer.o perf_writer_mem.o perf_writer_util.o perf_writer_cpu.o perf_writer_process.o perf_writer_disk.o 31 31 -
vendor/current/examples/perfcounter/perf_writer_disk.c
r414 r988 133 133 char buf[LARGE_BUF], *start; 134 134 FILE *diskstats; 135 long reads, writes, discard;135 unsigned long reads, writes, discard; 136 136 137 137 diskstats = fopen("/proc/diskstats", "r"); … … 148 148 start = strstr(buf, data->diskInfo.mdata[i].name); 149 149 start += strlen(data->diskInfo.mdata[i].name) + 1; 150 num = sscanf(start, "% u %u %u %u",150 num = sscanf(start, "%lu %lu %lu %lu", 151 151 &reads, 152 &discard, 153 &writes, 152 &discard, 153 &writes, 154 154 &discard); 155 155 p->writesPerSec = writes; -
vendor/current/examples/printing/VampireDriversFunctions
r414 r988 91 91 # It then uploads and installs the drivers to a Samba server. (The 92 92 # Samba server needs to be prepared for this: a valid [print$] 93 # share, with write access set for a \"printer admin\".)93 # share, with write access set for a user with SePrintOperatorPrivilege.) 94 94 # 95 95 # The main commands used are \"smbclient\" and \"rpcclient\" combined … … 144 144 # 145 145 # ntprinteradmin=Administrator # any account on the NT host 146 # # with \"printer admin\"privileges147 # ntadminpasswd=not4you # the \"printer admin\" password on146 # # with SePrintOperatorPrivilege privileges 147 # ntadminpasswd=not4you # the printer admin password on 148 148 # # the NT print server 149 149 # nthost=windowsntprintserverbox # the netbios name of the NT print … … 151 151 # 152 152 # smbprinteradmin=knoppix # an account on the Samba server 153 # # with \"printer admin\"privileges154 # smbadminpasswd=2secret4you # the \"printer admin\" password on153 # # with SePrintOperatorPrivilege privileges 154 # smbadminpasswd=2secret4you # the printer admin password on 155 155 # # the Samba server 156 156 # smbhost=knoppix # the netbios name of the Samba -
vendor/current/examples/scripts/shares/python/smbparm.py
r740 r988 69 69 "FAKEOPLOCKS" : ("fake oplocks", SambaParmBool, P_LOCAL, "No"), 70 70 "FORCECREATEMODE" : ("force create mode", SambaParmString, P_LOCAL, "00"), 71 "SETDIRECTORY" : ("set directory", SambaParmBoolRev, P_LOCAL, "No"),72 71 "SMBPORTS" : ("smb ports", SambaParmString, P_GLOBAL, "445 139"), 73 72 "LOCKDIR" : ("lock directory", SambaParmString, P_GLOBAL, "/var/lib/samba"), … … 90 89 "WRITEOK" : ("read only", SambaParmBoolRev, P_LOCAL, "Yes"), 91 90 "MAXLOGSIZE" : ("max log size", SambaParmString, P_GLOBAL, "5000"), 92 "FORCESECURITYMODE" : ("force security mode", SambaParmString, P_LOCAL, "00"),93 91 "VFSOBJECT" : ("vfs objects", SambaParmString, P_LOCAL, ""), 94 92 "CHECKPASSWORDSCRIPT" : ("check password script", SambaParmString, P_GLOBAL, ""), … … 103 101 "LOGFILE" : ("log file", SambaParmString, P_GLOBAL, ""), 104 102 "WORKGROUP" : ("workgroup", SambaParmString, P_GLOBAL, "WORKGROUP"), 105 "DIRECTORYSECURITYMASK" : ("directory security mask", SambaParmString, P_LOCAL, "0777"),106 103 "ENCRYPTPASSWORDS" : ("encrypt passwords", SambaParmBool, P_GLOBAL, "Yes"), 107 104 "PRINTABLE" : ("printable", SambaParmBool, P_LOCAL, "No"), … … 148 145 "LARGEREADWRITE" : ("large readwrite", SambaParmBool, P_GLOBAL, "Yes"), 149 146 "LDAPREPLICATIONSLEEP" : ("ldap replication sleep", SambaParmString, P_GLOBAL, "1000"), 150 "SECURITYMASK" : ("security mask", SambaParmString, P_LOCAL, "0777"),151 147 "LDAPUSERSUFFIX" : ("ldap user suffix", SambaParmString, P_GLOBAL, ""), 152 148 "NETBIOSNAME" : ("netbios name", SambaParmString, P_GLOBAL, "PANTHER"), … … 185 181 "INCLUDE" : ("include", SambaParmString, P_LOCAL, ""), 186 182 "ALGORITHMICRIDBASE" : ("algorithmic rid base", SambaParmString, P_GLOBAL, "1000"), 187 "FORCEDIRECTORYSECURITYMODE": ("force directory security mode", SambaParmString, P_LOCAL, "00"),188 183 "ANNOUNCEVERSION" : ("announce version", SambaParmString, P_GLOBAL, "4.9"), 189 184 "USERNAMEMAP" : ("username map", SambaParmString, P_GLOBAL, ""), … … 203 198 "READRAW" : ("read raw", SambaParmBool, P_GLOBAL, "Yes"), 204 199 "WINBINDENUMGROUPS" : ("winbind enum groups", SambaParmBool, P_GLOBAL, "Yes"), 205 "PASSWORDLEVEL" : ("password level", SambaParmString, P_GLOBAL, "0"),206 200 "MAXPRINTJOBS" : ("max print jobs", SambaParmString, P_LOCAL, "1000"), 207 201 "PRINTCAP" : ("printcap name", SambaParmString, P_GLOBAL, ""), … … 258 252 "WTMPDIRECTORY" : ("wtmp directory", SambaParmString, P_GLOBAL, ""), 259 253 "ADDPRINTERCOMMAND" : ("addprinter command", SambaParmString, P_GLOBAL, ""), 260 "PRINTERADMIN" : ("printer admin", SambaParmString, P_LOCAL, ""),261 254 "WINSSERVER" : ("wins server", SambaParmString, P_GLOBAL, ""), 262 255 "LDAPTIMEOUT" : ("ldap timeout", SambaParmString, P_GLOBAL, "15"), -
vendor/current/examples/smb.conf.default
r414 r988 29 29 server string = Samba Server 30 30 31 # Security mode. Defines in which mode Samba will operate. Possible 32 # values are share, user, server, domain and ads. Most people will want 33 # user level security. See the Samba-HOWTO-Collection for details. 34 security = user 31 # Server role. Defines in which mode Samba will operate. Possible 32 # values are "standalone server", "member server", "classic primary 33 # domain controller", "classic backup domain controller", "active 34 # directory domain controller". 35 # 36 # Most people will want "standalone sever" or "member server". 37 # Running as "active directory domain controller" will require first 38 # running "samba-tool domain provision" to wipe databases and create a 39 # new domain. 40 server role = standalone server 35 41 36 42 # This option is important for security. It allows you to restrict … … 41 47 ; hosts allow = 192.168.1. 192.168.2. 127. 42 48 43 # If you want to automatically load your printer list rather44 # than setting them up individually then you'll need this45 load printers = yes46 47 # you may wish to override the location of the printcap file48 ; printcap name = /etc/printcap49 50 # on SystemV system setting printcap name to lpstat should allow51 # you to automatically obtain a printer list from the SystemV spool52 # system53 ; printcap name = lpstat54 55 # It should not be necessary to specify the print system type unless56 # it is non-standard. Currently supported print systems include:57 # bsd, cups, sysv, plp, lprng, aix, hpux, qnx58 ; printing = cups59 60 49 # Uncomment this if you want a guest account, you must add this to /etc/passwd 61 50 # otherwise the user "nobody" is used … … 69 58 max log size = 50 70 59 71 # Use password server option only with security = server 72 # The argument list may include: 73 # password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name] 74 # or to auto-locate the domain controller/s 75 # password server = * 76 ; password server = <NT-Server-Name> 77 78 # Use the realm option only with security = ads 79 # Specifies the Active Directory realm the host is part of 60 # Specifies the Kerberos or Active Directory realm the host is part of 80 61 ; realm = MY_REALM 81 62 … … 96 77 # here. See the man page for details. 97 78 ; interfaces = 192.168.12.2/24 192.168.13.2/24 98 99 # Browser Control Options:100 # set local master to no if you don't want Samba to become a master101 # browser on your network. Otherwise the normal election rules apply102 ; local master = no103 104 # OS Level determines the precedence of this server in master browser105 # elections. The default value should be reasonable106 ; os level = 33107 108 # Domain Master specifies Samba to be the Domain Master Browser. This109 # allows Samba to collate browse lists between subnets. Don't use this110 # if you already have a Windows NT domain controller doing this job111 ; domain master = yes112 113 # Preferred Master causes Samba to force a local browser election on startup114 # and gives it a slightly higher chance of winning the election115 ; preferred master = yes116 117 # Enable this if you want Samba to be a domain logon server for118 # Windows95 workstations.119 ; domain logons = yes120 121 # if you enable domain logons then you may want a per-machine or122 # per user logon script123 # run a specific logon batch file per workstation (machine)124 ; logon script = %m.bat125 # run a specific logon batch file per username126 ; logon script = %U.bat127 79 128 80 # Where to store roving profiles (only for Win95 and WinNT) -
vendor/current/examples/tridge/smb.conf
r414 r988 10 10 guest account = pcguest 11 11 hosts allow = 192.0.2. localhost 12 password level = 213 12 auto services = tridge susan 14 13 message command = csh -c '/usr/bin/X11/xedit -display :0 %s;rm %s' & … … 31 30 print ok = yes 32 31 print command = xmenu -heading "%s" OK& 33 34 [testprn]35 comment = Test printer36 path = /tmp37 user = susan38 print ok = yes39 print command = cp %s /tmp/smb.%U.prn40 lpq command = cat /tmp/xxyz41 32 42 33 [amd] -
vendor/current/examples/tridge/smb.conf.fjall
r414 r988 2 2 ;readraw = no 3 3 ;writeraw = no 4 ;password level = 45 4 ;mangled map = (;1 ) 6 5 ;protocol = lanman1
Note:
See TracChangeset
for help on using the changeset viewer.