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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/libsmb/clirap2.c

    r740 r988  
    8181#include "../librpc/gen_ndr/svcctl.h"
    8282#include "libsmb/clirap.h"
     83#include "../libcli/smb/smbXcli_base.h"
    8384
    8485#define WORDSIZE 2
     
    218219}
    219220
    220 static char *make_header(char *param, uint16 apinum, const char *reqfmt, const char *datafmt)
     221static char *make_header(char *param, uint16_t apinum, const char *reqfmt, const char *datafmt)
    221222{
    222223        PUTWORD(param,apinum);
     
    867868        PUTWORD(p, 1); /* info level */
    868869        PUTWORD(p, 0); /* pwencrypt */
    869         if(userinfo->passwrd)
    870                 PUTWORD(p,MIN(strlen((const char *)userinfo->passwrd), RAP_UPASSWD_LEN));
    871         else
    872                 PUTWORD(p, 0); /* password length */
     870        PUTWORD(p, MIN(strlen((const char *)userinfo->passwrd),
     871                       RAP_UPASSWD_LEN));
    873872
    874873        p = data;
     
    10991098****************************************************************************/
    11001099
    1101 int cli_NetFileClose(struct cli_state *cli, uint32 file_id )
     1100int cli_NetFileClose(struct cli_state *cli, uint32_t file_id )
    11021101{
    11031102        char *rparam = NULL;
     
    11271126                        /* nothing to do */
    11281127                } else if (res == 2314){
    1129                         DEBUG(1, ("NetFileClose2 - attempt to close non-existant file open instance\n"));
     1128                        DEBUG(1, ("NetFileClose2 - attempt to close non-existent file open instance\n"));
    11301129                } else {
    11311130                        DEBUG(4,("NetFileClose2 res=%d\n", res));
     
    11471146****************************************************************************/
    11481147
    1149 int cli_NetFileGetInfo(struct cli_state *cli, uint32 file_id, void (*fn)(const char *, const char *, uint16, uint16, uint32))
     1148int cli_NetFileGetInfo(struct cli_state *cli, uint32_t file_id, void (*fn)(const char *, const char *, uint16_t, uint16_t, uint32_t))
    11501149{
    11511150        char *rparam = NULL;
     
    12471246int cli_NetFileEnum(struct cli_state *cli, const char * user,
    12481247                    const char * base_path,
    1249                     void (*fn)(const char *, const char *, uint16, uint16,
    1250                                uint32))
     1248                    void (*fn)(const char *, const char *, uint16_t, uint16_t,
     1249                               uint32_t))
    12511250{
    12521251        char *rparam = NULL;
     
    15341533                        }
    15351534                } else {
    1536                         DEBUG(4,("cli_get_pdc_name: machine %s failed the NetServerEnum call. "
    1537                                 "Error was : %s.\n", cli->desthost, cli_errstr(cli) ));
     1535                        DEBUG(4, ("cli_get_pdc_name: machine %s failed the "
     1536                                  "NetServerEnum call. Error was : %s.\n",
     1537                                  smbXcli_conn_remote_name(cli->conn),
     1538                                  win_errstr(W_ERROR(cli->rap_error))));
    15381539                }
    15391540        }
     
    16361637* Parameters:
    16371638*             cli       - pointer to cli_state structure
    1638 *             pstype    - pointer to uint32 to contain returned server type
     1639*             pstype    - pointer to uint32_t to contain returned server type
    16391640*
    16401641* Returns:
     
    16461647************************************************************************/
    16471648
    1648 bool cli_get_server_type(struct cli_state *cli, uint32 *pstype)
     1649bool cli_get_server_type(struct cli_state *cli, uint32_t *pstype)
    16491650{
    16501651        char *rparam = NULL;
     
    17551756*           requesting server_info_0 level information of machines
    17561757*           matching the given server type. If the returned server
    1757 *           list contains the machine name contained in cli->desthost
     1758*           list contains the machine name contained in smbXcli_conn_remote_name(->conn)
    17581759*           then we conclude the server type checks out. This routine
    17591760*           is useful to retrieve list of server's of a certain
     
    17751776************************************************************************/
    17761777
    1777 bool cli_ns_check_server_type(struct cli_state *cli, char *workgroup, uint32 stype)
     1778bool cli_ns_check_server_type(struct cli_state *cli, char *workgroup, uint32_t stype)
    17781779{
    17791780        char *rparam = NULL;
     
    17901791        bool found_server = false;
    17911792        int res = -1;
     1793        const char *remote_name = smbXcli_conn_remote_name(cli->conn);
    17921794
    17931795        /* send a SMBtrans command with api NetServerEnum */
     
    18251827                                                RAP_MACHNAME_LEN,
    18261828                                                endp);
    1827                                 if (strequal(ret_server, cli->desthost)) {
     1829                                if (strequal(ret_server, remote_name)) {
    18281830                                        found_server = true;
    18291831                                        break;
     
    18311833                        }
    18321834                } else {
    1833                         DEBUG(4,("cli_ns_check_server_type: machine %s failed the NetServerEnum call. "
    1834                                 "Error was : %s.\n", cli->desthost, cli_errstr(cli) ));
     1835                        DEBUG(4, ("cli_ns_check_server_type: machine %s "
     1836                                  "failed the NetServerEnum call. Error was : "
     1837                                  "%s.\n", remote_name,
     1838                                  win_errstr(W_ERROR(cli->rap_error))));
    18351839                }
    18361840        }
     
    18711875        PUTDWORD(p, 0); /* Null pointer */
    18721876        strlcpy(upperbuf, user, sizeof(upperbuf));
    1873         strupper_m(upperbuf);
     1877        if (!strupper_m(upperbuf)) {
     1878                return false;
     1879        }
    18741880        tmp = upperbuf;
    18751881        PUTSTRINGF(p, tmp, RAP_USERNAME_LEN);
    18761882        p++; /* strange format, but ok */
    18771883        strlcpy(upperbuf, workstation, sizeof(upperbuf));
    1878         strupper_m(upperbuf);
     1884        if (!strupper_m(upperbuf)) {
     1885                return false;
     1886        }
    18791887        tmp = upperbuf;
    18801888        PUTSTRINGF(p, tmp, RAP_MACHNAME_LEN);
     
    19031911
    19041912int cli_NetPrintQEnum(struct cli_state *cli,
    1905                 void (*qfn)(const char*,uint16,uint16,uint16,const char*,const char*,const char*,const char*,const char*,uint16,uint16),
    1906                 void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,unsigned int,unsigned int,const char*))
     1913                void (*qfn)(const char*,uint16_t,uint16_t,uint16_t,const char*,const char*,const char*,const char*,const char*,uint16_t,uint16_t),
     1914                void (*jfn)(uint16_t,const char*,const char*,const char*,const char*,uint16_t,uint16_t,const char*,unsigned int,unsigned int,const char*))
    19071915{
    19081916        char param[WORDSIZE                         /* api number    */
     
    20112019                                int j;
    20122020                                for (j=0;j<jobcount;j++) {
    2013                                         uint16 jid = 0, pos = 0, fsstatus = 0;
     2021                                        uint16_t jid = 0, pos = 0, fsstatus = 0;
    20142022                                        char ownername[RAP_USERNAME_LEN];
    20152023                                        char notifyname[RAP_MACHNAME_LEN];
     
    20792087
    20802088int cli_NetPrintQGetInfo(struct cli_state *cli, const char *printer,
    2081         void (*qfn)(const char*,uint16,uint16,uint16,const char*,const char*,const char*,const char*,const char*,uint16,uint16),
    2082         void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,unsigned int,unsigned int,const char*))
     2089        void (*qfn)(const char*,uint16_t,uint16_t,uint16_t,const char*,const char*,const char*,const char*,const char*,uint16_t,uint16_t),
     2090        void (*jfn)(uint16_t,const char*,const char*,const char*,const char*,uint16_t,uint16_t,const char*,unsigned int,unsigned int,const char*))
    20832091{
    20842092        char param[WORDSIZE                         /* api number    */
     
    23402348****************************************************************************/
    23412349
    2342 int cli_NetSessionEnum(struct cli_state *cli, void (*fn)(char *, char *, uint16, uint16, uint16, unsigned int, unsigned int, unsigned int, char *))
     2350int cli_NetSessionEnum(struct cli_state *cli, void (*fn)(char *, char *, uint16_t, uint16_t, uint16_t, unsigned int, unsigned int, unsigned int, char *))
    23432351{
    23442352        char param[WORDSIZE                       /* api number    */
     
    24402448
    24412449int cli_NetSessionGetInfo(struct cli_state *cli, const char *workstation,
    2442                 void (*fn)(const char *, const char *, uint16, uint16, uint16, unsigned int, unsigned int, unsigned int, const char *))
     2450                void (*fn)(const char *, const char *, uint16_t, uint16_t, uint16_t, unsigned int, unsigned int, unsigned int, const char *))
    24432451{
    24442452        char param[WORDSIZE                          /* api number    */
Note: See TracChangeset for help on using the changeset viewer.