Changeset 988 for vendor/current/source3/libsmb/clirap2.c
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/libsmb/clirap2.c
r740 r988 81 81 #include "../librpc/gen_ndr/svcctl.h" 82 82 #include "libsmb/clirap.h" 83 #include "../libcli/smb/smbXcli_base.h" 83 84 84 85 #define WORDSIZE 2 … … 218 219 } 219 220 220 static char *make_header(char *param, uint16 apinum, const char *reqfmt, const char *datafmt)221 static char *make_header(char *param, uint16_t apinum, const char *reqfmt, const char *datafmt) 221 222 { 222 223 PUTWORD(param,apinum); … … 867 868 PUTWORD(p, 1); /* info level */ 868 869 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)); 873 872 874 873 p = data; … … 1099 1098 ****************************************************************************/ 1100 1099 1101 int cli_NetFileClose(struct cli_state *cli, uint32 file_id )1100 int cli_NetFileClose(struct cli_state *cli, uint32_t file_id ) 1102 1101 { 1103 1102 char *rparam = NULL; … … 1127 1126 /* nothing to do */ 1128 1127 } else if (res == 2314){ 1129 DEBUG(1, ("NetFileClose2 - attempt to close non-exist ant file open instance\n"));1128 DEBUG(1, ("NetFileClose2 - attempt to close non-existent file open instance\n")); 1130 1129 } else { 1131 1130 DEBUG(4,("NetFileClose2 res=%d\n", res)); … … 1147 1146 ****************************************************************************/ 1148 1147 1149 int cli_NetFileGetInfo(struct cli_state *cli, uint32 file_id, void (*fn)(const char *, const char *, uint16, uint16, uint32))1148 int cli_NetFileGetInfo(struct cli_state *cli, uint32_t file_id, void (*fn)(const char *, const char *, uint16_t, uint16_t, uint32_t)) 1150 1149 { 1151 1150 char *rparam = NULL; … … 1247 1246 int cli_NetFileEnum(struct cli_state *cli, const char * user, 1248 1247 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)) 1251 1250 { 1252 1251 char *rparam = NULL; … … 1534 1533 } 1535 1534 } 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)))); 1538 1539 } 1539 1540 } … … 1636 1637 * Parameters: 1637 1638 * cli - pointer to cli_state structure 1638 * pstype - pointer to uint32 to contain returned server type1639 * pstype - pointer to uint32_t to contain returned server type 1639 1640 * 1640 1641 * Returns: … … 1646 1647 ************************************************************************/ 1647 1648 1648 bool cli_get_server_type(struct cli_state *cli, uint32 *pstype)1649 bool cli_get_server_type(struct cli_state *cli, uint32_t *pstype) 1649 1650 { 1650 1651 char *rparam = NULL; … … 1755 1756 * requesting server_info_0 level information of machines 1756 1757 * matching the given server type. If the returned server 1757 * list contains the machine name contained in cli->desthost1758 * list contains the machine name contained in smbXcli_conn_remote_name(->conn) 1758 1759 * then we conclude the server type checks out. This routine 1759 1760 * is useful to retrieve list of server's of a certain … … 1775 1776 ************************************************************************/ 1776 1777 1777 bool cli_ns_check_server_type(struct cli_state *cli, char *workgroup, uint32 stype)1778 bool cli_ns_check_server_type(struct cli_state *cli, char *workgroup, uint32_t stype) 1778 1779 { 1779 1780 char *rparam = NULL; … … 1790 1791 bool found_server = false; 1791 1792 int res = -1; 1793 const char *remote_name = smbXcli_conn_remote_name(cli->conn); 1792 1794 1793 1795 /* send a SMBtrans command with api NetServerEnum */ … … 1825 1827 RAP_MACHNAME_LEN, 1826 1828 endp); 1827 if (strequal(ret_server, cli->desthost)) {1829 if (strequal(ret_server, remote_name)) { 1828 1830 found_server = true; 1829 1831 break; … … 1831 1833 } 1832 1834 } 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)))); 1835 1839 } 1836 1840 } … … 1871 1875 PUTDWORD(p, 0); /* Null pointer */ 1872 1876 strlcpy(upperbuf, user, sizeof(upperbuf)); 1873 strupper_m(upperbuf); 1877 if (!strupper_m(upperbuf)) { 1878 return false; 1879 } 1874 1880 tmp = upperbuf; 1875 1881 PUTSTRINGF(p, tmp, RAP_USERNAME_LEN); 1876 1882 p++; /* strange format, but ok */ 1877 1883 strlcpy(upperbuf, workstation, sizeof(upperbuf)); 1878 strupper_m(upperbuf); 1884 if (!strupper_m(upperbuf)) { 1885 return false; 1886 } 1879 1887 tmp = upperbuf; 1880 1888 PUTSTRINGF(p, tmp, RAP_MACHNAME_LEN); … … 1903 1911 1904 1912 int 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*)) 1907 1915 { 1908 1916 char param[WORDSIZE /* api number */ … … 2011 2019 int j; 2012 2020 for (j=0;j<jobcount;j++) { 2013 uint16 jid = 0, pos = 0, fsstatus = 0;2021 uint16_t jid = 0, pos = 0, fsstatus = 0; 2014 2022 char ownername[RAP_USERNAME_LEN]; 2015 2023 char notifyname[RAP_MACHNAME_LEN]; … … 2079 2087 2080 2088 int 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*)) 2083 2091 { 2084 2092 char param[WORDSIZE /* api number */ … … 2340 2348 ****************************************************************************/ 2341 2349 2342 int cli_NetSessionEnum(struct cli_state *cli, void (*fn)(char *, char *, uint16 , uint16, uint16, unsigned int, unsigned int, unsigned int, char *))2350 int cli_NetSessionEnum(struct cli_state *cli, void (*fn)(char *, char *, uint16_t, uint16_t, uint16_t, unsigned int, unsigned int, unsigned int, char *)) 2343 2351 { 2344 2352 char param[WORDSIZE /* api number */ … … 2440 2448 2441 2449 int 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 *)) 2443 2451 { 2444 2452 char param[WORDSIZE /* api number */
Note:
See TracChangeset
for help on using the changeset viewer.