Changeset 110


Ignore:
Timestamp:
Jan 21, 2008, 9:55:43 AM (18 years ago)
Author:
Paul Smedley
Message:

Check in updated detection of kerberos support

Location:
branches/samba-3.0/source/ndpsmb
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/ndpsmb/ndpsmb.c

    r107 r110  
    156156        { ND_PROP_ULONG, 0, "LOGLEVEL", "0"},
    157157        { ND_PROP_ULONG, 0, "EASUPPORT", "1"},
    158         { ND_PROP_ULONG, 0, "KRB5SUPPORT", "1"},
    159158        {ND_PROP_STRING, 0, NULL, NULL}
    160159};
     
    209208        char loglevel;
    210209        int easupport;
    211         int krb5support;
    212210} Resource;
    213211
     
    246244                sd.FgBg = SSF_FGBG_BACK;
    247245                sd.PgmName = EXECNAME;
    248                 if (pRes->krb5support)
    249                 {
    250                         StrNCat(params, " -k ", sizeof(params) - 1);
    251                 }
    252246                if (pRes->loglevel)
    253247                {
     
    263257                        StrNCat(params, pRes->logfile, sizeof(params) - 1);
    264258                }
    265 
    266259                log("params <%s>\n", params);
    267260                sd.PgmInputs = *params ? params : NULL;
     
    274267                        char failed[CCHMAXPATH + 1] = {0};
    275268                        RESULTCODES res = {0};
    276                         UCHAR pszArgString[CCHMAXPATH+41] ; /* Argument string */
    277                         sprintf(pszArgString, "smbcd %s\0", params);
    278                         if (params!=NULL)
    279                                 pszArgString[5] = '\0' ;
    280                         rc = DosExecPgm(failed, sizeof(failed), EXEC_BACKGROUND, pszArgString, NULL, &res, EXECNAME);
     269                        char * p = params;
     270                        StrCpy(p, EXECNAME);
     271                        p += StrLen(p) + 1;
     272                        if (*pRes->logfile)
     273                        {
     274                                StrCpy(p, "-l ");
     275                                StrNCat(p, pRes->logfile, sizeof(params) - (p - (char *)params));
     276                                p += StrLen(p) + 1;
     277                                if (pRes->loglevel)
     278                                {
     279                                        char level[2];
     280                                        level[0] = pRes->loglevel + '0';
     281                                        level[1] = 0;
     282                                        StrCpy(p, "-d ");
     283                                        StrNCat(p, level, sizeof(params) - (p - (char *)params));
     284                                        p += StrLen(p) + 1;
     285                                }
     286                        }
     287                        else
     288                        {
     289                                StrCpy(p, "-q");
     290                                p += StrLen(p) + 1;
     291                        }
     292                        *p = 0;         
     293                        rc = DosExecPgm(failed, sizeof(failed), EXEC_BACKGROUND, params, NULL, &res, EXECNAME);
    281294                        log("smbcd DosExecPgm codeTerminate %d codeResult %d rc %d\n", res.codeTerminate, res.codeResult, rc);
    282295                }
    283                 if (!rc) 
     296                if (!rc)
    284297                {
    285298                        DosSleep(500);
     
    379392        pRes->loglevel = 0;
    380393        pRes->easupport = 1;
    381         pRes->krb5support = 0;
    382394
    383395        t = 0, q = NULL;
     
    484496                {
    485497                        pRes->memlen = t * 65536;
    486                 }
    487         }
    488 
    489         t = 0;
    490         rc = ph->fsphQueryUlongProperty (pRes->properties, "KRB5SUPPORT", &t);
    491         if (!rc)
    492         {
    493                 if (t > 1)
    494                 {
    495                         rc = ERROR_INVALID_PARAMETER;
    496                 }
    497                 else
    498                 {
    499                         pRes->krb5support = t;
    500498                }
    501499        }
     
    20192017int APIENTRY NdpIOCTL (int type, HRESOURCE resource, char *path, int function, void *in, ULONG insize, PULONG poutlen)
    20202018{
    2021         log("NdpIOCTL <%s> %d %d\n", path, function, ERROR_NOT_SUPPORTED);
     2019    log("NdpIOCTL <%s> %d %d\n", path, function, ERROR_NOT_SUPPORTED);
    20222020        return ERROR_NOT_SUPPORTED;
    20232021}
  • branches/samba-3.0/source/ndpsmb/rc/rc.dlg

    r107 r110  
    99            FCF_TITLEBAR
    1010    BEGIN
    11         CTEXT           "SMB resource properties:", LBL_PROP, 5, 129, 190,
    12                         10, DT_VCENTER
    13         RTEXT           "Workgroup:", LBL_WORKGRP, 5, 117, 60, 10, DT_BOTTOM
     11        CTEXT           "SMB resource properties:", LBL_PROP, 5, 129, 190, 10,
     12                        DT_VCENTER
     13
     14        RTEXT           "Workgroup:", LBL_WORKGRP, 5, 117, 60, 10,
     15                        DT_BOTTOM
    1416        ENTRYFIELD      "", ENT_WORKGRP, 67, 118, 100, 8, ES_MARGIN
    15         RTEXT           "Server:", LBL_SERVER, 5, 105, 60, 10, DT_BOTTOM
     17
     18        RTEXT           "Server:", LBL_SERVER, 5, 105, 60, 10,
     19                        DT_BOTTOM
    1620        ENTRYFIELD      "", ENT_SERVER, 67, 106, 100, 8, ES_MARGIN
    17         RTEXT           "Share:", LBL_SHARE, 5, 93, 60, 10, DT_BOTTOM
     21
     22        RTEXT           "Share:", LBL_SHARE, 5, 93, 60, 10,
     23                        DT_BOTTOM
    1824        ENTRYFIELD      "", ENT_SHARE, 67, 94, 100, 8, ES_MARGIN
    19         RTEXT           "User:", LBL_USER, 5, 81, 60, 10, DT_BOTTOM
     25
     26        RTEXT           "User:", LBL_USER, 5, 81, 60, 10,
     27                        DT_BOTTOM
    2028        ENTRYFIELD      "", ENT_USER, 67, 82, 100, 8, ES_MARGIN
    21         RTEXT           "Password:", LBL_PASS, 5, 69, 60, 10, DT_BOTTOM
    22         ENTRYFIELD      "", ENT_PASS, 67, 70, 100, 8, ES_MARGIN |
    23                         ES_UNREADABLE
    24         RTEXT           "Master", LBL_MASTER, 5, 57, 30, 10, DT_BOTTOM
     29
     30        RTEXT           "Password:", LBL_PASS, 5, 69, 60, 10,
     31                        DT_BOTTOM
     32        ENTRYFIELD      "", ENT_PASS, 67, 70, 100, 8, ES_MARGIN | ES_UNREADABLE
     33
     34        RTEXT           "Master", LBL_MASTER, 5, 57, 30, 10,
     35                        DT_BOTTOM
    2536        CONTROL         "", CMB_MASTER, 37, 35, 50, 33, WC_COMBOBOX,
    2637                        CBS_DROPDOWNLIST | WS_GROUP | WS_TABSTOP |
     
    3243                        CBS_DROPDOWNLIST | WS_GROUP | WS_TABSTOP |
    3344                        WS_VISIBLE
    34         RTEXT           "Logfile:", LBL_LOGFILE, 5, 33, 60, 10, DT_BOTTOM
     45
     46        RTEXT           "Logfile:", LBL_LOGFILE, 5, 33, 60, 10,
     47                        DT_BOTTOM
    3548        ENTRYFIELD      "", ENT_LOGFILE, 67, 33, 100, 8, ES_MARGIN
    36         RTEXT           "Loglevel:", LBL_LOGLEVEL, 5, 21, 60, 10, DT_BOTTOM
    37         SPINBUTTON      CMB_LOGLEVEL, 67, 18, 20, 35, SPBS_NUMERICONLY |
    38                         SPBS_MASTER | SPBS_JUSTRIGHT | WS_GROUP
    39         LTEXT           "EA Support", LBL_EASUPPORT, 107, 20, 28, 10,
     49
     50        RTEXT           "Loglevel:", LBL_LOGLEVEL, 5, 21, 60, 10,
    4051                        DT_BOTTOM
    41         AUTOCHECKBOX    "", CHK_EASUPPORT, 97, 20, 10, 10, WS_GROUP
     52        CONTROL         "", CMB_LOGLEVEL, 67, 18, 20, 35, WC_SPINBUTTON,
     53                        SPBS_NUMERICONLY | SPBS_JUSTRIGHT | SPBS_MASTER | WS_GROUP | WS_TABSTOP |
     54                        WS_VISIBLE
     55
     56        LTEXT           "EA Support", LBL_EASUPPORT, 121, 20, 50, 10,
     57                        DT_BOTTOM
     58        CONTROL         "", CHK_EASUPPORT, 110, 20, 10, 10, WC_BUTTON,
     59                        BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP |
     60                        WS_VISIBLE
     61
    4262        PUSHBUTTON      "Cancel", DID_CANCEL, 2, 2, 40, 14
    4363        PUSHBUTTON      "<<Previous", BTN_PREV, 49, 2, 59, 14
    4464        DEFPUSHBUTTON   "Done", DID_OK, 113, 2, 40, 14
    4565        PUSHBUTTON      "Help", BTN_HELP, 158, 2, 40, 14, BS_HELP
    46         LTEXT           "KRB5 Support", LBL_KRB5SUPPORT, 164, 19, 32, 10,
    47                         DT_BOTTOM
    48         AUTOCHECKBOX    "", CHK_KRB5SUPPORT, 152, 19, 10, 10, WS_GROUP
    4966    END
    5067END
  • branches/samba-3.0/source/ndpsmb/rc/rc.h

    r107 r110  
    2424#define LBL_EASUPPORT               1021
    2525#define CHK_EASUPPORT               1022
    26 #define CHK_KRB5SUPPORT               1023
    27 #define LBL_KRB5SUPPORT             1024
  • branches/samba-3.0/source/ndpsmb/rc/rc.rc

    r107 r110  
    142142    "1"
    143143}
    144 
     144   
    145145RCDATA (DLG_ID + 11)
    146 {
    147     CHK_KRB5SUPPORT, PARMTYPE_INT, 0L, 1L, "krb5support", "%d", 1L,
    148     "0",
    149     "1"
    150 }
    151    
    152 RCDATA (DLG_ID + 12)
    153146{
    154147    0
  • branches/samba-3.0/source/ndpsmb/smbcd.c

    r107 r110  
    1111#include "smbwrp.h"
    1212#include "smbcd.h"
     13#include "config.h"
    1314
    1415#define SMBCD_MAX_THREADS 250
     
    741742void help(void)
    742743{
    743         printf("Usage: smbcd [-d/--debug <debuglevel>] [-q/--quiet] [-l/--logfile <logfile>] [-k/--kerberos]\n");
     744        printf("Usage: smbcd [-d/--debug <debuglevel>] [-q/--quiet] [-l/--logfile <logfile>]\n");
    744745}
    745746
     
    809810                        quiet = 1;
    810811                } else
    811                 if (strcmp(argv[0], "-k") == 0 || strcmp(argv[0], "--kerberos") == 0)
    812                 {
    813                         krb5support = 1;
    814                 } else
    815812                {
    816813                        printf("Unknown parameter <%s>\n", argv[0]);
     
    819816                }
    820817        }
     818#ifdef HAVE_KRB5_H
     819        krb5support = 1;
     820#else
     821        krb5support = 0;
     822#endif
    821823        if (rc)
    822824        {
  • branches/samba-3.0/source/ndpsmb/smbwrp.c

    r107 r110  
    10271027        if (!finfo) finfo = &finfo1;
    10281028
    1029 //      memcpy(finfo,&def_finfo,sizeof(*finfo));
    10301029        finfo->attr = def_finfo.mode;
    10311030        finfo->mtime = def_finfo.mtime_ts.tv_sec;
     
    11621161        smbwrp_fileinfo finfo;
    11631162        int i;
    1164         char *tdl, *dirlist = NULL;
     1163        char *dirlist = NULL;
    11651164        int dirlist_len = 0;
    11661165        int total_received = -1;
     
    11681167        int ff_searchcount=0;
    11691168        int ff_eos=0;
    1170         //int ff_lastname=0;
    11711169        int ff_dir_handle=0;
    11721170        int loop_count = 0;
     
    11811179
    11821180        /* NT uses 260, OS/2 uses 2. Both accept 1. */
    1183         info_level = (cli->capabilities&CAP_NT_SMBS)?260:2;
     1181        info_level = (cli->capabilities&CAP_NT_SMBS)?260:2; 
    11841182
    11851183        debuglocal(4,"list_files level %d. mask <%s>\n", info_level, mask);
     
    12041202                        SSVAL(param,0,attribute); /* attribute */
    12051203                        SSVAL(param,2,max_matches); /* max count */
    1206                         //SSVAL(param,4,4+2);   /* resume required + close on end */
    12071204                        SSVAL(param,4,(FLAG_TRANS2_FIND_REQUIRE_RESUME|FLAG_TRANS2_FIND_CLOSE_IF_END)); /* resume required + close on end */
    12081205                        SSVAL(param,6,info_level);
     
    12151212                        SSVAL(param,0,ff_dir_handle);
    12161213                        SSVAL(param,2,max_matches); /* max count */
    1217                         //SIVAL(param,6,0); /* ff_resume_key */
    12181214                        SSVAL(param,4,info_level);
    12191215                        /* For W2K servers serving out FAT filesystems we *must* set the
     
    12231219                           can miss filenames. Use last filename continue instead. JRA */
    12241220                        SSVAL(param,10,(FLAG_TRANS2_FIND_REQUIRE_RESUME|FLAG_TRANS2_FIND_CLOSE_IF_END));        /* resume required + close on end */
    1225                         //SSVAL(param,10,8+4+2);        /* continue + resume required + close on end */
    12261221                        p = param+12;
    1227                         //p += clistr_push(cli, param+12, mask, sizeof(param)-12,
    1228                         //               STR_TERMINATE);
    12291222                        if (last_name_raw_len && (last_name_raw_len < (sizeof(param)-12))) {
    12301223                                memcpy(p, last_name_raw.data, last_name_raw_len);
     
    12361229
    12371230                param_len = PTR_DIFF(p, param);
     1231
    12381232                if (!cli_send_trans(cli, SMBtrans2,
    12391233                                    NULL,                   /* Name */
     
    12711265                }
    12721266
    1273 
    12741267                if (cli_is_error(cli) || !rdata || !rparam)
    12751268                {
     
    12951288                        ff_searchcount = SVAL(p,2);
    12961289                        ff_eos = SVAL(p,4);
    1297                         //ff_lastname = SVAL(p,8);
    12981290                } else {
    12991291                        ff_searchcount = SVAL(p,0);
    13001292                        ff_eos = SVAL(p,2);
    1301                         //ff_lastname = SVAL(p,6);
    13021293                }
    13031294                debuglocal(4,"list_files %d %d %d %d\n", ff_searchcount, ff_eos, "(ff_lastname)", First);
Note: See TracChangeset for help on using the changeset viewer.