comparison usr/src/lib/smbsrv/libsmb/common/libsmb.h @ 10717:fe0545fc3cdd

6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API 6877755 smbd should not route stderr, stdout to /dev/null 6882701 Wrong error message for attempt to map local user to Windows group, or vice versa 6885105 Potential for deadlock in smb_node_set_delete_on_close() 6881928 smbd core generated when running a script to join domain, set abe properties 6885538 Reduce dependencies on libsmbrdr 6820325 cifs service can't start on multi vlan+ipmp configuration
author Alan Wright <amw@Sun.COM>
date Mon, 05 Oct 2009 11:03:34 -0700
parents 96eda55bfd54
children 37e5dcdf36d3
comparison
equal deleted inserted replaced
10716:b17df522be57 10717:fe0545fc3cdd
482 unsigned char *, int, char *, char *); 482 unsigned char *, int, char *, char *);
483 boolean_t smb_auth_validate_nt(unsigned char *, uint32_t, smb_passwd_t *, 483 boolean_t smb_auth_validate_nt(unsigned char *, uint32_t, smb_passwd_t *,
484 unsigned char *, int, char *, char *, uchar_t *); 484 unsigned char *, int, char *, char *, uchar_t *);
485 485
486 /* 486 /*
487 * SMB authenticated IPC
488 */
489 extern void smb_ipc_commit(void);
490 extern void smb_ipc_get_user(char *, size_t);
491 extern void smb_ipc_get_passwd(uint8_t *, size_t);
492 extern void smb_ipc_init(void);
493 extern void smb_ipc_rollback(void);
494 extern void smb_ipc_set(char *, uint8_t *);
495
496 /*
487 * SMB MAC Signing 497 * SMB MAC Signing
488 */ 498 */
489 499
490 #define SMB_MAC_KEY_SZ (SMBAUTH_SESSION_KEY_SZ + SMBAUTH_CS_MAXLEN) 500 #define SMB_MAC_KEY_SZ (SMBAUTH_SESSION_KEY_SZ + SMBAUTH_CS_MAXLEN)
491 #define SMB_SIG_OFFS 14 /* signature field offset within header */ 501 #define SMB_SIG_OFFS 14 /* signature field offset within header */
551 * The local domain refers to the local machine and is named 561 * The local domain refers to the local machine and is named
552 * after the local hostname. The primary domain is the domain 562 * after the local hostname. The primary domain is the domain
553 * that the system joined. All other domains are either 563 * that the system joined. All other domains are either
554 * trusted or untrusted, as defined by the primary domain PDC. 564 * trusted or untrusted, as defined by the primary domain PDC.
555 */ 565 */
556 typedef enum nt_domain_type { 566 typedef enum smb_domain_type {
557 NT_DOMAIN_NULL, 567 SMB_DOMAIN_NULL,
558 NT_DOMAIN_BUILTIN, 568 SMB_DOMAIN_BUILTIN,
559 NT_DOMAIN_LOCAL, 569 SMB_DOMAIN_LOCAL,
560 NT_DOMAIN_PRIMARY, 570 SMB_DOMAIN_PRIMARY,
561 NT_DOMAIN_ACCOUNT, 571 SMB_DOMAIN_ACCOUNT,
562 NT_DOMAIN_TRUSTED, 572 SMB_DOMAIN_TRUSTED,
563 NT_DOMAIN_UNTRUSTED, 573 SMB_DOMAIN_UNTRUSTED,
564 NT_DOMAIN_NUM_TYPES 574 SMB_DOMAIN_NUM_TYPES
565 } nt_domain_type_t; 575 } smb_domain_type_t;
566 576
567 /* 577 /*
568 * Information specific to trusted domains 578 * Information specific to trusted domains
569 */ 579 */
570 typedef struct smb_domain_trust { 580 typedef struct smb_domain_trust {
584 } smb_domain_dns_t; 594 } smb_domain_dns_t;
585 595
586 /* 596 /*
587 * This is the information that is held about each domain. 597 * This is the information that is held about each domain.
588 */ 598 */
589 typedef struct nt_domain { 599 typedef struct smb_domain {
590 list_node_t di_lnd; 600 list_node_t di_lnd;
591 nt_domain_type_t di_type; 601 smb_domain_type_t di_type;
592 char di_sid[SMB_SID_STRSZ]; 602 char di_sid[SMB_SID_STRSZ];
593 char di_nbname[NETBIOS_NAME_SZ]; 603 char di_nbname[NETBIOS_NAME_SZ];
594 char di_fqname[MAXHOSTNAMELEN]; 604 char di_fqname[MAXHOSTNAMELEN];
595 smb_sid_t *di_binsid; 605 smb_sid_t *di_binsid;
596 union { 606 union {
597 smb_domain_dns_t di_dns; 607 smb_domain_dns_t di_dns;
598 smb_domain_trust_t di_trust; 608 smb_domain_trust_t di_trust;
599 } di_u; 609 } di_u;
600 } nt_domain_t; 610 } smb_domain_t;
601 611
602 typedef struct smb_trusted_domains { 612 typedef struct smb_trusted_domains {
603 uint32_t td_num; 613 uint32_t td_num;
604 nt_domain_t *td_domains; 614 smb_domain_t *td_domains;
605 } smb_trusted_domains_t; 615 } smb_trusted_domains_t;
606 616
607 #define SMB_DOMAIN_SUCCESS 0 617 #define SMB_DOMAIN_SUCCESS 0
608 #define SMB_DOMAIN_NOMACHINE_SID 1 618 #define SMB_DOMAIN_NOMACHINE_SID 1
609 #define SMB_DOMAIN_NODOMAIN_SID 2 619 #define SMB_DOMAIN_NODOMAIN_SID 2
610 #define SMB_DOMAIN_NODOMAIN_NAME 3 620 #define SMB_DOMAIN_NODOMAIN_NAME 3
611 #define SMB_DOMAIN_INTERNAL_ERR 4 621 #define SMB_DOMAIN_INTERNAL_ERR 4
612 #define SMB_DOMAIN_INVALID_ARG 5 622 #define SMB_DOMAIN_INVALID_ARG 5
613 #define SMB_DOMAIN_NO_MEMORY 6 623 #define SMB_DOMAIN_NO_MEMORY 6
614 624 #define SMB_DOMAIN_NO_CACHE 7
615 typedef struct smb_domain { 625
626 /*
627 * This structure could contain information about
628 * the primary domain the name of selected domain controller
629 * for the primary domain and a list of trusted domains if
630 * any. The "ex" in the structure name stands for extended.
631 * This is to differentiate this structure from smb_domain_t
632 * which only contains information about a single domain.
633 */
634 typedef struct smb_domainex {
616 char d_dc[MAXHOSTNAMELEN]; 635 char d_dc[MAXHOSTNAMELEN];
617 nt_domain_t d_info; 636 smb_domain_t d_primary;
618 smb_trusted_domains_t d_trusted; 637 smb_trusted_domains_t d_trusted;
619 } smb_domain_t; 638 } smb_domainex_t;
620 639
621 int nt_domain_init(uint32_t); 640 int smb_domain_init(uint32_t);
622 void nt_domain_fini(void); 641 void smb_domain_fini(void);
623 void nt_domain_show(void); 642 void smb_domain_show(void);
624 void nt_domain_save(void); 643 void smb_domain_save(void);
625 boolean_t nt_domain_lookup_name(char *, nt_domain_t *); 644 boolean_t smb_domain_lookup_name(char *, smb_domain_t *);
626 boolean_t nt_domain_lookup_sid(smb_sid_t *, nt_domain_t *); 645 boolean_t smb_domain_lookup_sid(smb_sid_t *, smb_domain_t *);
627 boolean_t nt_domain_lookup_type(nt_domain_type_t, nt_domain_t *); 646 boolean_t smb_domain_lookup_type(smb_domain_type_t, smb_domain_t *);
628 boolean_t nt_domain_get_primary(smb_domain_t *); 647 boolean_t smb_domain_getinfo(smb_domainex_t *);
629 void nt_domain_update(smb_domain_t *); 648 void smb_domain_update(smb_domainex_t *);
630 void nt_domain_start_update(void); 649 uint32_t smb_domain_start_update(void);
631 void nt_domain_end_update(void); 650 void smb_domain_end_update(void);
632 void nt_domain_set_basic_info(char *, char *, char *, nt_domain_t *); 651 void smb_domain_set_basic_info(char *, char *, char *, smb_domain_t *);
633 void nt_domain_set_dns_info(char *, char *, char *, char *, char *, 652 void smb_domain_set_dns_info(char *, char *, char *, char *, char *,
634 nt_domain_t *); 653 smb_domain_t *);
635 void nt_domain_set_trust_info(char *, char *, char *, 654 void smb_domain_set_trust_info(char *, char *, char *,
636 uint32_t, uint32_t, uint32_t, nt_domain_t *); 655 uint32_t, uint32_t, uint32_t, smb_domain_t *);
637 656
638 typedef enum { 657 typedef enum {
639 SMB_LGRP_BUILTIN = 1, 658 SMB_LGRP_BUILTIN = 1,
640 SMB_LGRP_LOCAL 659 SMB_LGRP_LOCAL
641 } smb_gdomain_t; 660 } smb_gdomain_t;
821 840
822 uint32_t smb_sam_lookup_name(char *, char *, uint16_t, smb_account_t *); 841 uint32_t smb_sam_lookup_name(char *, char *, uint16_t, smb_account_t *);
823 uint32_t smb_sam_lookup_sid(smb_sid_t *, smb_account_t *); 842 uint32_t smb_sam_lookup_sid(smb_sid_t *, smb_account_t *);
824 int smb_sam_usr_cnt(void); 843 int smb_sam_usr_cnt(void);
825 uint32_t smb_sam_usr_groups(smb_sid_t *, smb_ids_t *); 844 uint32_t smb_sam_usr_groups(smb_sid_t *, smb_ids_t *);
826 int smb_sam_grp_cnt(nt_domain_type_t); 845 int smb_sam_grp_cnt(smb_domain_type_t);
827 void smb_account_free(smb_account_t *); 846 void smb_account_free(smb_account_t *);
828 boolean_t smb_account_validate(smb_account_t *); 847 boolean_t smb_account_validate(smb_account_t *);
829 848
830 /* 849 /*
831 * Security Descriptor functions. 850 * Security Descriptor functions.