Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

Location:
vendor/current/source4/lib/cmdline
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/lib/cmdline/credentials.c

    r414 r988  
    2525static const char *cmdline_get_userpassword(struct cli_credentials *credentials)
    2626{
    27         char *ret;
    2827        TALLOC_CTX *mem_ctx = talloc_new(NULL);
    29 
    3028        const char *prompt_name = cli_credentials_get_unparsed_name(credentials, mem_ctx);
    3129        const char *prompt;
     30        static char pwd[256]; /* FIXME: Return a dup pwd and free it. */
     31        int rc;
    3232
    3333        prompt = talloc_asprintf(mem_ctx, "Password for [%s]:",
    3434                                 prompt_name);
    3535
    36         ret = getpass(prompt);
     36        memset(pwd, '\0', sizeof(pwd));
     37        rc = samba_getpass(prompt, pwd, sizeof(pwd), false, false);
     38        talloc_free(mem_ctx);
     39        if (rc < 0) {
     40                return NULL;
     41        }
    3742
    38         talloc_free(mem_ctx);
    39         return ret;
     43        return pwd;
    4044}
    4145
  • vendor/current/source4/lib/cmdline/popt_common.c

    r740 r988  
    8484
    8585        if (reason == POPT_CALLBACK_REASON_PRE) {
    86                 cmdline_lp_ctx = loadparm_init_global(false);
    87 
    8886                /* Hook for 'almost the first thing to do in a samba program' here */
    8987                /* setup for panics */
    90                 fault_setup(poptGetInvocationName(con));
     88                fault_setup();
    9189
    9290                /* and logging */
    93                 setup_logging(pname, DEBUG_STDOUT);
     91                setup_logging(pname, DEBUG_DEFAULT_STDOUT);
    9492                talloc_set_log_fn(popt_s4_talloc_log_fn);
    9593                talloc_set_abort_fn(smb_panic);
    9694
     95                cmdline_lp_ctx = loadparm_init_global(false);
    9796                return;
    9897        }
     
    188187}
    189188
    190 struct poptOption popt_common_connection[] = {
     189struct poptOption popt_common_connection4[] = {
    191190        { NULL, 0, POPT_ARG_CALLBACK, (void *)popt_common_callback },
    192191        { "name-resolve", 'R', POPT_ARG_STRING, NULL, 'R', "Use these name resolution services only", "NAME-RESOLVE-ORDER" },
     
    201200};
    202201
    203 struct poptOption popt_common_samba[] = {
     202struct poptOption popt_common_samba4[] = {
    204203        { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, (void *)popt_samba_callback },
    205204        { "debuglevel",   'd', POPT_ARG_STRING, NULL, 'd', "Set debug level", "DEBUGLEVEL" },
     
    213212};
    214213
    215 struct poptOption popt_common_version[] = {
     214struct poptOption popt_common_version4[] = {
    216215        { NULL, 0, POPT_ARG_CALLBACK, (void *)popt_version_callback },
    217216        { "version", 'V', POPT_ARG_NONE, NULL, 'V', "Print version" },
  • vendor/current/source4/lib/cmdline/popt_common.h

    r414 r988  
    2424
    2525/* Common popt structures */
    26 extern struct poptOption popt_common_samba[];
    27 extern struct poptOption popt_common_connection[];
    28 extern struct poptOption popt_common_version[];
    29 extern struct poptOption popt_common_credentials[];
     26extern struct poptOption popt_common_samba4[];
     27extern struct poptOption popt_common_connection4[];
     28extern struct poptOption popt_common_version4[];
     29extern struct poptOption popt_common_credentials4[];
    3030
    3131#ifndef POPT_TABLEEND
     
    3333#endif
    3434
    35 #define POPT_COMMON_SAMBA { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_samba, 0, "Common samba options:", NULL },
    36 #define POPT_COMMON_CONNECTION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_connection, 0, "Connection options:", NULL },
    37 #define POPT_COMMON_VERSION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version, 0, "Common samba options:", NULL },
    38 #define POPT_COMMON_CREDENTIALS { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials, 0, "Authentication options:", NULL },
     35#define POPT_COMMON_SAMBA { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_samba4, 0, "Common Samba options:", NULL },
     36#define POPT_COMMON_CONNECTION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_connection4, 0, "Connection options:", NULL },
     37#define POPT_COMMON_VERSION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version4, 0, "Version options:", NULL },
     38#define POPT_COMMON_CREDENTIALS { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials4, 0, "Authentication options:", NULL },
    3939
    4040extern struct cli_credentials *cmdline_credentials;
    4141extern struct loadparm_context *cmdline_lp_ctx;
    4242
    43 void popt_common_dont_ask(void);
    44 
    4543#endif /* _POPT_COMMON_H */
  • vendor/current/source4/lib/cmdline/popt_credentials.c

    r740 r988  
    3535 *              --simple-bind-dn
    3636 *              --password
     37 *              --krb5-ccache
    3738 */
    3839
     
    4041static bool machine_account_pending;
    4142
    42 enum opt { OPT_SIMPLE_BIND_DN, OPT_PASSWORD, OPT_KERBEROS, OPT_SIGN, OPT_ENCRYPT };
    43 
    44 /*
    45   disable asking for a password
    46 */
    47 void popt_common_dont_ask(void)
    48 {
    49         dont_ask = true;
    50 }
     43enum opt { OPT_SIMPLE_BIND_DN, OPT_PASSWORD, OPT_KERBEROS, OPT_SIGN, OPT_ENCRYPT, OPT_KRB5_CCACHE };
    5144
    5245static void popt_common_credentials_callback(poptContext con,
     
    131124                break;
    132125        }
     126        case OPT_KRB5_CCACHE:
     127        {
     128                const char *error_string;
     129                if (cli_credentials_set_ccache(cmdline_credentials, cmdline_lp_ctx, arg, CRED_SPECIFIED,
     130                                               &error_string) != 0) {
     131                        fprintf(stderr, "Error reading krb5 credentials cache: '%s' %s", arg, error_string);
     132                        exit(1);
     133                }
     134                break;
     135        }
    133136        case OPT_SIGN:
    134137        {
     
    158161
    159162
    160 struct poptOption popt_common_credentials[] = {
     163struct poptOption popt_common_credentials4[] = {
    161164        { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, (void *)popt_common_credentials_callback },
    162165        { "user", 'U', POPT_ARG_STRING, NULL, 'U', "Set the network username", "[DOMAIN/]USERNAME[%PASSWORD]" },
     
    164167        { "password", 0, POPT_ARG_STRING, NULL, OPT_PASSWORD, "Password" },
    165168        { "authentication-file", 'A', POPT_ARG_STRING, NULL, 'A', "Get the credentials from a file", "FILE" },
    166         { "machine-pass", 'P', POPT_ARG_NONE, NULL, 'P', "Use stored machine account password (implies -k)" },
     169        { "machine-pass", 'P', POPT_ARG_NONE, NULL, 'P', "Use stored machine account password" },
    167170        { "simple-bind-dn", 0, POPT_ARG_STRING, NULL, OPT_SIMPLE_BIND_DN, "DN to use for a simple bind" },
    168171        { "kerberos", 'k', POPT_ARG_STRING, NULL, OPT_KERBEROS, "Use Kerberos, -k [yes|no]" },
     172        { "krb5-ccache", 0, POPT_ARG_STRING, NULL, OPT_KRB5_CCACHE, "Credentials cache location for Kerberos" },
    169173        { "sign", 'S', POPT_ARG_NONE, NULL, OPT_SIGN, "Sign connection to prevent modification in transit" },
    170174        { "encrypt", 'e', POPT_ARG_NONE, NULL, OPT_ENCRYPT, "Encrypt connection for privacy" },
  • vendor/current/source4/lib/cmdline/wscript_build

    r740 r988  
    44                  source='credentials.c',
    55                  autoproto='credentials.h',
    6                   public_deps='credentials popt',
     6                  public_deps='samba-credentials popt',
     7                  deps='samba-util',
    78                  private_library=True)
    89
     
    1011        source='popt_common.c',
    1112        public_deps='popt',
    12         public_headers='popt_common.h:popt.h',
    1313        header_path='samba',
    1414        deps='talloc samba-hostconfig'
     
    1818        source='popt_credentials.c',
    1919        autoproto='popt_credentials.h',
    20         public_deps='credentials CREDENTIALS_SECRETS cmdline-credentials popt',
     20        public_deps='samba-credentials CREDENTIALS_SECRETS cmdline-credentials popt',
    2121        deps='samba-util'
    2222        )
Note: See TracChangeset for help on using the changeset viewer.