データ構造 | |
struct | file_list |
struct | completion_remote_t |
関数 | |
static int | process_tok (pstring tok) |
static int | cmd_help (void) |
static int | writefile (int f, char *b, int n) |
static int | readfile (char *b, int n, XFILE *f) |
static void | send_message (void) |
static int | do_dskattr (void) |
static int | cmd_pwd (void) |
static int | do_cd (char *newdir) |
static int | cmd_cd (void) |
static BOOL | do_this_one (file_info *finfo) |
static void | display_finfo (file_info *finfo) |
static void | do_du (file_info *finfo) |
static void | reset_do_list_queue (void) |
static void | init_do_list_queue (void) |
static void | adjust_do_list_queue (void) |
static void | add_to_do_list_queue (const char *entry) |
static char * | do_list_queue_head (void) |
static void | remove_do_list_queue_head (void) |
static int | do_list_queue_empty (void) |
static void | do_list_helper (const char *mntpoint, file_info *f, const char *mask, void *state) |
void | do_list (const char *mask, uint16 attribute, void(*fn)(file_info *), BOOL rec, BOOL dirs) |
static int | cmd_dir (void) |
static int | cmd_du (void) |
static int | do_get (char *rname, char *lname, BOOL reget) |
static int | cmd_get (void) |
static void | do_mget (file_info *finfo) |
static int | cmd_more (void) |
static int | cmd_mget (void) |
static BOOL | do_mkdir (char *name) |
static BOOL | do_altname (char *name) |
static int | cmd_quit (void) |
static int | cmd_mkdir (void) |
static int | cmd_altname (void) |
static int | do_put (char *rname, char *lname, BOOL reput) |
static int | cmd_put (void) |
static void | free_file_list (struct file_list *list_head) |
static BOOL | seek_list (struct file_list *list, char *name) |
static int | cmd_select (void) |
static int | file_find (struct file_list **list, const char *directory, const char *expression, BOOL match) |
static int | cmd_mput (void) |
static int | do_cancel (int job) |
static int | cmd_cancel (void) |
static int | cmd_print (void) |
static void | queue_fn (struct print_job_info *p) |
static int | cmd_queue (void) |
static void | do_del (file_info *finfo) |
static int | cmd_del (void) |
static int | cmd_wdel (void) |
static int | cmd_open (void) |
static int | cmd_posix_open (void) |
static int | cmd_posix_mkdir (void) |
static int | cmd_posix_unlink (void) |
static int | cmd_posix_rmdir (void) |
static int | cmd_close (void) |
static int | cmd_posix (void) |
static int | cmd_lock (void) |
static int | cmd_unlock (void) |
static int | cmd_rmdir (void) |
static int | cmd_link (void) |
static int | cmd_symlink (void) |
static int | cmd_chmod (void) |
static const char * | filetype_to_str (mode_t mode) |
static char | rwx_to_str (mode_t m, mode_t bt, char ret) |
static char * | unix_mode_to_str (char *s, mode_t m) |
static char * | perms_to_string (fstring permstr, unsigned char perms) |
static int | cmd_getfacl (void) |
static int | cmd_stat (void) |
static int | cmd_chown (void) |
static int | cmd_rename (void) |
static int | cmd_volume (void) |
static int | cmd_hardlink (void) |
static int | cmd_prompt (void) |
static int | cmd_newer (void) |
static int | cmd_archive (void) |
static int | cmd_lowercase (void) |
static int | cmd_setcase (void) |
static int | cmd_showacls (void) |
static int | cmd_recurse (void) |
static int | cmd_translate (void) |
static int | cmd_lcd (void) |
static int | cmd_reget (void) |
static int | cmd_reput (void) |
static void | browse_fn (const char *name, uint32 m, const char *comment, void *state) |
static BOOL | browse_host_rpc (BOOL sort) |
static BOOL | browse_host (BOOL sort) |
static void | server_fn (const char *name, uint32 m, const char *comment, void *state) |
static BOOL | list_servers (const char *wk_grp) |
static int | cmd_vuid (void) |
static int | cmd_logon (void) |
static int | cmd_list_connect (void) |
static int | cmd_show_connect (void) |
static int | process_command_string (char *cmd) |
static void | completion_remote_filter (const char *mnt, file_info *f, const char *mask, void *state) |
static char ** | remote_completion (const char *text, int len) |
static char ** | completion_fn (const char *text, int start, int end) |
static void | readline_callback (void) |
static int | process_stdin (void) |
static int | process (char *base_directory) |
static int | do_host_query (char *query_host) |
static int | do_tar_op (char *base_directory) |
static int | do_message_op (void) |
int | main (int argc, char *argv[]) |
変数 | |
BOOL | AllowDebugChange |
BOOL | override_logfile |
char | tar_type |
BOOL | in_client |
static int | port = 0 |
pstring | cur_dir = "\\" |
static pstring | cd_path = "" |
static pstring | service |
static pstring | desthost |
static pstring | username |
static pstring | calling_name |
static BOOL | grepable = False |
static char * | cmdstr = NULL |
static int | io_bufsize = 64512 |
static int | name_type = 0x20 |
int | max_protocol |
static TALLOC_CTX * | ctx |
static pstring | cwd |
time_t | newer_than = 0 |
static int | archive_level = 0 |
static BOOL | translation = False |
static BOOL | have_ip |
int | blocksize |
BOOL | tar_inc |
BOOL | tar_reset |
static BOOL | prompt = True |
static BOOL | recurse = False |
static BOOL | showacls = False |
BOOL | lowercase = False |
static struct in_addr | dest_ip |
static BOOL | abort_mget = True |
static pstring | fileselection = "" |
file_info | def_finfo |
SMB_BIG_UINT | get_total_size = 0 |
unsigned int | get_total_time_ms = 0 |
static SMB_BIG_UINT | put_total_size = 0 |
static unsigned int | put_total_time_ms = 0 |
static double | dir_total |
cli_state * | cli |
static char | CLI_DIRSEP_CHAR = '\\' |
static char | CLI_DIRSEP_STR [] = { '\\', '\0' } |
static BOOL | do_list_recurse |
static BOOL | do_list_dirs |
static char * | do_list_queue = 0 |
static long | do_list_queue_size = 0 |
static long | do_list_queue_start = 0 |
static long | do_list_queue_end = 0 |
static void(*) | do_list_fn (file_info *) |
struct { | |
const char * name | |
int(* fn )(void) | |
const char * description | |
char compl_args [2] | |
} | commands [] |
static int process_tok | ( | pstring | tok | ) | [static] |
参照先 fn・name・strequal()・strnequal().
参照元 cmd_help()・process_command_string()・process_stdin().
03273 { 03274 int i = 0, matches = 0; 03275 int cmd=0; 03276 int tok_len = strlen(tok); 03277 03278 while (commands[i].fn != NULL) { 03279 if (strequal(commands[i].name,tok)) { 03280 matches = 1; 03281 cmd = i; 03282 break; 03283 } else if (strnequal(commands[i].name, tok, tok_len)) { 03284 matches++; 03285 cmd = i; 03286 } 03287 i++; 03288 } 03289 03290 if (matches == 0) 03291 return(-1); 03292 else if (matches == 1) 03293 return(cmd); 03294 else 03295 return(-2); 03296 }
static int cmd_help | ( | void | ) | [static] |
参照先 buf・d_printf()・description・name・next_token_nr()・process_tok().
03303 { 03304 int i=0,j; 03305 pstring buf; 03306 03307 if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { 03308 if ((i = process_tok(buf)) >= 0) 03309 d_printf("HELP %s:\n\t%s\n\n",commands[i].name,commands[i].description); 03310 } else { 03311 while (commands[i].description) { 03312 for (j=0; commands[i].description && (j<5); j++) { 03313 d_printf("%-15s",commands[i].name); 03314 i++; 03315 } 03316 d_printf("\n"); 03317 } 03318 } 03319 return 0; 03320 }
static int writefile | ( | int | f, | |
char * | b, | |||
int | n | |||
) | [static] |
参照先 translation.
参照元 do_get().
00115 { 00116 int i; 00117 00118 if (!translation) { 00119 return write(f,b,n); 00120 } 00121 00122 i = 0; 00123 while (i < n) { 00124 if (*b == '\r' && (i<(n-1)) && *(b+1) == '\n') { 00125 b++;i++; 00126 } 00127 if (write(f, b, 1) != 1) { 00128 break; 00129 } 00130 b++; 00131 i++; 00132 } 00133 00134 return(i); 00135 }
static int readfile | ( | char * | b, | |
int | n, | |||
XFILE * | f | |||
) | [static] |
参照先 c・translation・x_fread().
参照元 do_put().
00143 { 00144 int i; 00145 int c; 00146 00147 if (!translation) 00148 return x_fread(b,1,n,f); 00149 00150 i = 0; 00151 while (i < (n - 1) && (i < BUFFER_SIZE)) { 00152 if ((c = x_getc(f)) == EOF) { 00153 break; 00154 } 00155 00156 if (c == '\n') { /* change all LFs to CR/LF */ 00157 b[i++] = '\r'; 00158 } 00159 00160 b[i++] = c; 00161 } 00162 00163 return(i); 00164 }
static void send_message | ( | void | ) | [static] |
参照先 c・cli・cli_errstr()・cli_message_end()・cli_message_start()・cli_message_text()・d_printf()・desthost・username.
参照元 do_closeshare()・do_debug()・do_debuglevel()・do_dmalloc_changed()・do_dmalloc_mark()・do_drvupgrade()・do_election()・do_inject_fault()・do_message_op()・do_nodestatus()・do_ping()・do_poolusage()・do_profile()・do_profilelevel()・do_reload_config()・do_samrepl()・do_samsync()・do_shutdown()・do_winbind_offline()・do_winbind_online()・do_winbind_onlinestatus()・profilelevel_rqst().
00171 { 00172 int total_len = 0; 00173 int grp_id; 00174 00175 if (!cli_message_start(cli, desthost, username, &grp_id)) { 00176 d_printf("message start: %s\n", cli_errstr(cli)); 00177 return; 00178 } 00179 00180 00181 d_printf("Connected. Type your message, ending it with a Control-D\n"); 00182 00183 while (!feof(stdin) && total_len < 1600) { 00184 int maxlen = MIN(1600 - total_len,127); 00185 pstring msg; 00186 int l=0; 00187 int c; 00188 00189 ZERO_ARRAY(msg); 00190 00191 for (l=0;l<maxlen && (c=fgetc(stdin))!=EOF;l++) { 00192 if (c == '\n') 00193 msg[l++] = '\r'; 00194 msg[l] = c; 00195 } 00196 00197 if ((total_len > 0) && (strlen(msg) == 0)) { 00198 break; 00199 } 00200 00201 if (!cli_message_text(cli, msg, l, grp_id)) { 00202 d_printf("SMBsendtxt failed (%s)\n",cli_errstr(cli)); 00203 return; 00204 } 00205 00206 total_len += l; 00207 } 00208 00209 if (total_len >= 1600) 00210 d_printf("the message was truncated to 1600 bytes\n"); 00211 else 00212 d_printf("sent %d bytes\n",total_len); 00213 00214 if (!cli_message_end(cli, grp_id)) { 00215 d_printf("SMBsendend failed (%s)\n",cli_errstr(cli)); 00216 return; 00217 } 00218 }
static int do_dskattr | ( | void | ) | [static] |
参照先 cli・cli_dskattr()・cli_errstr()・cli_resolve_path()・cur_dir・d_printf()・total.
00225 { 00226 int total, bsize, avail; 00227 struct cli_state *targetcli; 00228 pstring targetpath; 00229 00230 if ( !cli_resolve_path( "", cli, cur_dir, &targetcli, targetpath ) ) { 00231 d_printf("Error in dskattr: %s\n", cli_errstr(cli)); 00232 return 1; 00233 } 00234 00235 if (!cli_dskattr(targetcli, &bsize, &total, &avail)) { 00236 d_printf("Error in dskattr: %s\n",cli_errstr(targetcli)); 00237 return 1; 00238 } 00239 00240 d_printf("\n\t\t%d blocks of size %d. %d blocks available\n", 00241 total, bsize, avail); 00242 00243 return 0; 00244 }
static int cmd_pwd | ( | void | ) | [static] |
static int do_cd | ( | char * | newdir | ) | [static] |
参照先 cd_path・clean_name()・cli・cli_chkpath()・CLI_DIRSEP_CHAR・CLI_DIRSEP_STR・cli_errstr()・cli_qpathinfo_basic()・cli_resolve_path()・cur_dir・d_printf()・cli_state::protocol・PROTOCOL_LANMAN2・strequal()・cli_state::win95.
参照元 cmd_cd()・cmd_posix()・do_tar_op()・process().
00262 { 00263 char *p = newdir; 00264 pstring saved_dir; 00265 pstring dname; 00266 pstring targetpath; 00267 struct cli_state *targetcli; 00268 SMB_STRUCT_STAT sbuf; 00269 uint32 attributes; 00270 int ret = 1; 00271 00272 dos_format(newdir); 00273 00274 /* Save the current directory in case the new directory is invalid */ 00275 00276 pstrcpy(saved_dir, cur_dir); 00277 00278 if (*p == CLI_DIRSEP_CHAR) { 00279 pstrcpy(cur_dir,p); 00280 } else { 00281 pstrcat(cur_dir,p); 00282 } 00283 00284 /* Ensure cur_dir ends in a DIRSEP */ 00285 if ((cur_dir[0] != '\0') && (*(cur_dir+strlen(cur_dir)-1) != CLI_DIRSEP_CHAR)) { 00286 pstrcat(cur_dir, CLI_DIRSEP_STR); 00287 } 00288 00289 clean_name(cur_dir); 00290 pstrcpy( dname, cur_dir ); 00291 00292 if ( !cli_resolve_path( "", cli, dname, &targetcli, targetpath ) ) { 00293 d_printf("cd %s: %s\n", dname, cli_errstr(cli)); 00294 pstrcpy(cur_dir,saved_dir); 00295 goto out; 00296 } 00297 00298 if (strequal(targetpath,CLI_DIRSEP_STR )) { 00299 return 0; 00300 } 00301 00302 /* Use a trans2_qpathinfo to test directories for modern servers. 00303 Except Win9x doesn't support the qpathinfo_basic() call..... */ 00304 00305 if ( targetcli->protocol > PROTOCOL_LANMAN2 && !targetcli->win95 ) { 00306 if ( !cli_qpathinfo_basic( targetcli, targetpath, &sbuf, &attributes ) ) { 00307 d_printf("cd %s: %s\n", dname, cli_errstr(targetcli)); 00308 pstrcpy(cur_dir,saved_dir); 00309 goto out; 00310 } 00311 00312 if ( !(attributes&FILE_ATTRIBUTE_DIRECTORY) ) { 00313 d_printf("cd %s: not a directory\n", dname); 00314 pstrcpy(cur_dir,saved_dir); 00315 goto out; 00316 } 00317 } else { 00318 pstrcat( targetpath, CLI_DIRSEP_STR ); 00319 clean_name( targetpath ); 00320 00321 if ( !cli_chkpath(targetcli, targetpath) ) { 00322 d_printf("cd %s: %s\n", dname, cli_errstr(targetcli)); 00323 pstrcpy(cur_dir,saved_dir); 00324 goto out; 00325 } 00326 } 00327 00328 ret = 0; 00329 00330 out: 00331 00332 pstrcpy(cd_path,cur_dir); 00333 return ret; 00334 }
static int cmd_cd | ( | void | ) | [static] |
参照先 buf・cur_dir・d_printf()・do_cd()・next_token_nr().
00341 { 00342 pstring buf; 00343 int rc = 0; 00344 00345 if (next_token_nr(NULL,buf,NULL,sizeof(buf))) 00346 rc = do_cd(buf); 00347 else 00348 d_printf("Current directory is %s\n",cur_dir); 00349 00350 return rc; 00351 }
参照先 archive_level・fileselection・mask_match()・file_info::mode・file_info::mtime_ts・file_info::name・newer_than.
参照元 display_finfo()・do_du()・do_list_helper().
00358 { 00359 if (finfo->mode & aDIR) 00360 return(True); 00361 00362 if (*fileselection && 00363 !mask_match(finfo->name,fileselection,False)) { 00364 DEBUG(3,("mask_match %s failed\n", finfo->name)); 00365 return False; 00366 } 00367 00368 if (newer_than && finfo->mtime_ts.tv_sec < newer_than) { 00369 DEBUG(3,("newer_than %s failed\n", finfo->name)); 00370 return(False); 00371 } 00372 00373 if ((archive_level==1 || archive_level==2) && !(finfo->mode & aARCH)) { 00374 DEBUG(3,("archive %s failed\n", finfo->name)); 00375 return(False); 00376 } 00377 00378 return(True); 00379 }
static void display_finfo | ( | file_info * | finfo | ) | [static] |
参照先 attrib_string()・file_info::cli・CLI_DIRSEP_STR・cli_errstr()・cli_nt_create()・cli_query_secdesc()・ctx・cwd・d_printf()・dir_total・display_sec_desc()・do_this_one()・file_info::mode・file_info::mtime_ts・file_info::name・showacls・file_info::size・strequal()・t・time_to_asc().
00386 { 00387 if (do_this_one(finfo)) { 00388 time_t t = finfo->mtime_ts.tv_sec; /* the time is assumed to be passed as GMT */ 00389 if (!showacls) { 00390 d_printf(" %-30s%7.7s %8.0f %s", 00391 finfo->name, 00392 attrib_string(finfo->mode), 00393 (double)finfo->size, 00394 time_to_asc(t)); 00395 dir_total += finfo->size; 00396 } else { 00397 pstring afname; 00398 int fnum; 00399 00400 /* skip if this is . or .. */ 00401 if ( strequal(finfo->name,"..") || strequal(finfo->name,".") ) 00402 return; 00403 /* create absolute filename for cli_nt_create() FIXME */ 00404 pstrcpy( afname, cwd); 00405 pstrcat( afname, CLI_DIRSEP_STR); 00406 pstrcat( afname, finfo->name); 00407 /* print file meta date header */ 00408 d_printf( "FILENAME:%s\n", afname); 00409 d_printf( "MODE:%s\n", attrib_string(finfo->mode)); 00410 d_printf( "SIZE:%.0f\n", (double)finfo->size); 00411 d_printf( "MTIME:%s", time_to_asc(t)); 00412 fnum = cli_nt_create(finfo->cli, afname, CREATE_ACCESS_READ); 00413 if (fnum == -1) { 00414 DEBUG( 0, ("display_finfo() Failed to open %s: %s\n", 00415 afname, 00416 cli_errstr( finfo->cli))); 00417 } else { 00418 SEC_DESC *sd = NULL; 00419 sd = cli_query_secdesc(finfo->cli, fnum, ctx); 00420 if (!sd) { 00421 DEBUG( 0, ("display_finfo() failed to " 00422 "get security descriptor: %s", 00423 cli_errstr( finfo->cli))); 00424 } else { 00425 display_sec_desc(sd); 00426 } 00427 } 00428 } 00429 } 00430 }
static void do_du | ( | file_info * | finfo | ) | [static] |
参照先 dir_total・do_this_one()・file_info::size.
参照元 cmd_du().
00437 { 00438 if (do_this_one(finfo)) { 00439 dir_total += finfo->size; 00440 } 00441 }
static void reset_do_list_queue | ( | void | ) | [static] |
参照先 do_list_queue・do_list_queue_end・do_list_queue_size・do_list_queue_start.
参照元 add_to_do_list_queue()・do_list()・init_do_list_queue().
00468 { 00469 SAFE_FREE(do_list_queue); 00470 do_list_queue_size = 0; 00471 do_list_queue_start = 0; 00472 do_list_queue_end = 0; 00473 }
static void init_do_list_queue | ( | void | ) | [static] |
参照先 d_printf()・do_list_queue・do_list_queue_size・reset_do_list_queue().
参照元 do_list().
00476 { 00477 reset_do_list_queue(); 00478 do_list_queue_size = 1024; 00479 do_list_queue = (char *)SMB_MALLOC(do_list_queue_size); 00480 if (do_list_queue == 0) { 00481 d_printf("malloc fail for size %d\n", 00482 (int)do_list_queue_size); 00483 reset_do_list_queue(); 00484 } else { 00485 memset(do_list_queue, 0, do_list_queue_size); 00486 } 00487 }
static void adjust_do_list_queue | ( | void | ) | [static] |
参照先 do_list_queue・do_list_queue_end・do_list_queue_size・do_list_queue_start.
参照元 remove_do_list_queue_head().
00490 { 00491 /* 00492 * If the starting point of the queue is more than half way through, 00493 * move everything toward the beginning. 00494 */ 00495 00496 if (do_list_queue == NULL) { 00497 DEBUG(4,("do_list_queue is empty\n")); 00498 do_list_queue_start = do_list_queue_end = 0; 00499 return; 00500 } 00501 00502 if (do_list_queue_start == do_list_queue_end) { 00503 DEBUG(4,("do_list_queue is empty\n")); 00504 do_list_queue_start = do_list_queue_end = 0; 00505 *do_list_queue = '\0'; 00506 } else if (do_list_queue_start > (do_list_queue_size / 2)) { 00507 DEBUG(4,("sliding do_list_queue backward\n")); 00508 memmove(do_list_queue, 00509 do_list_queue + do_list_queue_start, 00510 do_list_queue_end - do_list_queue_start); 00511 do_list_queue_end -= do_list_queue_start; 00512 do_list_queue_start = 0; 00513 } 00514 }
static void add_to_do_list_queue | ( | const char * | entry | ) | [static] |
参照先 d_printf()・do_list_queue・do_list_queue_end・do_list_queue_size・do_list_queue_start・reset_do_list_queue().
参照元 do_list()・do_list_helper().
00517 { 00518 long new_end = do_list_queue_end + ((long)strlen(entry)) + 1; 00519 while (new_end > do_list_queue_size) { 00520 do_list_queue_size *= 2; 00521 DEBUG(4,("enlarging do_list_queue to %d\n", 00522 (int)do_list_queue_size)); 00523 do_list_queue = (char *)SMB_REALLOC(do_list_queue, do_list_queue_size); 00524 if (! do_list_queue) { 00525 d_printf("failure enlarging do_list_queue to %d bytes\n", 00526 (int)do_list_queue_size); 00527 reset_do_list_queue(); 00528 } else { 00529 memset(do_list_queue + do_list_queue_size / 2, 00530 0, do_list_queue_size / 2); 00531 } 00532 } 00533 if (do_list_queue) { 00534 safe_strcpy_base(do_list_queue + do_list_queue_end, 00535 entry, do_list_queue, do_list_queue_size); 00536 do_list_queue_end = new_end; 00537 DEBUG(4,("added %s to do_list_queue (start=%d, end=%d)\n", 00538 entry, (int)do_list_queue_start, (int)do_list_queue_end)); 00539 } 00540 }
static char* do_list_queue_head | ( | void | ) | [static] |
参照先 do_list_queue・do_list_queue_start.
参照元 do_list()・remove_do_list_queue_head().
00543 { 00544 return do_list_queue + do_list_queue_start; 00545 }
static void remove_do_list_queue_head | ( | void | ) | [static] |
参照先 adjust_do_list_queue()・do_list_queue_end・do_list_queue_head()・do_list_queue_start.
参照元 do_list().
00548 { 00549 if (do_list_queue_end > do_list_queue_start) { 00550 do_list_queue_start += strlen(do_list_queue_head()) + 1; 00551 adjust_do_list_queue(); 00552 DEBUG(4,("removed head of do_list_queue (start=%d, end=%d)\n", 00553 (int)do_list_queue_start, (int)do_list_queue_end)); 00554 } 00555 }
static int do_list_queue_empty | ( | void | ) | [static] |
参照先 do_list_queue.
参照元 do_list().
00558 { 00559 return (! (do_list_queue && *do_list_queue)); 00560 }
static void do_list_helper | ( | const char * | mntpoint, | |
file_info * | f, | |||
const char * | mask, | |||
void * | state | |||
) | [static] |
参照先 add_to_do_list_queue()・CLI_DIRSEP_CHAR・CLI_DIRSEP_STR・d_printf()・file_info::dir・do_list_dirs・do_list_fn・do_list_recurse・do_this_one()・file_info::mode・file_info::name・strequal()・strrchr_m().
参照元 do_list().
00567 { 00568 char *dir_end; 00569 00570 /* save the directory */ 00571 pstrcpy( f->dir, mask ); 00572 if ( (dir_end = strrchr( f->dir, CLI_DIRSEP_CHAR )) != NULL ) { 00573 *dir_end = '\0'; 00574 } 00575 00576 if (f->mode & aDIR) { 00577 if (do_list_dirs && do_this_one(f)) { 00578 do_list_fn(f); 00579 } 00580 if (do_list_recurse && 00581 !strequal(f->name,".") && 00582 !strequal(f->name,"..")) { 00583 pstring mask2; 00584 char *p; 00585 00586 if (!f->name[0]) { 00587 d_printf("Empty dir name returned. Possible server misconfiguration.\n"); 00588 return; 00589 } 00590 00591 pstrcpy(mask2, mntpoint); 00592 pstrcat(mask2, mask); 00593 p = strrchr_m(mask2,CLI_DIRSEP_CHAR); 00594 if (!p) 00595 return; 00596 p[1] = 0; 00597 pstrcat(mask2, f->name); 00598 pstrcat(mask2,CLI_DIRSEP_STR); 00599 pstrcat(mask2,"*"); 00600 add_to_do_list_queue(mask2); 00601 } 00602 return; 00603 } 00604 00605 if (do_this_one(f)) { 00606 do_list_fn(f); 00607 } 00608 }
参照先 add_to_do_list_queue()・cli・CLI_DIRSEP_CHAR・cli_errstr()・cli_list()・cli_resolve_path()・cwd・d_printf()・display_finfo()・do_list_dirs・do_list_fn・do_list_helper()・do_list_queue_empty()・do_list_queue_head()・do_list_recurse・fprintf()・init_do_list_queue()・remove_do_list_queue_head()・reset_do_list_queue()・showacls.
参照元 cmd_del()・cmd_dir()・cmd_du()・cmd_mget()・do_mget()・list()・winbind_callback()・writetarheader().
00615 { 00616 static int in_do_list = 0; 00617 struct cli_state *targetcli; 00618 pstring targetpath; 00619 00620 if (in_do_list && rec) { 00621 fprintf(stderr, "INTERNAL ERROR: do_list called recursively when the recursive flag is true\n"); 00622 exit(1); 00623 } 00624 00625 in_do_list = 1; 00626 00627 do_list_recurse = rec; 00628 do_list_dirs = dirs; 00629 do_list_fn = fn; 00630 00631 if (rec) { 00632 init_do_list_queue(); 00633 add_to_do_list_queue(mask); 00634 00635 while (! do_list_queue_empty()) { 00636 /* 00637 * Need to copy head so that it doesn't become 00638 * invalid inside the call to cli_list. This 00639 * would happen if the list were expanded 00640 * during the call. 00641 * Fix from E. Jay Berkenbilt (ejb@ql.org) 00642 */ 00643 pstring head; 00644 pstrcpy(head, do_list_queue_head()); 00645 00646 /* check for dfs */ 00647 00648 if ( !cli_resolve_path( "", cli, head, &targetcli, targetpath ) ) { 00649 d_printf("do_list: [%s] %s\n", head, cli_errstr(cli)); 00650 remove_do_list_queue_head(); 00651 continue; 00652 } 00653 00654 cli_list(targetcli, targetpath, attribute, do_list_helper, NULL); 00655 remove_do_list_queue_head(); 00656 if ((! do_list_queue_empty()) && (fn == display_finfo)) { 00657 char* next_file = do_list_queue_head(); 00658 char* save_ch = 0; 00659 if ((strlen(next_file) >= 2) && 00660 (next_file[strlen(next_file) - 1] == '*') && 00661 (next_file[strlen(next_file) - 2] == CLI_DIRSEP_CHAR)) { 00662 save_ch = next_file + 00663 strlen(next_file) - 2; 00664 *save_ch = '\0'; 00665 if (showacls) /* cwd is only used if showacls is on */ 00666 pstrcpy( cwd, next_file); 00667 } 00668 if (!showacls) /* don't disturbe the showacls output */ 00669 d_printf("\n%s\n",next_file); 00670 if (save_ch) { 00671 *save_ch = CLI_DIRSEP_CHAR; 00672 } 00673 } 00674 } 00675 } else { 00676 /* check for dfs */ 00677 00678 if ( cli_resolve_path( "", cli, mask, &targetcli, targetpath ) ) { 00679 if (cli_list(targetcli, targetpath, attribute, do_list_helper, NULL) == -1) 00680 d_printf("%s listing %s\n", cli_errstr(targetcli), targetpath); 00681 } 00682 else 00683 d_printf("do_list: [%s] %s\n", mask, cli_errstr(cli)); 00684 00685 } 00686 00687 in_do_list = 0; 00688 reset_do_list_queue(); 00689 }
static int cmd_dir | ( | void | ) | [static] |
参照先 buf・CLI_DIRSEP_CHAR・cur_dir・cwd・dir_total・display_finfo()・do_dskattr()・do_list()・next_token_nr()・recurse・showacls.
00696 { 00697 uint16 attribute = aDIR | aSYSTEM | aHIDDEN; 00698 pstring mask; 00699 pstring buf; 00700 char *p=buf; 00701 int rc; 00702 00703 dir_total = 0; 00704 pstrcpy(mask,cur_dir); 00705 00706 if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { 00707 dos_format(p); 00708 if (*p == CLI_DIRSEP_CHAR) 00709 pstrcpy(mask,p); 00710 else 00711 pstrcat(mask,p); 00712 } else { 00713 pstrcat(mask,"*"); 00714 } 00715 00716 if (showacls) { 00717 /* cwd is only used if showacls is on */ 00718 pstrcpy(cwd, cur_dir); 00719 } 00720 00721 do_list(mask, attribute, display_finfo, recurse, True); 00722 00723 rc = do_dskattr(); 00724 00725 DEBUG(3, ("Total bytes listed: %.0f\n", dir_total)); 00726 00727 return rc; 00728 }
static int cmd_du | ( | void | ) | [static] |
参照先 buf・CLI_DIRSEP_CHAR・cur_dir・d_printf()・dir_total・do_dskattr()・do_du()・do_list()・next_token_nr()・recurse.
00735 { 00736 uint16 attribute = aDIR | aSYSTEM | aHIDDEN; 00737 pstring mask; 00738 pstring buf; 00739 char *p=buf; 00740 int rc; 00741 00742 dir_total = 0; 00743 pstrcpy(mask,cur_dir); 00744 00745 if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { 00746 dos_format(p); 00747 if (*p == CLI_DIRSEP_CHAR) 00748 pstrcpy(mask,p); 00749 else 00750 pstrcat(mask,p); 00751 } else { 00752 pstrcat(mask,"*"); 00753 } 00754 00755 do_list(mask, attribute, do_du, recurse, True); 00756 00757 rc = do_dskattr(); 00758 00759 d_printf("Total number of bytes: %.0f\n", dir_total); 00760 00761 return rc; 00762 }
static int do_get | ( | char * | rname, | |
char * | lname, | |||
BOOL | reget | |||
) | [static] |
参照先 archive_level・cli・cli_close()・cli_errstr()・cli_getattrE()・cli_open()・cli_qfileinfo()・cli_read()・cli_resolve_path()・cli_setatr()・d_printf()・get_total_size・get_total_time_ms・GetTimeOfDay()・handle・io_bufsize・lowercase・size・strlower_m()・sys_lseek()・sys_open()・writefile().
参照元 cmd_get()・cmd_more()・cmd_reget()・do_mget().
00769 { 00770 int handle = 0, fnum; 00771 BOOL newhandle = False; 00772 char *data; 00773 struct timeval tp_start; 00774 int read_size = io_bufsize; 00775 uint16 attr; 00776 SMB_OFF_T size; 00777 off_t start = 0; 00778 off_t nread = 0; 00779 int rc = 0; 00780 struct cli_state *targetcli; 00781 pstring targetname; 00782 00783 00784 if (lowercase) { 00785 strlower_m(lname); 00786 } 00787 00788 if ( !cli_resolve_path( "", cli, rname, &targetcli, targetname ) ) { 00789 d_printf("Failed to open %s: %s\n", rname, cli_errstr(cli)); 00790 return 1; 00791 } 00792 00793 GetTimeOfDay(&tp_start); 00794 00795 fnum = cli_open(targetcli, targetname, O_RDONLY, DENY_NONE); 00796 00797 if (fnum == -1) { 00798 d_printf("%s opening remote file %s\n",cli_errstr(cli),rname); 00799 return 1; 00800 } 00801 00802 if(!strcmp(lname,"-")) { 00803 handle = fileno(stdout); 00804 } else { 00805 if (reget) { 00806 handle = sys_open(lname, O_WRONLY|O_CREAT, 0644); 00807 if (handle >= 0) { 00808 start = sys_lseek(handle, 0, SEEK_END); 00809 if (start == -1) { 00810 d_printf("Error seeking local file\n"); 00811 return 1; 00812 } 00813 } 00814 } else { 00815 handle = sys_open(lname, O_WRONLY|O_CREAT|O_TRUNC, 0644); 00816 } 00817 newhandle = True; 00818 } 00819 if (handle < 0) { 00820 d_printf("Error opening local file %s\n",lname); 00821 return 1; 00822 } 00823 00824 00825 if (!cli_qfileinfo(targetcli, fnum, 00826 &attr, &size, NULL, NULL, NULL, NULL, NULL) && 00827 !cli_getattrE(targetcli, fnum, 00828 &attr, &size, NULL, NULL, NULL)) { 00829 d_printf("getattrib: %s\n",cli_errstr(targetcli)); 00830 return 1; 00831 } 00832 00833 DEBUG(1,("getting file %s of size %.0f as %s ", 00834 rname, (double)size, lname)); 00835 00836 if(!(data = (char *)SMB_MALLOC(read_size))) { 00837 d_printf("malloc fail for size %d\n", read_size); 00838 cli_close(targetcli, fnum); 00839 return 1; 00840 } 00841 00842 while (1) { 00843 int n = cli_read(targetcli, fnum, data, nread + start, read_size); 00844 00845 if (n <= 0) 00846 break; 00847 00848 if (writefile(handle,data, n) != n) { 00849 d_printf("Error writing local file\n"); 00850 rc = 1; 00851 break; 00852 } 00853 00854 nread += n; 00855 } 00856 00857 if (nread + start < size) { 00858 DEBUG (0, ("Short read when getting file %s. Only got %ld bytes.\n", 00859 rname, (long)nread)); 00860 00861 rc = 1; 00862 } 00863 00864 SAFE_FREE(data); 00865 00866 if (!cli_close(targetcli, fnum)) { 00867 d_printf("Error %s closing remote file\n",cli_errstr(cli)); 00868 rc = 1; 00869 } 00870 00871 if (newhandle) { 00872 close(handle); 00873 } 00874 00875 if (archive_level >= 2 && (attr & aARCH)) { 00876 cli_setatr(cli, rname, attr & ~(uint16)aARCH, 0); 00877 } 00878 00879 { 00880 struct timeval tp_end; 00881 int this_time; 00882 00883 GetTimeOfDay(&tp_end); 00884 this_time = 00885 (tp_end.tv_sec - tp_start.tv_sec)*1000 + 00886 (tp_end.tv_usec - tp_start.tv_usec)/1000; 00887 get_total_time_ms += this_time; 00888 get_total_size += nread; 00889 00890 DEBUG(1,("(%3.1f kb/s) (average %3.1f kb/s)\n", 00891 nread / (1.024*this_time + 1.0e-4), 00892 get_total_size / (1.024*get_total_time_ms))); 00893 } 00894 00895 return rc; 00896 }
static int cmd_get | ( | void | ) | [static] |
参照先 clean_name()・cur_dir・d_printf()・do_get()・next_token_nr().
00903 { 00904 pstring lname; 00905 pstring rname; 00906 char *p; 00907 00908 pstrcpy(rname,cur_dir); 00909 00910 p = rname + strlen(rname); 00911 00912 if (!next_token_nr(NULL,p,NULL,sizeof(rname)-strlen(rname))) { 00913 d_printf("get <filename>\n"); 00914 return 1; 00915 } 00916 pstrcpy(lname,p); 00917 clean_name(rname); 00918 00919 next_token_nr(NULL,lname,NULL,sizeof(lname)); 00920 00921 return do_get(rname, lname, False); 00922 }
static void do_mget | ( | file_info * | finfo | ) | [static] |
参照先 abort_mget・CLI_DIRSEP_STR・cur_dir・d_printf()・directory_exist()・do_get()・do_list()・lowercase・file_info::mode・file_info::name・prompt・strequal()・strlower_m()・yesno().
参照元 cmd_mget()・do_mget().
00929 { 00930 pstring rname; 00931 pstring quest; 00932 pstring saved_curdir; 00933 pstring mget_mask; 00934 00935 if (strequal(finfo->name,".") || strequal(finfo->name,"..")) 00936 return; 00937 00938 if (abort_mget) { 00939 d_printf("mget aborted\n"); 00940 return; 00941 } 00942 00943 if (finfo->mode & aDIR) 00944 slprintf(quest,sizeof(pstring)-1, 00945 "Get directory %s? ",finfo->name); 00946 else 00947 slprintf(quest,sizeof(pstring)-1, 00948 "Get file %s? ",finfo->name); 00949 00950 if (prompt && !yesno(quest)) 00951 return; 00952 00953 if (!(finfo->mode & aDIR)) { 00954 pstrcpy(rname,cur_dir); 00955 pstrcat(rname,finfo->name); 00956 do_get(rname, finfo->name, False); 00957 return; 00958 } 00959 00960 /* handle directories */ 00961 pstrcpy(saved_curdir,cur_dir); 00962 00963 pstrcat(cur_dir,finfo->name); 00964 pstrcat(cur_dir,CLI_DIRSEP_STR); 00965 00966 unix_format(finfo->name); 00967 if (lowercase) 00968 strlower_m(finfo->name); 00969 00970 if (!directory_exist(finfo->name,NULL) && 00971 mkdir(finfo->name,0777) != 0) { 00972 d_printf("failed to create directory %s\n",finfo->name); 00973 pstrcpy(cur_dir,saved_curdir); 00974 return; 00975 } 00976 00977 if (chdir(finfo->name) != 0) { 00978 d_printf("failed to chdir to directory %s\n",finfo->name); 00979 pstrcpy(cur_dir,saved_curdir); 00980 return; 00981 } 00982 00983 pstrcpy(mget_mask,cur_dir); 00984 pstrcat(mget_mask,"*"); 00985 00986 do_list(mget_mask, aSYSTEM | aHIDDEN | aDIR,do_mget,False, True); 00987 chdir(".."); 00988 pstrcpy(cur_dir,saved_curdir); 00989 }
static int cmd_more | ( | void | ) | [static] |
参照先 clean_name()・cur_dir・d_printf()・do_get()・fd・next_token_nr()・smb_mkstemp()・tmpdir().
00996 { 00997 pstring rname,lname,pager_cmd; 00998 char *pager; 00999 int fd; 01000 int rc = 0; 01001 01002 pstrcpy(rname,cur_dir); 01003 01004 slprintf(lname,sizeof(lname)-1, "%s/smbmore.XXXXXX",tmpdir()); 01005 fd = smb_mkstemp(lname); 01006 if (fd == -1) { 01007 d_printf("failed to create temporary file for more\n"); 01008 return 1; 01009 } 01010 close(fd); 01011 01012 if (!next_token_nr(NULL,rname+strlen(rname),NULL,sizeof(rname)-strlen(rname))) { 01013 d_printf("more <filename>\n"); 01014 unlink(lname); 01015 return 1; 01016 } 01017 clean_name(rname); 01018 01019 rc = do_get(rname, lname, False); 01020 01021 pager=getenv("PAGER"); 01022 01023 slprintf(pager_cmd,sizeof(pager_cmd)-1, 01024 "%s %s",(pager? pager:PAGER), lname); 01025 system(pager_cmd); 01026 unlink(lname); 01027 01028 return rc; 01029 }
static int cmd_mget | ( | void | ) | [static] |
参照先 abort_mget・buf・CLI_DIRSEP_CHAR・cur_dir・do_list()・do_mget()・next_token_nr()・recurse.
01036 { 01037 uint16 attribute = aSYSTEM | aHIDDEN; 01038 pstring mget_mask; 01039 pstring buf; 01040 char *p=buf; 01041 01042 *mget_mask = 0; 01043 01044 if (recurse) 01045 attribute |= aDIR; 01046 01047 abort_mget = False; 01048 01049 while (next_token_nr(NULL,p,NULL,sizeof(buf))) { 01050 pstrcpy(mget_mask,cur_dir); 01051 01052 if (*p == CLI_DIRSEP_CHAR) 01053 pstrcpy(mget_mask,p); 01054 else 01055 pstrcat(mget_mask,p); 01056 do_list(mget_mask, attribute,do_mget,False,True); 01057 } 01058 01059 if (!*mget_mask) { 01060 pstrcpy(mget_mask,cur_dir); 01061 pstrcat(mget_mask,"*"); 01062 do_list(mget_mask, attribute,do_mget,False,True); 01063 } 01064 01065 return 0; 01066 }
static BOOL do_mkdir | ( | char * | name | ) | [static] |
参照先 cli・cli_errstr()・cli_mkdir()・cli_resolve_path()・d_printf().
参照元 cmd_mkdir()・cmd_mput().
01073 { 01074 struct cli_state *targetcli; 01075 pstring targetname; 01076 01077 if ( !cli_resolve_path( "", cli, name, &targetcli, targetname ) ) { 01078 d_printf("mkdir %s: %s\n", name, cli_errstr(cli)); 01079 return False; 01080 } 01081 01082 if (!cli_mkdir(targetcli, targetname)) { 01083 d_printf("%s making remote directory %s\n", 01084 cli_errstr(targetcli),name); 01085 return(False); 01086 } 01087 01088 return(True); 01089 }
static BOOL do_altname | ( | char * | name | ) | [static] |
参照先 cli・cli_errstr()・cli_qpathinfo_alt_name()・d_printf().
参照元 cmd_altname().
01096 { 01097 pstring altname; 01098 if (!NT_STATUS_IS_OK(cli_qpathinfo_alt_name(cli, name, altname))) { 01099 d_printf("%s getting alt name for %s\n", 01100 cli_errstr(cli),name); 01101 return(False); 01102 } 01103 d_printf("%s\n", altname); 01104 01105 return(True); 01106 }
static int cmd_quit | ( | void | ) | [static] |
参照先 cli_cm_shutdown()・ctx.
01113 { 01114 cli_cm_shutdown(); 01115 talloc_destroy( ctx); 01116 exit(0); 01117 /* NOTREACHED */ 01118 return 0; 01119 }
static int cmd_mkdir | ( | void | ) | [static] |
参照先 buf・cli・cli_chkpath()・CLI_DIRSEP_STR・cli_resolve_path()・cur_dir・d_printf()・do_mkdir()・next_token_nr()・recurse・trim_char().
01126 { 01127 pstring mask; 01128 pstring buf; 01129 char *p=buf; 01130 01131 pstrcpy(mask,cur_dir); 01132 01133 if (!next_token_nr(NULL,p,NULL,sizeof(buf))) { 01134 if (!recurse) 01135 d_printf("mkdir <dirname>\n"); 01136 return 1; 01137 } 01138 pstrcat(mask,p); 01139 01140 if (recurse) { 01141 pstring ddir; 01142 pstring ddir2; 01143 struct cli_state *targetcli; 01144 pstring targetname; 01145 *ddir2 = 0; 01146 01147 if ( !cli_resolve_path( "", cli, mask, &targetcli, targetname ) ) { 01148 return 1; 01149 } 01150 01151 pstrcpy(ddir,targetname); 01152 trim_char(ddir,'.','\0'); 01153 p = strtok(ddir,"/\\"); 01154 while (p) { 01155 pstrcat(ddir2,p); 01156 if (!cli_chkpath(targetcli, ddir2)) { 01157 do_mkdir(ddir2); 01158 } 01159 pstrcat(ddir2,CLI_DIRSEP_STR); 01160 p = strtok(NULL,"/\\"); 01161 } 01162 } else { 01163 do_mkdir(mask); 01164 } 01165 01166 return 0; 01167 }
static int cmd_altname | ( | void | ) | [static] |
参照先 buf・cur_dir・d_printf()・do_altname()・name・next_token_nr().
01174 { 01175 pstring name; 01176 pstring buf; 01177 char *p=buf; 01178 01179 pstrcpy(name,cur_dir); 01180 01181 if (!next_token_nr(NULL,p,NULL,sizeof(buf))) { 01182 d_printf("altname <file>\n"); 01183 return 1; 01184 } 01185 pstrcat(name,p); 01186 01187 do_altname(name); 01188 01189 return 0; 01190 }
static int do_put | ( | char * | rname, | |
char * | lname, | |||
BOOL | reput | |||
) | [static] |
参照先 buf・cli・cli_close()・cli_cm_shutdown()・cli_errstr()・cli_getattrE()・cli_open()・cli_qfileinfo()・cli_resolve_path()・cli_write()・d_printf()・errno・GetTimeOfDay()・io_bufsize・put_total_size・put_total_time_ms・readfile()・strerror()・x_fclose()・x_feof()・x_fopen()・x_stdin・x_tseek().
参照元 cmd_mput()・cmd_print()・cmd_put()・cmd_reput().
01197 { 01198 int fnum; 01199 XFILE *f; 01200 SMB_OFF_T start = 0; 01201 off_t nread = 0; 01202 char *buf = NULL; 01203 int maxwrite = io_bufsize; 01204 int rc = 0; 01205 struct timeval tp_start; 01206 struct cli_state *targetcli; 01207 pstring targetname; 01208 01209 if ( !cli_resolve_path( "", cli, rname, &targetcli, targetname ) ) { 01210 d_printf("Failed to open %s: %s\n", rname, cli_errstr(cli)); 01211 return 1; 01212 } 01213 01214 GetTimeOfDay(&tp_start); 01215 01216 if (reput) { 01217 fnum = cli_open(targetcli, targetname, O_RDWR|O_CREAT, DENY_NONE); 01218 if (fnum >= 0) { 01219 if (!cli_qfileinfo(targetcli, fnum, NULL, &start, NULL, NULL, NULL, NULL, NULL) && 01220 !cli_getattrE(targetcli, fnum, NULL, &start, NULL, NULL, NULL)) { 01221 d_printf("getattrib: %s\n",cli_errstr(cli)); 01222 return 1; 01223 } 01224 } 01225 } else { 01226 fnum = cli_open(targetcli, targetname, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE); 01227 } 01228 01229 if (fnum == -1) { 01230 d_printf("%s opening remote file %s\n",cli_errstr(targetcli),rname); 01231 return 1; 01232 } 01233 01234 /* allow files to be piped into smbclient 01235 jdblair 24.jun.98 01236 01237 Note that in this case this function will exit(0) rather 01238 than returning. */ 01239 if (!strcmp(lname, "-")) { 01240 f = x_stdin; 01241 /* size of file is not known */ 01242 } else { 01243 f = x_fopen(lname,O_RDONLY, 0); 01244 if (f && reput) { 01245 if (x_tseek(f, start, SEEK_SET) == -1) { 01246 d_printf("Error seeking local file\n"); 01247 return 1; 01248 } 01249 } 01250 } 01251 01252 if (!f) { 01253 d_printf("Error opening local file %s\n",lname); 01254 return 1; 01255 } 01256 01257 DEBUG(1,("putting file %s as %s ",lname, 01258 rname)); 01259 01260 buf = (char *)SMB_MALLOC(maxwrite); 01261 if (!buf) { 01262 d_printf("ERROR: Not enough memory!\n"); 01263 return 1; 01264 } 01265 while (!x_feof(f)) { 01266 int n = maxwrite; 01267 int ret; 01268 01269 if ((n = readfile(buf,n,f)) < 1) { 01270 if((n == 0) && x_feof(f)) 01271 break; /* Empty local file. */ 01272 01273 d_printf("Error reading local file: %s\n", strerror(errno)); 01274 rc = 1; 01275 break; 01276 } 01277 01278 ret = cli_write(targetcli, fnum, 0, buf, nread + start, n); 01279 01280 if (n != ret) { 01281 d_printf("Error writing file: %s\n", cli_errstr(cli)); 01282 rc = 1; 01283 break; 01284 } 01285 01286 nread += n; 01287 } 01288 01289 if (!cli_close(targetcli, fnum)) { 01290 d_printf("%s closing remote file %s\n",cli_errstr(cli),rname); 01291 x_fclose(f); 01292 SAFE_FREE(buf); 01293 return 1; 01294 } 01295 01296 01297 if (f != x_stdin) { 01298 x_fclose(f); 01299 } 01300 01301 SAFE_FREE(buf); 01302 01303 { 01304 struct timeval tp_end; 01305 int this_time; 01306 01307 GetTimeOfDay(&tp_end); 01308 this_time = 01309 (tp_end.tv_sec - tp_start.tv_sec)*1000 + 01310 (tp_end.tv_usec - tp_start.tv_usec)/1000; 01311 put_total_time_ms += this_time; 01312 put_total_size += nread; 01313 01314 DEBUG(1,("(%3.1f kb/s) (average %3.1f kb/s)\n", 01315 nread / (1.024*this_time + 1.0e-4), 01316 put_total_size / (1.024*put_total_time_ms))); 01317 } 01318 01319 if (f == x_stdin) { 01320 cli_cm_shutdown(); 01321 exit(0); 01322 } 01323 01324 return rc; 01325 }
static int cmd_put | ( | void | ) | [static] |
参照先 buf・clean_name()・cur_dir・d_printf()・do_put()・file_exist()・next_token_nr().
01332 { 01333 pstring lname; 01334 pstring rname; 01335 pstring buf; 01336 char *p=buf; 01337 01338 pstrcpy(rname,cur_dir); 01339 01340 if (!next_token_nr(NULL,p,NULL,sizeof(buf))) { 01341 d_printf("put <filename>\n"); 01342 return 1; 01343 } 01344 pstrcpy(lname,p); 01345 01346 if (next_token_nr(NULL,p,NULL,sizeof(buf))) 01347 pstrcat(rname,p); 01348 else 01349 pstrcat(rname,lname); 01350 01351 clean_name(rname); 01352 01353 { 01354 SMB_STRUCT_STAT st; 01355 /* allow '-' to represent stdin 01356 jdblair, 24.jun.98 */ 01357 if (!file_exist(lname,&st) && 01358 (strcmp(lname,"-"))) { 01359 d_printf("%s does not exist\n",lname); 01360 return 1; 01361 } 01362 } 01363 01364 return do_put(rname, lname, False); 01365 }
static void free_file_list | ( | struct file_list * | list_head | ) | [static] |
参照先 list()・trim_string().
参照元 cmd_mput().
01399 { 01400 while (list) { 01401 trim_string(list->file_path,"./","\n"); 01402 if (strncmp(list->file_path, name, strlen(name)) != 0) { 01403 return(True); 01404 } 01405 list = list->next; 01406 } 01407 01408 return(False); 01409 }
static int cmd_select | ( | void | ) | [static] |
参照先 fileselection・next_token_nr().
01416 { 01417 pstrcpy(fileselection,""); 01418 next_token_nr(NULL,fileselection,NULL,sizeof(fileselection)); 01419 01420 return 0; 01421 }
static int file_find | ( | struct file_list ** | list, | |
const char * | directory, | |||
const char * | expression, | |||
BOOL | match | |||
) | [static] |
参照先 asprintf()・d_printf()・file_list::file_path・gen_fnmatch()・file_list::isdir・list()・readdirname()・recurse・sys_closedir()・sys_opendir().
参照元 cmd_mput()・file_find().
01430 { 01431 SMB_STRUCT_DIR *dir; 01432 struct file_list *entry; 01433 struct stat statbuf; 01434 int ret; 01435 char *path; 01436 BOOL isdir; 01437 const char *dname; 01438 01439 dir = sys_opendir(directory); 01440 if (!dir) 01441 return -1; 01442 01443 while ((dname = readdirname(dir))) { 01444 if (!strcmp("..", dname)) 01445 continue; 01446 if (!strcmp(".", dname)) 01447 continue; 01448 01449 if (asprintf(&path, "%s/%s", directory, dname) <= 0) { 01450 continue; 01451 } 01452 01453 isdir = False; 01454 if (!match || !gen_fnmatch(expression, dname)) { 01455 if (recurse) { 01456 ret = stat(path, &statbuf); 01457 if (ret == 0) { 01458 if (S_ISDIR(statbuf.st_mode)) { 01459 isdir = True; 01460 ret = file_find(list, path, expression, False); 01461 } 01462 } else { 01463 d_printf("file_find: cannot stat file %s\n", path); 01464 } 01465 01466 if (ret == -1) { 01467 SAFE_FREE(path); 01468 sys_closedir(dir); 01469 return -1; 01470 } 01471 } 01472 entry = SMB_MALLOC_P(struct file_list); 01473 if (!entry) { 01474 d_printf("Out of memory in file_find\n"); 01475 sys_closedir(dir); 01476 return -1; 01477 } 01478 entry->file_path = path; 01479 entry->isdir = isdir; 01480 DLIST_ADD(*list, entry); 01481 } else { 01482 SAFE_FREE(path); 01483 } 01484 } 01485 01486 sys_closedir(dir); 01487 return 0; 01488 }
static int cmd_mput | ( | void | ) | [static] |
参照先 asprintf()・buf・cli・cli_chkpath()・cur_dir・do_mkdir()・do_put()・file_find()・file_list::file_path・free_file_list()・file_list::isdir・file_list::next・next_token_nr()・prompt・seek_list()・trim_string()・yesno().
01495 { 01496 pstring buf; 01497 char *p=buf; 01498 01499 while (next_token_nr(NULL,p,NULL,sizeof(buf))) { 01500 int ret; 01501 struct file_list *temp_list; 01502 char *quest, *lname, *rname; 01503 01504 file_list = NULL; 01505 01506 ret = file_find(&file_list, ".", p, True); 01507 if (ret) { 01508 free_file_list(file_list); 01509 continue; 01510 } 01511 01512 quest = NULL; 01513 lname = NULL; 01514 rname = NULL; 01515 01516 for (temp_list = file_list; temp_list; 01517 temp_list = temp_list->next) { 01518 01519 SAFE_FREE(lname); 01520 if (asprintf(&lname, "%s/", temp_list->file_path) <= 0) 01521 continue; 01522 trim_string(lname, "./", "/"); 01523 01524 /* check if it's a directory */ 01525 if (temp_list->isdir) { 01526 /* if (!recurse) continue; */ 01527 01528 SAFE_FREE(quest); 01529 if (asprintf(&quest, "Put directory %s? ", lname) < 0) break; 01530 if (prompt && !yesno(quest)) { /* No */ 01531 /* Skip the directory */ 01532 lname[strlen(lname)-1] = '/'; 01533 if (!seek_list(temp_list, lname)) 01534 break; 01535 } else { /* Yes */ 01536 SAFE_FREE(rname); 01537 if(asprintf(&rname, "%s%s", cur_dir, lname) < 0) break; 01538 dos_format(rname); 01539 if (!cli_chkpath(cli, rname) && 01540 !do_mkdir(rname)) { 01541 DEBUG (0, ("Unable to make dir, skipping...")); 01542 /* Skip the directory */ 01543 lname[strlen(lname)-1] = '/'; 01544 if (!seek_list(temp_list, lname)) 01545 break; 01546 } 01547 } 01548 continue; 01549 } else { 01550 SAFE_FREE(quest); 01551 if (asprintf(&quest,"Put file %s? ", lname) < 0) break; 01552 if (prompt && !yesno(quest)) /* No */ 01553 continue; 01554 01555 /* Yes */ 01556 SAFE_FREE(rname); 01557 if (asprintf(&rname, "%s%s", cur_dir, lname) < 0) break; 01558 } 01559 01560 dos_format(rname); 01561 01562 do_put(rname, lname, False); 01563 } 01564 free_file_list(file_list); 01565 SAFE_FREE(quest); 01566 SAFE_FREE(lname); 01567 SAFE_FREE(rname); 01568 } 01569 01570 return 0; 01571 }
static int do_cancel | ( | int | job | ) | [static] |
参照先 cli・cli_errstr()・cli_printjob_del()・d_printf().
参照元 cmd_cancel().
01578 { 01579 if (cli_printjob_del(cli, job)) { 01580 d_printf("Job %d cancelled\n",job); 01581 return 0; 01582 } else { 01583 d_printf("Error cancelling job %d : %s\n",job,cli_errstr(cli)); 01584 return 1; 01585 } 01586 }
static int cmd_cancel | ( | void | ) | [static] |
参照先 buf・d_printf()・do_cancel()・next_token_nr().
01593 { 01594 pstring buf; 01595 int job; 01596 01597 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 01598 d_printf("cancel <jobid> ...\n"); 01599 return 1; 01600 } 01601 do { 01602 job = atoi(buf); 01603 do_cancel(job); 01604 } while (next_token_nr(NULL,buf,NULL,sizeof(buf))); 01605 01606 return 0; 01607 }
static int cmd_print | ( | void | ) | [static] |
参照先 d_printf()・do_put()・next_token_nr()・strequal()・strrchr_m()・sys_getpid().
01614 { 01615 pstring lname; 01616 pstring rname; 01617 char *p; 01618 01619 if (!next_token_nr(NULL,lname,NULL, sizeof(lname))) { 01620 d_printf("print <filename>\n"); 01621 return 1; 01622 } 01623 01624 pstrcpy(rname,lname); 01625 p = strrchr_m(rname,'/'); 01626 if (p) { 01627 slprintf(rname, sizeof(rname)-1, "%s-%d", p+1, (int)sys_getpid()); 01628 } 01629 01630 if (strequal(lname,"-")) { 01631 slprintf(rname, sizeof(rname)-1, "stdin-%d", (int)sys_getpid()); 01632 } 01633 01634 return do_put(rname, lname, False); 01635 }
static void queue_fn | ( | struct print_job_info * | p | ) | [static] |
static int cmd_queue | ( | void | ) | [static] |
参照先 cli・cli_print_queue()・queue_fn().
01651 { 01652 cli_print_queue(cli, queue_fn); 01653 01654 return 0; 01655 }
static void do_del | ( | file_info * | finfo | ) | [static] |
参照先 file_info::cli・CLI_DIRSEP_CHAR・cli_errstr()・cli_unlink()・d_printf()・file_info::dir・file_info::mode・file_info::name・pstr_sprintf().
参照元 cmd_del().
01662 { 01663 pstring mask; 01664 01665 pstr_sprintf( mask, "%s%c%s", finfo->dir, CLI_DIRSEP_CHAR, finfo->name ); 01666 01667 if (finfo->mode & aDIR) 01668 return; 01669 01670 if (!cli_unlink(finfo->cli, mask)) { 01671 d_printf("%s deleting remote file %s\n",cli_errstr(finfo->cli),mask); 01672 } 01673 }
static int cmd_del | ( | void | ) | [static] |
参照先 buf・cur_dir・d_printf()・do_del()・do_list()・next_token_nr()・recurse.
01680 { 01681 pstring mask; 01682 pstring buf; 01683 uint16 attribute = aSYSTEM | aHIDDEN; 01684 01685 if (recurse) 01686 attribute |= aDIR; 01687 01688 pstrcpy(mask,cur_dir); 01689 01690 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 01691 d_printf("del <filename>\n"); 01692 return 1; 01693 } 01694 pstrcat(mask,buf); 01695 01696 do_list(mask, attribute,do_del,False,False); 01697 01698 return 0; 01699 }
static int cmd_wdel | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_resolve_path()・cli_unlink_full()・cur_dir・d_printf()・next_token_nr().
01706 { 01707 pstring mask; 01708 pstring buf; 01709 uint16 attribute; 01710 struct cli_state *targetcli; 01711 pstring targetname; 01712 01713 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 01714 d_printf("wdel 0x<attrib> <wcard>\n"); 01715 return 1; 01716 } 01717 01718 attribute = (uint16)strtol(buf, (char **)NULL, 16); 01719 01720 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 01721 d_printf("wdel 0x<attrib> <wcard>\n"); 01722 return 1; 01723 } 01724 01725 pstrcpy(mask,cur_dir); 01726 pstrcat(mask,buf); 01727 01728 if ( !cli_resolve_path( "", cli, mask, &targetcli, targetname ) ) { 01729 d_printf("cmd_wdel %s: %s\n", mask, cli_errstr(cli)); 01730 return 1; 01731 } 01732 01733 if (!cli_unlink_full(targetcli, targetname, attribute)) { 01734 d_printf("%s deleting remote files %s\n",cli_errstr(targetcli),targetname); 01735 } 01736 return 0; 01737 }
static int cmd_open | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_nt_create()・cli_resolve_path()・cur_dir・d_printf()・next_token_nr().
01743 { 01744 pstring mask; 01745 pstring buf; 01746 struct cli_state *targetcli; 01747 pstring targetname; 01748 int fnum; 01749 01750 pstrcpy(mask,cur_dir); 01751 01752 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 01753 d_printf("open <filename>\n"); 01754 return 1; 01755 } 01756 pstrcat(mask,buf); 01757 01758 if ( !cli_resolve_path( "", cli, mask, &targetcli, targetname ) ) { 01759 d_printf("open %s: %s\n", mask, cli_errstr(cli)); 01760 return 1; 01761 } 01762 01763 fnum = cli_nt_create(targetcli, targetname, FILE_READ_DATA|FILE_WRITE_DATA); 01764 if (fnum == -1) { 01765 fnum = cli_nt_create(targetcli, targetname, FILE_READ_DATA); 01766 if (fnum != -1) { 01767 d_printf("open file %s: for read/write fnum %d\n", targetname, fnum); 01768 } else { 01769 d_printf("Failed to open file %s. %s\n", targetname, cli_errstr(cli)); 01770 } 01771 } else { 01772 d_printf("open file %s: for read/write fnum %d\n", targetname, fnum); 01773 } 01774 01775 return 0; 01776 }
static int cmd_posix_open | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_posix_open()・cli_resolve_path()・cur_dir・d_printf()・mode・next_token_nr().
01782 { 01783 pstring mask; 01784 pstring buf; 01785 struct cli_state *targetcli; 01786 pstring targetname; 01787 mode_t mode; 01788 int fnum; 01789 01790 pstrcpy(mask,cur_dir); 01791 01792 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 01793 d_printf("posix_open <filename> 0<mode>\n"); 01794 return 1; 01795 } 01796 pstrcat(mask,buf); 01797 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 01798 d_printf("posix_open <filename> 0<mode>\n"); 01799 return 1; 01800 } 01801 mode = (mode_t)strtol(buf, (char **)NULL, 8); 01802 01803 if (!cli_resolve_path( "", cli, mask, &targetcli, targetname )) { 01804 d_printf("posix_open %s: %s\n", mask, cli_errstr(cli)); 01805 return 1; 01806 } 01807 01808 fnum = cli_posix_open(targetcli, targetname, O_CREAT|O_RDWR, mode); 01809 if (fnum == -1) { 01810 fnum = cli_posix_open(targetcli, targetname, O_CREAT|O_RDONLY, mode); 01811 if (fnum != -1) { 01812 d_printf("posix_open file %s: for read/write fnum %d\n", targetname, fnum); 01813 } else { 01814 d_printf("Failed to open file %s. %s\n", targetname, cli_errstr(cli)); 01815 } 01816 } else { 01817 d_printf("posix_open file %s: for read/write fnum %d\n", targetname, fnum); 01818 } 01819 01820 return 0; 01821 }
static int cmd_posix_mkdir | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_posix_mkdir()・cli_resolve_path()・cur_dir・d_printf()・mode・next_token_nr().
01824 { 01825 pstring mask; 01826 pstring buf; 01827 struct cli_state *targetcli; 01828 pstring targetname; 01829 mode_t mode; 01830 int fnum; 01831 01832 pstrcpy(mask,cur_dir); 01833 01834 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 01835 d_printf("posix_mkdir <filename> 0<mode>\n"); 01836 return 1; 01837 } 01838 pstrcat(mask,buf); 01839 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 01840 d_printf("posix_mkdir <filename> 0<mode>\n"); 01841 return 1; 01842 } 01843 mode = (mode_t)strtol(buf, (char **)NULL, 8); 01844 01845 if (!cli_resolve_path( "", cli, mask, &targetcli, targetname )) { 01846 d_printf("posix_mkdir %s: %s\n", mask, cli_errstr(cli)); 01847 return 1; 01848 } 01849 01850 fnum = cli_posix_mkdir(targetcli, targetname, mode); 01851 if (fnum == -1) { 01852 d_printf("Failed to open file %s. %s\n", targetname, cli_errstr(cli)); 01853 } else { 01854 d_printf("posix_mkdir created directory %s\n", targetname); 01855 } 01856 01857 return 0; 01858 }
static int cmd_posix_unlink | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_posix_unlink()・cli_resolve_path()・cur_dir・d_printf()・next_token_nr().
01861 { 01862 pstring mask; 01863 pstring buf; 01864 struct cli_state *targetcli; 01865 pstring targetname; 01866 01867 pstrcpy(mask,cur_dir); 01868 01869 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 01870 d_printf("posix_unlink <filename>\n"); 01871 return 1; 01872 } 01873 pstrcat(mask,buf); 01874 01875 if (!cli_resolve_path( "", cli, mask, &targetcli, targetname )) { 01876 d_printf("posix_unlink %s: %s\n", mask, cli_errstr(cli)); 01877 return 1; 01878 } 01879 01880 if (!cli_posix_unlink(targetcli, targetname)) { 01881 d_printf("Failed to unlink file %s. %s\n", targetname, cli_errstr(cli)); 01882 } else { 01883 d_printf("posix_unlink deleted file %s\n", targetname); 01884 } 01885 01886 return 0; 01887 }
static int cmd_posix_rmdir | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_posix_rmdir()・cli_resolve_path()・cur_dir・d_printf()・next_token_nr().
01890 { 01891 pstring mask; 01892 pstring buf; 01893 struct cli_state *targetcli; 01894 pstring targetname; 01895 01896 pstrcpy(mask,cur_dir); 01897 01898 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 01899 d_printf("posix_rmdir <filename>\n"); 01900 return 1; 01901 } 01902 pstrcat(mask,buf); 01903 01904 if (!cli_resolve_path( "", cli, mask, &targetcli, targetname)) { 01905 d_printf("posix_rmdir %s: %s\n", mask, cli_errstr(cli)); 01906 return 1; 01907 } 01908 01909 if (!cli_posix_rmdir(targetcli, targetname)) { 01910 d_printf("Failed to unlink directory %s. %s\n", targetname, cli_errstr(cli)); 01911 } else { 01912 d_printf("posix_rmdir deleted directory %s\n", targetname); 01913 } 01914 01915 return 0; 01916 }
static int cmd_close | ( | void | ) | [static] |
参照先 buf・cli・cli_close()・cli_errstr()・d_printf()・next_token_nr().
01919 { 01920 fstring buf; 01921 int fnum; 01922 01923 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 01924 d_printf("close <fnum>\n"); 01925 return 1; 01926 } 01927 01928 fnum = atoi(buf); 01929 /* We really should use the targetcli here.... */ 01930 if (!cli_close(cli, fnum)) { 01931 d_printf("close %d: %s\n", fnum, cli_errstr(cli)); 01932 return 1; 01933 } 01934 return 0; 01935 }
static int cmd_posix | ( | void | ) | [static] |
参照先 cli・CLI_DIRSEP_CHAR・CLI_DIRSEP_STR・cli_errstr()・cli_set_unix_extensions_capabilities()・cli_unix_extensions_version()・cur_dir・d_printf()・do_cd().
01938 { 01939 uint16 major, minor; 01940 uint32 caplow, caphigh; 01941 pstring caps; 01942 01943 if (!SERVER_HAS_UNIX_CIFS(cli)) { 01944 d_printf("Server doesn't support UNIX CIFS extensions.\n"); 01945 return 1; 01946 } 01947 01948 if (!cli_unix_extensions_version(cli, &major, &minor, &caplow, &caphigh)) { 01949 d_printf("Can't get UNIX CIFS extensions version from server.\n"); 01950 return 1; 01951 } 01952 01953 d_printf("Server supports CIFS extensions %u.%u\n", (unsigned int)major, (unsigned int)minor); 01954 01955 *caps = '\0'; 01956 if (caplow & CIFS_UNIX_FCNTL_LOCKS_CAP) { 01957 pstrcat(caps, "locks "); 01958 } 01959 if (caplow & CIFS_UNIX_POSIX_ACLS_CAP) { 01960 pstrcat(caps, "acls "); 01961 } 01962 if (caplow & CIFS_UNIX_XATTTR_CAP) { 01963 pstrcat(caps, "eas "); 01964 } 01965 if (caplow & CIFS_UNIX_POSIX_PATHNAMES_CAP) { 01966 pstrcat(caps, "pathnames "); 01967 } 01968 if (caplow & CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP) { 01969 pstrcat(caps, "posix_path_operations "); 01970 } 01971 01972 if (strlen(caps) > 0 && caps[strlen(caps)-1] == ' ') { 01973 caps[strlen(caps)-1] = '\0'; 01974 } 01975 01976 if (!cli_set_unix_extensions_capabilities(cli, major, minor, caplow, caphigh)) { 01977 d_printf("Can't set UNIX CIFS extensions capabilities. %s.\n", cli_errstr(cli)); 01978 return 1; 01979 } 01980 01981 d_printf("Selecting server supported CIFS capabilities %s\n", caps); 01982 01983 if (caplow & CIFS_UNIX_POSIX_PATHNAMES_CAP) { 01984 CLI_DIRSEP_CHAR = '/'; 01985 *CLI_DIRSEP_STR = '/'; 01986 pstrcpy(cur_dir, CLI_DIRSEP_STR); 01987 do_cd(cur_dir); 01988 } 01989 01990 return 0; 01991 }
static int cmd_lock | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_posix_lock()・d_printf()・len・next_token_nr()・READ_LOCK・WRITE_LOCK.
01994 { 01995 fstring buf; 01996 SMB_BIG_UINT start, len; 01997 enum brl_type lock_type; 01998 int fnum; 01999 02000 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 02001 d_printf("lock <fnum> [r|w] <hex-start> <hex-len>\n"); 02002 return 1; 02003 } 02004 fnum = atoi(buf); 02005 02006 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 02007 d_printf("lock <fnum> [r|w] <hex-start> <hex-len>\n"); 02008 return 1; 02009 } 02010 02011 if (*buf == 'r' || *buf == 'R') { 02012 lock_type = READ_LOCK; 02013 } else if (*buf == 'w' || *buf == 'W') { 02014 lock_type = WRITE_LOCK; 02015 } else { 02016 d_printf("lock <fnum> [r|w] <hex-start> <hex-len>\n"); 02017 return 1; 02018 } 02019 02020 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 02021 d_printf("lock <fnum> [r|w] <hex-start> <hex-len>\n"); 02022 return 1; 02023 } 02024 02025 start = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16); 02026 02027 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 02028 d_printf("lock <fnum> [r|w] <hex-start> <hex-len>\n"); 02029 return 1; 02030 } 02031 02032 len = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16); 02033 02034 if (!cli_posix_lock(cli, fnum, start, len, True, lock_type)) { 02035 d_printf("lock failed %d: %s\n", fnum, cli_errstr(cli)); 02036 } 02037 02038 return 0; 02039 }
static int cmd_unlock | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_posix_unlock()・d_printf()・len・next_token_nr().
02042 { 02043 fstring buf; 02044 SMB_BIG_UINT start, len; 02045 int fnum; 02046 02047 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 02048 d_printf("unlock <fnum> <hex-start> <hex-len>\n"); 02049 return 1; 02050 } 02051 fnum = atoi(buf); 02052 02053 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 02054 d_printf("unlock <fnum> <hex-start> <hex-len>\n"); 02055 return 1; 02056 } 02057 02058 start = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16); 02059 02060 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 02061 d_printf("unlock <fnum> <hex-start> <hex-len>\n"); 02062 return 1; 02063 } 02064 02065 len = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16); 02066 02067 if (!cli_posix_unlock(cli, fnum, start, len)) { 02068 d_printf("unlock failed %d: %s\n", fnum, cli_errstr(cli)); 02069 } 02070 02071 return 0; 02072 }
static int cmd_rmdir | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_resolve_path()・cli_rmdir()・cur_dir・d_printf()・next_token_nr().
02080 { 02081 pstring mask; 02082 pstring buf; 02083 struct cli_state *targetcli; 02084 pstring targetname; 02085 02086 pstrcpy(mask,cur_dir); 02087 02088 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 02089 d_printf("rmdir <dirname>\n"); 02090 return 1; 02091 } 02092 pstrcat(mask,buf); 02093 02094 if ( !cli_resolve_path( "", cli, mask, &targetcli, targetname ) ) { 02095 d_printf("rmdir %s: %s\n", mask, cli_errstr(cli)); 02096 return 1; 02097 } 02098 02099 if (!cli_rmdir(targetcli, targetname)) { 02100 d_printf("%s removing remote directory file %s\n", 02101 cli_errstr(targetcli),mask); 02102 } 02103 02104 return 0; 02105 }
static int cmd_link | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_resolve_path()・cli_unix_hardlink()・cur_dir・d_printf()・next_token_nr().
02112 { 02113 pstring oldname,newname; 02114 pstring buf,buf2; 02115 struct cli_state *targetcli; 02116 pstring targetname; 02117 02118 pstrcpy(oldname,cur_dir); 02119 pstrcpy(newname,cur_dir); 02120 02121 if (!next_token_nr(NULL,buf,NULL,sizeof(buf)) || 02122 !next_token_nr(NULL,buf2,NULL, sizeof(buf2))) { 02123 d_printf("link <oldname> <newname>\n"); 02124 return 1; 02125 } 02126 02127 pstrcat(oldname,buf); 02128 pstrcat(newname,buf2); 02129 02130 if ( !cli_resolve_path( "", cli, oldname, &targetcli, targetname ) ) { 02131 d_printf("link %s: %s\n", oldname, cli_errstr(cli)); 02132 return 1; 02133 } 02134 02135 if (!SERVER_HAS_UNIX_CIFS(targetcli)) { 02136 d_printf("Server doesn't support UNIX CIFS calls.\n"); 02137 return 1; 02138 } 02139 02140 if (!cli_unix_hardlink(targetcli, targetname, newname)) { 02141 d_printf("%s linking files (%s -> %s)\n", cli_errstr(targetcli), newname, oldname); 02142 return 1; 02143 } 02144 02145 return 0; 02146 }
static int cmd_symlink | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_resolve_path()・cli_unix_symlink()・cur_dir・d_printf()・next_token_nr().
02153 { 02154 pstring oldname,newname; 02155 pstring buf,buf2; 02156 struct cli_state *targetcli; 02157 pstring targetname; 02158 02159 if (!SERVER_HAS_UNIX_CIFS(cli)) { 02160 d_printf("Server doesn't support UNIX CIFS calls.\n"); 02161 return 1; 02162 } 02163 02164 pstrcpy(newname,cur_dir); 02165 02166 if (!next_token_nr(NULL,buf,NULL,sizeof(buf)) || 02167 !next_token_nr(NULL,buf2,NULL, sizeof(buf2))) { 02168 d_printf("symlink <oldname> <newname>\n"); 02169 return 1; 02170 } 02171 02172 pstrcpy(oldname,buf); 02173 pstrcat(newname,buf2); 02174 02175 if ( !cli_resolve_path( "", cli, oldname, &targetcli, targetname ) ) { 02176 d_printf("link %s: %s\n", oldname, cli_errstr(cli)); 02177 return 1; 02178 } 02179 02180 if (!cli_unix_symlink(targetcli, targetname, newname)) { 02181 d_printf("%s symlinking files (%s -> %s)\n", 02182 cli_errstr(targetcli), newname, targetname); 02183 return 1; 02184 } 02185 02186 return 0; 02187 }
static int cmd_chmod | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_resolve_path()・cli_unix_chmod()・cur_dir・d_printf()・mode・next_token_nr().
02194 { 02195 pstring src; 02196 mode_t mode; 02197 pstring buf, buf2; 02198 struct cli_state *targetcli; 02199 pstring targetname; 02200 02201 pstrcpy(src,cur_dir); 02202 02203 if (!next_token_nr(NULL,buf,NULL,sizeof(buf)) || 02204 !next_token_nr(NULL,buf2,NULL, sizeof(buf2))) { 02205 d_printf("chmod mode file\n"); 02206 return 1; 02207 } 02208 02209 mode = (mode_t)strtol(buf, NULL, 8); 02210 pstrcat(src,buf2); 02211 02212 if ( !cli_resolve_path( "", cli, src, &targetcli, targetname ) ) { 02213 d_printf("chmod %s: %s\n", src, cli_errstr(cli)); 02214 return 1; 02215 } 02216 02217 if (!SERVER_HAS_UNIX_CIFS(targetcli)) { 02218 d_printf("Server doesn't support UNIX CIFS calls.\n"); 02219 return 1; 02220 } 02221 02222 if (!cli_unix_chmod(targetcli, targetname, mode)) { 02223 d_printf("%s chmod file %s 0%o\n", 02224 cli_errstr(targetcli), src, (unsigned int)mode); 02225 return 1; 02226 } 02227 02228 return 0; 02229 }
static const char* filetype_to_str | ( | mode_t | mode | ) | [static] |
参照元 cmd_stat()・unix_mode_to_str().
02232 { 02233 if (S_ISREG(mode)) { 02234 return "regular file"; 02235 } else if (S_ISDIR(mode)) { 02236 return "directory"; 02237 } else 02238 #ifdef S_ISCHR 02239 if (S_ISCHR(mode)) { 02240 return "character device"; 02241 } else 02242 #endif 02243 #ifdef S_ISBLK 02244 if (S_ISBLK(mode)) { 02245 return "block device"; 02246 } else 02247 #endif 02248 #ifdef S_ISFIFO 02249 if (S_ISFIFO(mode)) { 02250 return "fifo"; 02251 } else 02252 #endif 02253 #ifdef S_ISLNK 02254 if (S_ISLNK(mode)) { 02255 return "symbolic link"; 02256 } else 02257 #endif 02258 #ifdef S_ISSOCK 02259 if (S_ISSOCK(mode)) { 02260 return "socket"; 02261 } else 02262 #endif 02263 return ""; 02264 }
static char rwx_to_str | ( | mode_t | m, | |
mode_t | bt, | |||
char | ret | |||
) | [static] |
static char* unix_mode_to_str | ( | char * | s, | |
mode_t | m | |||
) | [static] |
参照先 filetype_to_str()・rwx_to_str().
参照元 cmd_stat().
02276 { 02277 char *p = s; 02278 const char *str = filetype_to_str(m); 02279 02280 switch(str[0]) { 02281 case 'd': 02282 *p++ = 'd'; 02283 break; 02284 case 'c': 02285 *p++ = 'c'; 02286 break; 02287 case 'b': 02288 *p++ = 'b'; 02289 break; 02290 case 'f': 02291 *p++ = 'p'; 02292 break; 02293 case 's': 02294 *p++ = str[1] == 'y' ? 'l' : 's'; 02295 break; 02296 case 'r': 02297 default: 02298 *p++ = '-'; 02299 break; 02300 } 02301 *p++ = rwx_to_str(m, S_IRUSR, 'r'); 02302 *p++ = rwx_to_str(m, S_IWUSR, 'w'); 02303 *p++ = rwx_to_str(m, S_IXUSR, 'x'); 02304 *p++ = rwx_to_str(m, S_IRGRP, 'r'); 02305 *p++ = rwx_to_str(m, S_IWGRP, 'w'); 02306 *p++ = rwx_to_str(m, S_IXGRP, 'x'); 02307 *p++ = rwx_to_str(m, S_IROTH, 'r'); 02308 *p++ = rwx_to_str(m, S_IWOTH, 'w'); 02309 *p++ = rwx_to_str(m, S_IXOTH, 'x'); 02310 *p++ = '\0'; 02311 return s; 02312 }
static char* perms_to_string | ( | fstring | permstr, | |
unsigned char | perms | |||
) | [static] |
参照元 cmd_getfacl().
02319 { 02320 fstrcpy(permstr, "---"); 02321 if (perms & SMB_POSIX_ACL_READ) { 02322 permstr[0] = 'r'; 02323 } 02324 if (perms & SMB_POSIX_ACL_WRITE) { 02325 permstr[1] = 'w'; 02326 } 02327 if (perms & SMB_POSIX_ACL_EXECUTE) { 02328 permstr[2] = 'x'; 02329 } 02330 return permstr; 02331 }
static int cmd_getfacl | ( | void | ) | [static] |
参照先 cli・cli_errstr()・cli_resolve_path()・cli_unix_extensions_version()・cli_unix_getfacl()・cli_unix_stat()・cur_dir・d_printf()・name・next_token_nr()・perms・perms_to_string().
02338 { 02339 pstring src, name; 02340 uint16 major, minor; 02341 uint32 caplow, caphigh; 02342 char *retbuf = NULL; 02343 size_t rb_size = 0; 02344 SMB_STRUCT_STAT sbuf; 02345 uint16 num_file_acls = 0; 02346 uint16 num_dir_acls = 0; 02347 uint16 i; 02348 struct cli_state *targetcli; 02349 pstring targetname; 02350 02351 pstrcpy(src,cur_dir); 02352 02353 if (!next_token_nr(NULL,name,NULL,sizeof(name))) { 02354 d_printf("stat file\n"); 02355 return 1; 02356 } 02357 02358 pstrcat(src,name); 02359 02360 if ( !cli_resolve_path( "", cli, src, &targetcli, targetname ) ) { 02361 d_printf("stat %s: %s\n", src, cli_errstr(cli)); 02362 return 1; 02363 } 02364 02365 if (!SERVER_HAS_UNIX_CIFS(targetcli)) { 02366 d_printf("Server doesn't support UNIX CIFS calls.\n"); 02367 return 1; 02368 } 02369 02370 if (!cli_unix_extensions_version(targetcli, &major, &minor, &caplow, &caphigh)) { 02371 d_printf("Can't get UNIX CIFS version from server.\n"); 02372 return 1; 02373 } 02374 02375 if (!(caplow & CIFS_UNIX_POSIX_ACLS_CAP)) { 02376 d_printf("This server supports UNIX extensions but doesn't support POSIX ACLs.\n"); 02377 return 1; 02378 } 02379 02380 if (!cli_unix_stat(targetcli, targetname, &sbuf)) { 02381 d_printf("%s getfacl doing a stat on file %s\n", 02382 cli_errstr(targetcli), src); 02383 return 1; 02384 } 02385 02386 if (!cli_unix_getfacl(targetcli, targetname, &rb_size, &retbuf)) { 02387 d_printf("%s getfacl file %s\n", 02388 cli_errstr(targetcli), src); 02389 return 1; 02390 } 02391 02392 /* ToDo : Print out the ACL values. */ 02393 if (SVAL(retbuf,0) != SMB_POSIX_ACL_VERSION || rb_size < 6) { 02394 d_printf("getfacl file %s, unknown POSIX acl version %u.\n", 02395 src, (unsigned int)CVAL(retbuf,0) ); 02396 SAFE_FREE(retbuf); 02397 return 1; 02398 } 02399 02400 num_file_acls = SVAL(retbuf,2); 02401 num_dir_acls = SVAL(retbuf,4); 02402 if (rb_size != SMB_POSIX_ACL_HEADER_SIZE + SMB_POSIX_ACL_ENTRY_SIZE*(num_file_acls+num_dir_acls)) { 02403 d_printf("getfacl file %s, incorrect POSIX acl buffer size (should be %u, was %u).\n", 02404 src, 02405 (unsigned int)(SMB_POSIX_ACL_HEADER_SIZE + SMB_POSIX_ACL_ENTRY_SIZE*(num_file_acls+num_dir_acls)), 02406 (unsigned int)rb_size); 02407 02408 SAFE_FREE(retbuf); 02409 return 1; 02410 } 02411 02412 d_printf("# file: %s\n", src); 02413 d_printf("# owner: %u\n# group: %u\n", (unsigned int)sbuf.st_uid, (unsigned int)sbuf.st_gid); 02414 02415 if (num_file_acls == 0 && num_dir_acls == 0) { 02416 d_printf("No acls found.\n"); 02417 } 02418 02419 for (i = 0; i < num_file_acls; i++) { 02420 uint32 uorg; 02421 fstring permstring; 02422 unsigned char tagtype = CVAL(retbuf, SMB_POSIX_ACL_HEADER_SIZE+(i*SMB_POSIX_ACL_ENTRY_SIZE)); 02423 unsigned char perms = CVAL(retbuf, SMB_POSIX_ACL_HEADER_SIZE+(i*SMB_POSIX_ACL_ENTRY_SIZE)+1); 02424 02425 switch(tagtype) { 02426 case SMB_POSIX_ACL_USER_OBJ: 02427 d_printf("user::"); 02428 break; 02429 case SMB_POSIX_ACL_USER: 02430 uorg = IVAL(retbuf,SMB_POSIX_ACL_HEADER_SIZE+(i*SMB_POSIX_ACL_ENTRY_SIZE)+2); 02431 d_printf("user:%u:", uorg); 02432 break; 02433 case SMB_POSIX_ACL_GROUP_OBJ: 02434 d_printf("group::"); 02435 break; 02436 case SMB_POSIX_ACL_GROUP: 02437 uorg = IVAL(retbuf,SMB_POSIX_ACL_HEADER_SIZE+(i*SMB_POSIX_ACL_ENTRY_SIZE)+2); 02438 d_printf("group:%u", uorg); 02439 break; 02440 case SMB_POSIX_ACL_MASK: 02441 d_printf("mask::"); 02442 break; 02443 case SMB_POSIX_ACL_OTHER: 02444 d_printf("other::"); 02445 break; 02446 default: 02447 d_printf("getfacl file %s, incorrect POSIX acl tagtype (%u).\n", 02448 src, (unsigned int)tagtype ); 02449 SAFE_FREE(retbuf); 02450 return 1; 02451 } 02452 02453 d_printf("%s\n", perms_to_string(permstring, perms)); 02454 } 02455 02456 for (i = 0; i < num_dir_acls; i++) { 02457 uint32 uorg; 02458 fstring permstring; 02459 unsigned char tagtype = CVAL(retbuf, SMB_POSIX_ACL_HEADER_SIZE+((i+num_file_acls)*SMB_POSIX_ACL_ENTRY_SIZE)); 02460 unsigned char perms = CVAL(retbuf, SMB_POSIX_ACL_HEADER_SIZE+((i+num_file_acls)*SMB_POSIX_ACL_ENTRY_SIZE)+1); 02461 02462 switch(tagtype) { 02463 case SMB_POSIX_ACL_USER_OBJ: 02464 d_printf("default:user::"); 02465 break; 02466 case SMB_POSIX_ACL_USER: 02467 uorg = IVAL(retbuf,SMB_POSIX_ACL_HEADER_SIZE+((i+num_file_acls)*SMB_POSIX_ACL_ENTRY_SIZE)+2); 02468 d_printf("default:user:%u:", uorg); 02469 break; 02470 case SMB_POSIX_ACL_GROUP_OBJ: 02471 d_printf("default:group::"); 02472 break; 02473 case SMB_POSIX_ACL_GROUP: 02474 uorg = IVAL(retbuf,SMB_POSIX_ACL_HEADER_SIZE+((i+num_file_acls)*SMB_POSIX_ACL_ENTRY_SIZE)+2); 02475 d_printf("default:group:%u", uorg); 02476 break; 02477 case SMB_POSIX_ACL_MASK: 02478 d_printf("default:mask::"); 02479 break; 02480 case SMB_POSIX_ACL_OTHER: 02481 d_printf("default:other::"); 02482 break; 02483 default: 02484 d_printf("getfacl file %s, incorrect POSIX acl tagtype (%u).\n", 02485 src, (unsigned int)tagtype ); 02486 SAFE_FREE(retbuf); 02487 return 1; 02488 } 02489 02490 d_printf("%s\n", perms_to_string(permstring, perms)); 02491 } 02492 02493 SAFE_FREE(retbuf); 02494 return 0; 02495 }
static int cmd_stat | ( | void | ) | [static] |
参照先 cli・cli_errstr()・cli_resolve_path()・cli_unix_stat()・cur_dir・d_printf()・filetype_to_str()・localtime()・name・next_token_nr()・unix_dev_major()・unix_dev_minor()・unix_mode_to_str().
02502 { 02503 pstring src, name; 02504 fstring mode_str; 02505 SMB_STRUCT_STAT sbuf; 02506 struct cli_state *targetcli; 02507 struct tm *lt; 02508 pstring targetname; 02509 02510 if (!SERVER_HAS_UNIX_CIFS(cli)) { 02511 d_printf("Server doesn't support UNIX CIFS calls.\n"); 02512 return 1; 02513 } 02514 02515 pstrcpy(src,cur_dir); 02516 02517 if (!next_token_nr(NULL,name,NULL,sizeof(name))) { 02518 d_printf("stat file\n"); 02519 return 1; 02520 } 02521 02522 pstrcat(src,name); 02523 02524 02525 if ( !cli_resolve_path( "", cli, src, &targetcli, targetname ) ) { 02526 d_printf("stat %s: %s\n", src, cli_errstr(cli)); 02527 return 1; 02528 } 02529 02530 if (!cli_unix_stat(targetcli, targetname, &sbuf)) { 02531 d_printf("%s stat file %s\n", 02532 cli_errstr(targetcli), src); 02533 return 1; 02534 } 02535 02536 /* Print out the stat values. */ 02537 d_printf("File: %s\n", src); 02538 d_printf("Size: %-12.0f\tBlocks: %u\t%s\n", 02539 (double)sbuf.st_size, 02540 (unsigned int)sbuf.st_blocks, 02541 filetype_to_str(sbuf.st_mode)); 02542 02543 #if defined(S_ISCHR) && defined(S_ISBLK) 02544 if (S_ISCHR(sbuf.st_mode) || S_ISBLK(sbuf.st_mode)) { 02545 d_printf("Inode: %.0f\tLinks: %u\tDevice type: %u,%u\n", 02546 (double)sbuf.st_ino, 02547 (unsigned int)sbuf.st_nlink, 02548 unix_dev_major(sbuf.st_rdev), 02549 unix_dev_minor(sbuf.st_rdev)); 02550 } else 02551 #endif 02552 d_printf("Inode: %.0f\tLinks: %u\n", 02553 (double)sbuf.st_ino, 02554 (unsigned int)sbuf.st_nlink); 02555 02556 d_printf("Access: (0%03o/%s)\tUid: %u\tGid: %u\n", 02557 ((int)sbuf.st_mode & 0777), 02558 unix_mode_to_str(mode_str, sbuf.st_mode), 02559 (unsigned int)sbuf.st_uid, 02560 (unsigned int)sbuf.st_gid); 02561 02562 lt = localtime(&sbuf.st_atime); 02563 if (lt) { 02564 strftime(mode_str, sizeof(mode_str), "%Y-%m-%d %T %z", lt); 02565 } else { 02566 fstrcpy(mode_str, "unknown"); 02567 } 02568 d_printf("Access: %s\n", mode_str); 02569 02570 lt = localtime(&sbuf.st_mtime); 02571 if (lt) { 02572 strftime(mode_str, sizeof(mode_str), "%Y-%m-%d %T %z", lt); 02573 } else { 02574 fstrcpy(mode_str, "unknown"); 02575 } 02576 d_printf("Modify: %s\n", mode_str); 02577 02578 lt = localtime(&sbuf.st_ctime); 02579 if (lt) { 02580 strftime(mode_str, sizeof(mode_str), "%Y-%m-%d %T %z", lt); 02581 } else { 02582 fstrcpy(mode_str, "unknown"); 02583 } 02584 d_printf("Change: %s\n", mode_str); 02585 02586 return 0; 02587 }
static int cmd_chown | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_resolve_path()・cli_unix_chown()・cur_dir・d_printf()・next_token_nr().
02595 { 02596 pstring src; 02597 uid_t uid; 02598 gid_t gid; 02599 pstring buf, buf2, buf3; 02600 struct cli_state *targetcli; 02601 pstring targetname; 02602 02603 pstrcpy(src,cur_dir); 02604 02605 if (!next_token_nr(NULL,buf,NULL,sizeof(buf)) || 02606 !next_token_nr(NULL,buf2,NULL, sizeof(buf2)) || 02607 !next_token_nr(NULL,buf3,NULL, sizeof(buf3))) { 02608 d_printf("chown uid gid file\n"); 02609 return 1; 02610 } 02611 02612 uid = (uid_t)atoi(buf); 02613 gid = (gid_t)atoi(buf2); 02614 pstrcat(src,buf3); 02615 02616 if ( !cli_resolve_path( "", cli, src, &targetcli, targetname ) ) { 02617 d_printf("chown %s: %s\n", src, cli_errstr(cli)); 02618 return 1; 02619 } 02620 02621 if (!SERVER_HAS_UNIX_CIFS(targetcli)) { 02622 d_printf("Server doesn't support UNIX CIFS calls.\n"); 02623 return 1; 02624 } 02625 02626 if (!cli_unix_chown(targetcli, targetname, uid, gid)) { 02627 d_printf("%s chown file %s uid=%d, gid=%d\n", 02628 cli_errstr(targetcli), src, (int)uid, (int)gid); 02629 return 1; 02630 } 02631 02632 return 0; 02633 }
static int cmd_rename | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_rename()・cli_resolve_path()・cur_dir・d_printf()・next_token_nr().
02640 { 02641 pstring src,dest; 02642 pstring buf,buf2; 02643 struct cli_state *targetcli; 02644 pstring targetsrc; 02645 pstring targetdest; 02646 02647 pstrcpy(src,cur_dir); 02648 pstrcpy(dest,cur_dir); 02649 02650 if (!next_token_nr(NULL,buf,NULL,sizeof(buf)) || 02651 !next_token_nr(NULL,buf2,NULL, sizeof(buf2))) { 02652 d_printf("rename <src> <dest>\n"); 02653 return 1; 02654 } 02655 02656 pstrcat(src,buf); 02657 pstrcat(dest,buf2); 02658 02659 if ( !cli_resolve_path( "", cli, src, &targetcli, targetsrc ) ) { 02660 d_printf("rename %s: %s\n", src, cli_errstr(cli)); 02661 return 1; 02662 } 02663 02664 if ( !cli_resolve_path( "", cli, dest, &targetcli, targetdest ) ) { 02665 d_printf("rename %s: %s\n", dest, cli_errstr(cli)); 02666 return 1; 02667 } 02668 02669 if (!cli_rename(targetcli, targetsrc, targetdest)) { 02670 d_printf("%s renaming files %s -> %s \n", 02671 cli_errstr(targetcli), 02672 targetsrc, 02673 targetdest); 02674 return 1; 02675 } 02676 02677 return 0; 02678 }
static int cmd_volume | ( | void | ) | [static] |
参照先 cli・cli_errstr()・cli_get_fs_volume_info()・d_printf().
02685 { 02686 fstring volname; 02687 uint32 serial_num; 02688 time_t create_date; 02689 02690 if (!cli_get_fs_volume_info(cli, volname, &serial_num, &create_date)) { 02691 d_printf("Errr %s getting volume info\n",cli_errstr(cli)); 02692 return 1; 02693 } 02694 02695 d_printf("Volume: |%s| serial number 0x%x\n", volname, (unsigned int)serial_num); 02696 return 0; 02697 }
static int cmd_hardlink | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_nt_hardlink()・cli_resolve_path()・cur_dir・d_printf()・next_token_nr().
02704 { 02705 pstring src,dest; 02706 pstring buf,buf2; 02707 struct cli_state *targetcli; 02708 pstring targetname; 02709 02710 pstrcpy(src,cur_dir); 02711 pstrcpy(dest,cur_dir); 02712 02713 if (!next_token_nr(NULL,buf,NULL,sizeof(buf)) || 02714 !next_token_nr(NULL,buf2,NULL, sizeof(buf2))) { 02715 d_printf("hardlink <src> <dest>\n"); 02716 return 1; 02717 } 02718 02719 pstrcat(src,buf); 02720 pstrcat(dest,buf2); 02721 02722 if ( !cli_resolve_path( "", cli, src, &targetcli, targetname ) ) { 02723 d_printf("hardlink %s: %s\n", src, cli_errstr(cli)); 02724 return 1; 02725 } 02726 02727 if (!SERVER_HAS_UNIX_CIFS(targetcli)) { 02728 d_printf("Server doesn't support UNIX CIFS calls.\n"); 02729 return 1; 02730 } 02731 02732 if (!cli_nt_hardlink(targetcli, targetname, dest)) { 02733 d_printf("%s doing an NT hard link of files\n",cli_errstr(targetcli)); 02734 return 1; 02735 } 02736 02737 return 0; 02738 }
static int cmd_prompt | ( | void | ) | [static] |
static int cmd_newer | ( | void | ) | [static] |
参照先 buf・d_printf()・newer_than・next_token_nr()・sys_stat()・time_to_asc().
02757 { 02758 pstring buf; 02759 BOOL ok; 02760 SMB_STRUCT_STAT sbuf; 02761 02762 ok = next_token_nr(NULL,buf,NULL,sizeof(buf)); 02763 if (ok && (sys_stat(buf,&sbuf) == 0)) { 02764 newer_than = sbuf.st_mtime; 02765 DEBUG(1,("Getting files newer than %s", 02766 time_to_asc(newer_than))); 02767 } else { 02768 newer_than = 0; 02769 } 02770 02771 if (ok && newer_than == 0) { 02772 d_printf("Error setting newer-than time\n"); 02773 return 1; 02774 } 02775 02776 return 0; 02777 }
static int cmd_archive | ( | void | ) | [static] |
参照先 archive_level・buf・d_printf()・next_token_nr().
02784 { 02785 pstring buf; 02786 02787 if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { 02788 archive_level = atoi(buf); 02789 } else 02790 d_printf("Archive level is %d\n",archive_level); 02791 02792 return 0; 02793 }
static int cmd_lowercase | ( | void | ) | [static] |
static int cmd_setcase | ( | void | ) | [static] |
参照先 cli・cli_set_case_sensitive().
02812 { 02813 BOOL orig_case_sensitive = cli_set_case_sensitive(cli, False); 02814 02815 cli_set_case_sensitive(cli, !orig_case_sensitive); 02816 DEBUG(2,("filename case sensitivity is now %s\n",!orig_case_sensitive ? 02817 "on":"off")); 02818 02819 return 0; 02820 }
static int cmd_showacls | ( | void | ) | [static] |
参照先 ctx・showacls・talloc_init().
02827 { 02828 showacls = !showacls; 02829 DEBUG(2,("showacls is now %s\n",showacls?"on":"off")); 02830 02831 if (!ctx && showacls) 02832 ctx = talloc_init("smbclient:showacls"); 02833 if (!ctx) { 02834 DEBUG( 0, ("cmd_showacls() out of memory. talloc_init() failed.\n")); 02835 } 02836 02837 return 0; 02838 }
static int cmd_recurse | ( | void | ) | [static] |
static int cmd_translate | ( | void | ) | [static] |
参照先 translation.
02858 { 02859 translation = !translation; 02860 DEBUG(2,("CR/LF<->LF and print text translation now %s\n", 02861 translation?"on":"off")); 02862 02863 return 0; 02864 }
static int cmd_lcd | ( | void | ) | [static] |
参照先 buf・next_token_nr()・sys_getwd().
02871 { 02872 pstring buf; 02873 pstring d; 02874 02875 if (next_token_nr(NULL,buf,NULL,sizeof(buf))) 02876 chdir(buf); 02877 DEBUG(2,("the local directory is now %s\n",sys_getwd(d))); 02878 02879 return 0; 02880 }
static int cmd_reget | ( | void | ) | [static] |
参照先 clean_name()・cur_dir・d_printf()・do_get()・next_token_nr().
02887 { 02888 pstring local_name; 02889 pstring remote_name; 02890 char *p; 02891 02892 pstrcpy(remote_name, cur_dir); 02893 02894 p = remote_name + strlen(remote_name); 02895 02896 if (!next_token_nr(NULL, p, NULL, sizeof(remote_name) - strlen(remote_name))) { 02897 d_printf("reget <filename>\n"); 02898 return 1; 02899 } 02900 pstrcpy(local_name, p); 02901 clean_name(remote_name); 02902 02903 next_token_nr(NULL, local_name, NULL, sizeof(local_name)); 02904 02905 return do_get(remote_name, local_name, True); 02906 }
static int cmd_reput | ( | void | ) | [static] |
参照先 buf・clean_name()・cur_dir・d_printf()・do_put()・file_exist()・next_token_nr().
02913 { 02914 pstring local_name; 02915 pstring remote_name; 02916 pstring buf; 02917 char *p = buf; 02918 SMB_STRUCT_STAT st; 02919 02920 pstrcpy(remote_name, cur_dir); 02921 02922 if (!next_token_nr(NULL, p, NULL, sizeof(buf))) { 02923 d_printf("reput <filename>\n"); 02924 return 1; 02925 } 02926 pstrcpy(local_name, p); 02927 02928 if (!file_exist(local_name, &st)) { 02929 d_printf("%s does not exist\n", local_name); 02930 return 1; 02931 } 02932 02933 if (next_token_nr(NULL, p, NULL, sizeof(buf))) 02934 pstrcat(remote_name, p); 02935 else 02936 pstrcat(remote_name, local_name); 02937 02938 clean_name(remote_name); 02939 02940 return do_put(remote_name, local_name, True); 02941 }
static void browse_fn | ( | const char * | name, | |
uint32 | m, | |||
const char * | comment, | |||
void * | state | |||
) | [static] |
参照先 d_printf()・grepable・STYPE_DEVICE・STYPE_DISKTREE・STYPE_IPC・STYPE_PRINTQ.
参照元 browse_host()・browse_host_rpc().
02949 { 02950 fstring typestr; 02951 02952 *typestr=0; 02953 02954 switch (m & 7) 02955 { 02956 case STYPE_DISKTREE: 02957 fstrcpy(typestr,"Disk"); break; 02958 case STYPE_PRINTQ: 02959 fstrcpy(typestr,"Printer"); break; 02960 case STYPE_DEVICE: 02961 fstrcpy(typestr,"Device"); break; 02962 case STYPE_IPC: 02963 fstrcpy(typestr,"IPC"); break; 02964 } 02965 /* FIXME: If the remote machine returns non-ascii characters 02966 in any of these fields, they can corrupt the output. We 02967 should remove them. */ 02968 if (!grepable) { 02969 d_printf("\t%-15s %-10.10s%s\n", 02970 name,typestr,comment); 02971 } else { 02972 d_printf ("%s|%s|%s\n",typestr,name,comment); 02973 } 02974 }
参照先 browse_fn()・cli・cli_rpc_pipe_close()・cli_rpc_pipe_open_noauth()・srv_share_info_ctr_info::info1・init_enum_hnd()・rpc_pipe_client::mem_ctx・name・nt_errstr()・srv_share_info_ctr_info::num_entries・rpccli_srvsvc_net_share_enum()・rpcstr_pull_unistr2_talloc()・srv_share_info_ctr_info::share・status.
参照元 browse_host().
02977 { 02978 NTSTATUS status; 02979 struct rpc_pipe_client *pipe_hnd; 02980 TALLOC_CTX *mem_ctx; 02981 ENUM_HND enum_hnd; 02982 WERROR werr; 02983 SRV_SHARE_INFO_CTR ctr; 02984 int i; 02985 02986 mem_ctx = talloc_new(NULL); 02987 if (mem_ctx == NULL) { 02988 DEBUG(0, ("talloc_new failed\n")); 02989 return False; 02990 } 02991 02992 init_enum_hnd(&enum_hnd, 0); 02993 02994 pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SRVSVC, &status); 02995 02996 if (pipe_hnd == NULL) { 02997 DEBUG(10, ("Could not connect to srvsvc pipe: %s\n", 02998 nt_errstr(status))); 02999 TALLOC_FREE(mem_ctx); 03000 return False; 03001 } 03002 03003 werr = rpccli_srvsvc_net_share_enum(pipe_hnd, mem_ctx, 1, &ctr, 03004 0xffffffff, &enum_hnd); 03005 03006 if (!W_ERROR_IS_OK(werr)) { 03007 TALLOC_FREE(mem_ctx); 03008 cli_rpc_pipe_close(pipe_hnd); 03009 return False; 03010 } 03011 03012 for (i=0; i<ctr.num_entries; i++) { 03013 SRV_SHARE_INFO_1 *info = &ctr.share.info1[i]; 03014 char *name, *comment; 03015 name = rpcstr_pull_unistr2_talloc( 03016 mem_ctx, &info->info_1_str.uni_netname); 03017 comment = rpcstr_pull_unistr2_talloc( 03018 mem_ctx, &info->info_1_str.uni_remark); 03019 browse_fn(name, info->info_1.type, comment, NULL); 03020 } 03021 03022 TALLOC_FREE(mem_ctx); 03023 cli_rpc_pipe_close(pipe_hnd); 03024 return True; 03025 }
参照先 browse_fn()・browse_host_rpc()・cli・cli_errstr()・cli_RNetShareEnum()・d_printf()・grepable.
参照元 do_host_query().
03032 { 03033 int ret; 03034 if (!grepable) { 03035 d_printf("\n\tSharename Type Comment\n"); 03036 d_printf("\t--------- ---- -------\n"); 03037 } 03038 03039 if (browse_host_rpc(sort)) { 03040 return True; 03041 } 03042 03043 if((ret = cli_RNetShareEnum(cli, browse_fn, NULL)) == -1) 03044 d_printf("Error returning browse list: %s\n", cli_errstr(cli)); 03045 03046 return (ret != -1); 03047 }
static void server_fn | ( | const char * | name, | |
uint32 | m, | |||
const char * | comment, | |||
void * | state | |||
) | [static] |
参照先 d_printf()・grepable.
参照元 list_servers().
03055 { 03056 03057 if (!grepable){ 03058 d_printf("\t%-16s %s\n", name, comment); 03059 } else { 03060 d_printf("%s|%s|%s\n",(char *)state, name, comment); 03061 } 03062 }
static BOOL list_servers | ( | const char * | wk_grp | ) | [static] |
参照先 cli・cli_NetServerEnum()・d_printf()・grepable・cli_state::server_domain・server_fn().
参照元 do_host_query().
03069 { 03070 fstring state; 03071 03072 if (!cli->server_domain) 03073 return False; 03074 03075 if (!grepable) { 03076 d_printf("\n\tServer Comment\n"); 03077 d_printf("\t--------- -------\n"); 03078 }; 03079 fstrcpy( state, "Server" ); 03080 cli_NetServerEnum(cli, cli->server_domain, SV_TYPE_ALL, server_fn, 03081 state); 03082 03083 if (!grepable) { 03084 d_printf("\n\tWorkgroup Master\n"); 03085 d_printf("\t--------- -------\n"); 03086 }; 03087 03088 fstrcpy( state, "Workgroup" ); 03089 cli_NetServerEnum(cli, cli->server_domain, SV_TYPE_DOMAIN_ENUM, 03090 server_fn, state); 03091 return True; 03092 }
static int cmd_vuid | ( | void | ) | [static] |
参照先 buf・cli・d_printf()・next_token_nr()・cli_state::vuid.
03099 { 03100 fstring buf; 03101 03102 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 03103 d_printf("Current VUID is %d\n", cli->vuid); 03104 return 0; 03105 } 03106 03107 cli->vuid = atoi(buf); 03108 return 0; 03109 }
static int cmd_logon | ( | void | ) | [static] |
参照先 buf・cli・cli_errstr()・cli_session_setup()・d_printf()・lp_workgroup()・next_token_nr()・cli_state::vuid.
03116 { 03117 pstring l_username, l_password; 03118 pstring buf,buf2; 03119 03120 if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { 03121 d_printf("logon <username> [<password>]\n"); 03122 return 0; 03123 } 03124 03125 pstrcpy(l_username, buf); 03126 03127 if (!next_token_nr(NULL,buf2,NULL,sizeof(buf))) 03128 { 03129 char *pass = getpass("Password: "); 03130 if (pass) 03131 pstrcpy(l_password, pass); 03132 } 03133 else 03134 pstrcpy(l_password, buf2); 03135 03136 if (!NT_STATUS_IS_OK(cli_session_setup(cli, l_username, 03137 l_password, strlen(l_password), 03138 l_password, strlen(l_password), 03139 lp_workgroup()))) { 03140 d_printf("session setup failed: %s\n", cli_errstr(cli)); 03141 return -1; 03142 } 03143 03144 d_printf("Current VUID is %d\n", cli->vuid); 03145 return 0; 03146 }
static int cmd_list_connect | ( | void | ) | [static] |
static int cmd_show_connect | ( | void | ) | [static] |
参照先 cli・cli_errstr()・cli_resolve_path()・cur_dir・d_printf()・cli_state::desthost・cli_state::share.
03165 { 03166 struct cli_state *targetcli; 03167 pstring targetpath; 03168 03169 if ( !cli_resolve_path( "", cli, cur_dir, &targetcli, targetpath ) ) { 03170 d_printf("showconnect %s: %s\n", cur_dir, cli_errstr(cli)); 03171 return 1; 03172 } 03173 03174 d_printf("//%s/%s\n", targetcli->desthost, targetcli->share); 03175 return 0; 03176 }
static int process_command_string | ( | char * | cmd | ) | [static] |
参照先 cli・cli_cm_open()・d_printf()・desthost・line・next_token_nr()・process_tok()・strchr_m().
03327 { 03328 pstring line; 03329 const char *ptr; 03330 int rc = 0; 03331 03332 /* establish the connection if not already */ 03333 03334 if (!cli) { 03335 cli = cli_cm_open(desthost, service, True); 03336 if (!cli) 03337 return 0; 03338 } 03339 03340 while (cmd[0] != '\0') { 03341 char *p; 03342 pstring tok; 03343 int i; 03344 03345 if ((p = strchr_m(cmd, ';')) == 0) { 03346 strncpy(line, cmd, 999); 03347 line[1000] = '\0'; 03348 cmd += strlen(cmd); 03349 } else { 03350 if (p - cmd > 999) 03351 p = cmd + 999; 03352 strncpy(line, cmd, p - cmd); 03353 line[p - cmd] = '\0'; 03354 cmd = p + 1; 03355 } 03356 03357 /* and get the first part of the command */ 03358 ptr = line; 03359 if (!next_token_nr(&ptr,tok,NULL,sizeof(tok))) continue; 03360 03361 if ((i = process_tok(tok)) >= 0) { 03362 rc = commands[i].fn(); 03363 } else if (i == -2) { 03364 d_printf("%s: command abbreviation ambiguous\n",tok); 03365 } else { 03366 d_printf("%s: command not found\n",tok); 03367 } 03368 } 03369 03370 return rc; 03371 }
static void completion_remote_filter | ( | const char * | mnt, | |
file_info * | f, | |||
const char * | mask, | |||
void * | state | |||
) | [static] |
参照先 completion_remote_t::count・completion_remote_t::dirmask・completion_remote_t::len・completion_remote_t::matches・file_info::mode・file_info::name・completion_remote_t::samelen・smb_readline_ca_char()・completion_remote_t::text.
参照元 remote_completion().
03384 { 03385 completion_remote_t *info = (completion_remote_t *)state; 03386 03387 if ((info->count < MAX_COMPLETIONS - 1) && (strncmp(info->text, f->name, info->len) == 0) && (strcmp(f->name, ".") != 0) && (strcmp(f->name, "..") != 0)) { 03388 if ((info->dirmask[0] == 0) && !(f->mode & aDIR)) 03389 info->matches[info->count] = SMB_STRDUP(f->name); 03390 else { 03391 pstring tmp; 03392 03393 if (info->dirmask[0] != 0) 03394 pstrcpy(tmp, info->dirmask); 03395 else 03396 tmp[0] = 0; 03397 pstrcat(tmp, f->name); 03398 if (f->mode & aDIR) 03399 pstrcat(tmp, "/"); 03400 info->matches[info->count] = SMB_STRDUP(tmp); 03401 } 03402 if (info->matches[info->count] == NULL) 03403 return; 03404 if (f->mode & aDIR) 03405 smb_readline_ca_char(0); 03406 03407 if (info->count == 1) 03408 info->samelen = strlen(info->matches[info->count]); 03409 else 03410 while (strncmp(info->matches[info->count], info->matches[info->count-1], info->samelen) != 0) 03411 info->samelen--; 03412 info->count++; 03413 } 03414 }
static char** remote_completion | ( | const char * | text, | |
int | len | |||
) | [static] |
参照先 cleanup()・cli・CLI_DIRSEP_CHAR・cli_list()・completion_remote_filter()・completion_remote_t::count・cur_dir・completion_remote_t::dirmask・completion_remote_t::len・completion_remote_t::matches・pstr_sprintf()・completion_remote_t::samelen・completion_remote_t::text.
参照元 completion_fn().
03417 { 03418 pstring dirmask; 03419 int i; 03420 completion_remote_t info = { "", NULL, 1, 0, NULL, 0 }; 03421 03422 /* can't have non-static intialisation on Sun CC, so do it 03423 at run time here */ 03424 info.samelen = len; 03425 info.text = text; 03426 info.len = len; 03427 03428 if (len >= MIN(PATH_MAX,sizeof(pstring))) { 03429 return(NULL); 03430 } 03431 03432 info.matches = SMB_MALLOC_ARRAY(char *,MAX_COMPLETIONS); 03433 if (!info.matches) { 03434 return NULL; 03435 } 03436 03437 /* 03438 * We're leaving matches[0] free to fill it later with the text to 03439 * display: Either the one single match or the longest common subset 03440 * of the matches. 03441 */ 03442 info.matches[0] = NULL; 03443 info.count = 1; 03444 03445 for (i = len-1; i >= 0; i--) { 03446 if ((text[i] == '/') || (text[i] == CLI_DIRSEP_CHAR)) { 03447 break; 03448 } 03449 } 03450 03451 info.text = text+i+1; 03452 info.samelen = info.len = len-i-1; 03453 03454 if (i > 0) { 03455 strncpy(info.dirmask, text, i+1); 03456 info.dirmask[i+1] = 0; 03457 pstr_sprintf(dirmask, "%s%*s*", cur_dir, i-1, text); 03458 } else { 03459 pstr_sprintf(dirmask, "%s*", cur_dir); 03460 } 03461 03462 if (cli_list(cli, dirmask, aDIR | aSYSTEM | aHIDDEN, completion_remote_filter, &info) < 0) 03463 goto cleanup; 03464 03465 if (info.count == 1) { 03466 03467 /* 03468 * No matches at all, NULL indicates there is nothing 03469 */ 03470 03471 SAFE_FREE(info.matches[0]); 03472 SAFE_FREE(info.matches); 03473 return NULL; 03474 } 03475 03476 if (info.count == 2) { 03477 03478 /* 03479 * Exactly one match in matches[1], indicate this is the one 03480 * in matches[0]. 03481 */ 03482 03483 info.matches[0] = info.matches[1]; 03484 info.matches[1] = NULL; 03485 info.count -= 1; 03486 return info.matches; 03487 } 03488 03489 /* 03490 * We got more than one possible match, set the result to the maximum 03491 * common subset 03492 */ 03493 03494 info.matches[0] = SMB_STRNDUP(info.matches[1], info.samelen); 03495 info.matches[info.count] = NULL; 03496 return info.matches; 03497 03498 cleanup: 03499 for (i = 0; i < info.count; i++) 03500 free(info.matches[i]); 03501 free(info.matches); 03502 return NULL; 03503 }
static char** completion_fn | ( | const char * | text, | |
int | start, | |||
int | end | |||
) | [static] |
参照先 buf・cleanup()・compl_args・len・name・remote_completion()・smb_readline_ca_char()・smb_readline_get_line_buffer().
参照元 main()・net_rpc_shell()・process_stdin().
03506 { 03507 smb_readline_ca_char(' '); 03508 03509 if (start) { 03510 const char *buf, *sp; 03511 int i; 03512 char compl_type; 03513 03514 buf = smb_readline_get_line_buffer(); 03515 if (buf == NULL) 03516 return NULL; 03517 03518 sp = strchr(buf, ' '); 03519 if (sp == NULL) 03520 return NULL; 03521 03522 for (i = 0; commands[i].name; i++) { 03523 if ((strncmp(commands[i].name, buf, sp - buf) == 0) && 03524 (commands[i].name[sp - buf] == 0)) { 03525 break; 03526 } 03527 } 03528 if (commands[i].name == NULL) 03529 return NULL; 03530 03531 while (*sp == ' ') 03532 sp++; 03533 03534 if (sp == (buf + start)) 03535 compl_type = commands[i].compl_args[0]; 03536 else 03537 compl_type = commands[i].compl_args[1]; 03538 03539 if (compl_type == COMPL_REMOTE) 03540 return remote_completion(text, end - start); 03541 else /* fall back to local filename completion */ 03542 return NULL; 03543 } else { 03544 char **matches; 03545 int i, len, samelen = 0, count=1; 03546 03547 matches = SMB_MALLOC_ARRAY(char *, MAX_COMPLETIONS); 03548 if (!matches) { 03549 return NULL; 03550 } 03551 matches[0] = NULL; 03552 03553 len = strlen(text); 03554 for (i=0;commands[i].fn && count < MAX_COMPLETIONS-1;i++) { 03555 if (strncmp(text, commands[i].name, len) == 0) { 03556 matches[count] = SMB_STRDUP(commands[i].name); 03557 if (!matches[count]) 03558 goto cleanup; 03559 if (count == 1) 03560 samelen = strlen(matches[count]); 03561 else 03562 while (strncmp(matches[count], matches[count-1], samelen) != 0) 03563 samelen--; 03564 count++; 03565 } 03566 } 03567 03568 switch (count) { 03569 case 0: /* should never happen */ 03570 case 1: 03571 goto cleanup; 03572 case 2: 03573 matches[0] = SMB_STRDUP(matches[1]); 03574 break; 03575 default: 03576 matches[0] = (char *)SMB_MALLOC(samelen+1); 03577 if (!matches[0]) 03578 goto cleanup; 03579 strncpy(matches[0], matches[1], samelen); 03580 matches[0][samelen] = 0; 03581 } 03582 matches[count] = NULL; 03583 return matches; 03584 03585 cleanup: 03586 for (i = 0; i < count; i++) 03587 free(matches[i]); 03588 03589 free(matches); 03590 return NULL; 03591 } 03592 }
static void readline_callback | ( | void | ) | [static] |
参照先 cli_state::bufsize・cli・cli_echo()・cli_state::fd・cli_state::inbuf・receive_smb()・sys_select_intr()・t.
参照元 process_stdin().
03599 { 03600 fd_set fds; 03601 struct timeval timeout; 03602 static time_t last_t; 03603 time_t t; 03604 03605 t = time(NULL); 03606 03607 if (t - last_t < 5) 03608 return; 03609 03610 last_t = t; 03611 03612 again: 03613 03614 if (cli->fd == -1) 03615 return; 03616 03617 FD_ZERO(&fds); 03618 FD_SET(cli->fd,&fds); 03619 03620 timeout.tv_sec = 0; 03621 timeout.tv_usec = 0; 03622 sys_select_intr(cli->fd+1,&fds,NULL,NULL,&timeout); 03623 03624 /* We deliberately use receive_smb instead of 03625 client_receive_smb as we want to receive 03626 session keepalives and then drop them here. 03627 */ 03628 if (FD_ISSET(cli->fd,&fds)) { 03629 if (!receive_smb(cli->fd,cli->inbuf,cli->bufsize,0)) { 03630 DEBUG(0, ("Read from server failed, maybe it closed the " 03631 "connection\n")); 03632 return; 03633 } 03634 goto again; 03635 } 03636 03637 /* Ping the server to keep the connection alive using SMBecho. */ 03638 { 03639 unsigned char garbage[16]; 03640 memset(garbage, 0xf0, sizeof(garbage)); 03641 cli_echo(cli, garbage, sizeof(garbage)); 03642 } 03643 }
static int process_stdin | ( | void | ) | [static] |
参照先 completion_fn()・cur_dir・d_printf()・line・next_token_nr()・process_tok()・readline_callback()・smb_readline().
参照元 process().
03650 { 03651 const char *ptr; 03652 int rc = 0; 03653 03654 while (1) { 03655 pstring tok; 03656 pstring the_prompt; 03657 char *cline; 03658 pstring line; 03659 int i; 03660 03661 /* display a prompt */ 03662 slprintf(the_prompt, sizeof(the_prompt)-1, "smb: %s> ", cur_dir); 03663 cline = smb_readline(the_prompt, readline_callback, completion_fn); 03664 03665 if (!cline) break; 03666 03667 pstrcpy(line, cline); 03668 03669 /* special case - first char is ! */ 03670 if (*line == '!') { 03671 system(line + 1); 03672 continue; 03673 } 03674 03675 /* and get the first part of the command */ 03676 ptr = line; 03677 if (!next_token_nr(&ptr,tok,NULL,sizeof(tok))) continue; 03678 03679 if ((i = process_tok(tok)) >= 0) { 03680 rc = commands[i].fn(); 03681 } else if (i == -2) { 03682 d_printf("%s: command abbreviation ambiguous\n",tok); 03683 } else { 03684 d_printf("%s: command not found\n",tok); 03685 } 03686 } 03687 return rc; 03688 }
static int process | ( | char * | base_directory | ) | [static] |
参照先 cli・cli_cm_open()・cli_cm_shutdown()・cmdstr・desthost・do_cd()・process_command_string()・process_stdin().
参照元 main().
03695 { 03696 int rc = 0; 03697 03698 cli = cli_cm_open(desthost, service, True); 03699 if (!cli) { 03700 return 1; 03701 } 03702 03703 if (*base_directory) { 03704 rc = do_cd(base_directory); 03705 if (rc) { 03706 cli_cm_shutdown(); 03707 return rc; 03708 } 03709 } 03710 03711 if (cmdstr) { 03712 rc = process_command_string(cmdstr); 03713 } else { 03714 process_stdin(); 03715 } 03716 03717 cli_cm_shutdown(); 03718 return rc; 03719 }
static int do_host_query | ( | char * | query_host | ) | [static] |
参照先 browse_host()・cli・cli_cm_open()・cli_cm_set_port()・cli_cm_shutdown()・d_printf()・list_servers()・lp_workgroup()・port.
参照元 main().
03726 { 03727 cli = cli_cm_open(query_host, "IPC$", True); 03728 if (!cli) 03729 return 1; 03730 03731 browse_host(True); 03732 03733 if (port != 139) { 03734 03735 /* Workgroups simply don't make sense over anything 03736 else but port 139... */ 03737 03738 cli_cm_shutdown(); 03739 port = 139; 03740 cli_cm_set_port( 139 ); 03741 cli = cli_cm_open(query_host, "IPC$", True); 03742 } 03743 03744 if (cli == NULL) { 03745 d_printf("NetBIOS over TCP disabled -- no workgroup available\n"); 03746 return 1; 03747 } 03748 03749 list_servers(lp_workgroup()); 03750 03751 cli_cm_shutdown(); 03752 03753 return(0); 03754 }
static int do_tar_op | ( | char * | base_directory | ) | [static] |
参照先 cli・cli_cm_open()・cli_cm_shutdown()・desthost・do_cd()・recurse.
参照元 main().
03761 { 03762 int ret; 03763 03764 /* do we already have a connection? */ 03765 if (!cli) { 03766 cli = cli_cm_open(desthost, service, True); 03767 if (!cli) 03768 return 1; 03769 } 03770 03771 recurse=True; 03772 03773 if (*base_directory) { 03774 ret = do_cd(base_directory); 03775 if (ret) { 03776 cli_cm_shutdown(); 03777 return ret; 03778 } 03779 } 03780 03781 ret=process_tar(); 03782 03783 cli_cm_shutdown(); 03784 03785 return(ret); 03786 }
static int do_message_op | ( | void | ) | [static] |
参照先 calling_name・cli・cli_cm_shutdown()・cli_connect()・cli_initialise()・cli_session_request()・cli_set_port()・d_printf()・dest_ip・desthost・have_ip・make_nmb_name()・name_type・nt_errstr()・port・send_message()・snprintf()・status・zero_ip().
参照元 main().
03793 { 03794 struct in_addr ip; 03795 struct nmb_name called, calling; 03796 fstring server_name; 03797 char name_type_hex[10]; 03798 int msg_port; 03799 NTSTATUS status; 03800 03801 make_nmb_name(&calling, calling_name, 0x0); 03802 make_nmb_name(&called , desthost, name_type); 03803 03804 fstrcpy(server_name, desthost); 03805 snprintf(name_type_hex, sizeof(name_type_hex), "#%X", name_type); 03806 fstrcat(server_name, name_type_hex); 03807 03808 zero_ip(&ip); 03809 if (have_ip) 03810 ip = dest_ip; 03811 03812 /* we can only do messages over port 139 (to windows clients at least) */ 03813 03814 msg_port = port ? port : 139; 03815 03816 if (!(cli=cli_initialise()) || (cli_set_port(cli, msg_port) != msg_port)) { 03817 d_printf("Connection to %s failed\n", desthost); 03818 return 1; 03819 } 03820 03821 status = cli_connect(cli, server_name, &ip); 03822 if (!NT_STATUS_IS_OK(status)) { 03823 d_printf("Connection to %s failed. Error %s\n", desthost, nt_errstr(status)); 03824 return 1; 03825 } 03826 03827 if (!cli_session_request(cli, &calling, &called)) { 03828 d_printf("session request failed\n"); 03829 cli_cm_shutdown(); 03830 return 1; 03831 } 03832 03833 send_message(); 03834 cli_cm_shutdown(); 03835 03836 return 0; 03837 }
int main | ( | int | argc, | |
char * | argv[] | |||
) |
参照先 AllowDebugChange・calling_name・cli_cm_set_credentials()・cli_cm_set_dest_ip()・cli_cm_set_dest_name_type()・cli_cm_set_port()・cmdline_auth_info・cmdstr・count_chars()・ctx・d_printf()・dbf・DEBUGLEVEL_CLASS・dest_ip・desthost・display_set_stderr()・do_host_query()・do_message_op()・do_tar_op()・dyn_CONFIGFILE・fprintf()・global_myname・user_auth_info::got_pass・grepable・have_ip・in_client・init_names()・interpret_addr2()・interpret_protocol()・io_bufsize・is_zero_ip()・len・load_case_tables()・load_interfaces()・lp_workgroup()・max_protocol・message・name_type・override_logfile・user_auth_info::password・poptFreeContext()・poptGetArg()・poptGetContext()・poptGetNextOpt()・poptGetOptArg()・poptPeekArg()・poptPrintUsage()・poptSetOtherOptionHelp()・port・process()・process_command_string()・set_global_myname()・set_global_myworkgroup()・setup_logging()・strchr_m()・string_replace()・tar_type・user_auth_info::username・username・x_fclose()・x_fdup()・x_setbuf()・x_stderr.
03845 { 03846 pstring base_directory; 03847 int len = 0; 03848 int opt; 03849 pstring query_host; 03850 BOOL message = False; 03851 pstring term_code; 03852 static const char *new_name_resolve_order = NULL; 03853 poptContext pc; 03854 char *p; 03855 int rc = 0; 03856 fstring new_workgroup; 03857 BOOL tar_opt = False; 03858 BOOL service_opt = False; 03859 struct poptOption long_options[] = { 03860 POPT_AUTOHELP 03861 03862 { "name-resolve", 'R', POPT_ARG_STRING, &new_name_resolve_order, 'R', "Use these name resolution services only", "NAME-RESOLVE-ORDER" }, 03863 { "message", 'M', POPT_ARG_STRING, NULL, 'M', "Send message", "HOST" }, 03864 { "ip-address", 'I', POPT_ARG_STRING, NULL, 'I', "Use this IP to connect to", "IP" }, 03865 { "stderr", 'E', POPT_ARG_NONE, NULL, 'E', "Write messages to stderr instead of stdout" }, 03866 { "list", 'L', POPT_ARG_STRING, NULL, 'L', "Get a list of shares available on a host", "HOST" }, 03867 { "terminal", 't', POPT_ARG_STRING, NULL, 't', "Terminal I/O code {sjis|euc|jis7|jis8|junet|hex}", "CODE" }, 03868 { "max-protocol", 'm', POPT_ARG_STRING, NULL, 'm', "Set the max protocol level", "LEVEL" }, 03869 { "tar", 'T', POPT_ARG_STRING, NULL, 'T', "Command line tar", "<c|x>IXFqgbNan" }, 03870 { "directory", 'D', POPT_ARG_STRING, NULL, 'D', "Start from directory", "DIR" }, 03871 { "command", 'c', POPT_ARG_STRING, &cmdstr, 'c', "Execute semicolon separated commands" }, 03872 { "send-buffer", 'b', POPT_ARG_INT, &io_bufsize, 'b', "Changes the transmit/send buffer", "BYTES" }, 03873 { "port", 'p', POPT_ARG_INT, &port, 'p', "Port to connect to", "PORT" }, 03874 { "grepable", 'g', POPT_ARG_NONE, NULL, 'g', "Produce grepable output" }, 03875 POPT_COMMON_SAMBA 03876 POPT_COMMON_CONNECTION 03877 POPT_COMMON_CREDENTIALS 03878 POPT_TABLEEND 03879 }; 03880 03881 load_case_tables(); 03882 03883 #ifdef KANJI 03884 pstrcpy(term_code, KANJI); 03885 #else /* KANJI */ 03886 *term_code = 0; 03887 #endif /* KANJI */ 03888 03889 *query_host = 0; 03890 *base_directory = 0; 03891 03892 /* initialize the workgroup name so we can determine whether or 03893 not it was set by a command line option */ 03894 03895 set_global_myworkgroup( "" ); 03896 set_global_myname( "" ); 03897 03898 /* set default debug level to 1 regardless of what smb.conf sets */ 03899 setup_logging( "smbclient", True ); 03900 DEBUGLEVEL_CLASS[DBGC_ALL] = 1; 03901 if ((dbf = x_fdup(x_stderr))) { 03902 x_setbuf( dbf, NULL ); 03903 } 03904 03905 /* skip argv(0) */ 03906 pc = poptGetContext("smbclient", argc, (const char **) argv, long_options, 0); 03907 poptSetOtherOptionHelp(pc, "service <password>"); 03908 03909 in_client = True; /* Make sure that we tell lp_load we are */ 03910 03911 while ((opt = poptGetNextOpt(pc)) != -1) { 03912 03913 /* if the tar option has been called previouslt, now we need to eat out the leftovers */ 03914 /* I see no other way to keep things sane --SSS */ 03915 if (tar_opt == True) { 03916 while (poptPeekArg(pc)) { 03917 poptGetArg(pc); 03918 } 03919 tar_opt = False; 03920 } 03921 03922 /* if the service has not yet been specified lets see if it is available in the popt stack */ 03923 if (!service_opt && poptPeekArg(pc)) { 03924 pstrcpy(service, poptGetArg(pc)); 03925 service_opt = True; 03926 } 03927 03928 /* if the service has already been retrieved then check if we have also a password */ 03929 if (service_opt && (!cmdline_auth_info.got_pass) && poptPeekArg(pc)) { 03930 pstrcpy(cmdline_auth_info.password, poptGetArg(pc)); 03931 cmdline_auth_info.got_pass = True; 03932 } 03933 03934 switch (opt) { 03935 case 'M': 03936 /* Messages are sent to NetBIOS name type 0x3 03937 * (Messenger Service). Make sure we default 03938 * to port 139 instead of port 445. srl,crh 03939 */ 03940 name_type = 0x03; 03941 cli_cm_set_dest_name_type( name_type ); 03942 pstrcpy(desthost,poptGetOptArg(pc)); 03943 if ( port != 139 ) 03944 port = 139; 03945 cli_cm_set_port ( 138); 03946 message = True; 03947 break; 03948 case 'I': 03949 { 03950 dest_ip = *interpret_addr2(poptGetOptArg(pc)); 03951 if (is_zero_ip(dest_ip)) 03952 exit(1); 03953 have_ip = True; 03954 03955 cli_cm_set_dest_ip( dest_ip ); 03956 } 03957 break; 03958 case 'E': 03959 if (dbf) { 03960 x_fclose(dbf); 03961 } 03962 dbf = x_stderr; 03963 display_set_stderr(); 03964 break; 03965 03966 case 'L': 03967 pstrcpy(query_host, poptGetOptArg(pc)); 03968 break; 03969 case 't': 03970 pstrcpy(term_code, poptGetOptArg(pc)); 03971 break; 03972 case 'm': 03973 max_protocol = interpret_protocol(poptGetOptArg(pc), max_protocol); 03974 break; 03975 case 'T': 03976 /* We must use old option processing for this. Find the 03977 * position of the -T option in the raw argv[]. */ 03978 { 03979 int i; 03980 for (i = 1; i < argc; i++) { 03981 if (strncmp("-T", argv[i],2)==0) 03982 break; 03983 } 03984 i++; 03985 if (!tar_parseargs(argc, argv, poptGetOptArg(pc), i)) { 03986 poptPrintUsage(pc, stderr, 0); 03987 exit(1); 03988 } 03989 } 03990 /* this must be the last option, mark we have parsed it so that we know we have */ 03991 tar_opt = True; 03992 break; 03993 case 'D': 03994 pstrcpy(base_directory,poptGetOptArg(pc)); 03995 break; 03996 case 'g': 03997 grepable=True; 03998 break; 03999 } 04000 } 04001 04002 /* We may still have some leftovers after the last popt option has been called */ 04003 if (tar_opt == True) { 04004 while (poptPeekArg(pc)) { 04005 poptGetArg(pc); 04006 } 04007 tar_opt = False; 04008 } 04009 04010 /* if the service has not yet been specified lets see if it is available in the popt stack */ 04011 if (!service_opt && poptPeekArg(pc)) { 04012 pstrcpy(service, poptGetArg(pc)); 04013 service_opt = True; 04014 } 04015 04016 /* if the service has already been retrieved then check if we have also a password */ 04017 if (service_opt && (!cmdline_auth_info.got_pass) && poptPeekArg(pc)) { 04018 pstrcpy(cmdline_auth_info.password, poptGetArg(pc)); 04019 cmdline_auth_info.got_pass = True; 04020 } 04021 04022 /* check for the -P option */ 04023 04024 if ( port != 0 ) 04025 cli_cm_set_port( port ); 04026 04027 /* 04028 * Don't load debug level from smb.conf. It should be 04029 * set by cmdline arg or remain default (0) 04030 */ 04031 AllowDebugChange = False; 04032 04033 /* save the workgroup... 04034 04035 FIXME!! do we need to do this for other options as well 04036 (or maybe a generic way to keep lp_load() from overwriting 04037 everything)? */ 04038 04039 fstrcpy( new_workgroup, lp_workgroup() ); 04040 pstrcpy( calling_name, global_myname() ); 04041 04042 if ( override_logfile ) 04043 setup_logging( lp_logfile(), False ); 04044 04045 if (!lp_load(dyn_CONFIGFILE,True,False,False,True)) { 04046 fprintf(stderr, "%s: Can't load %s - run testparm to debug it\n", 04047 argv[0], dyn_CONFIGFILE); 04048 } 04049 04050 load_interfaces(); 04051 04052 if (service_opt) { 04053 /* Convert any '/' characters in the service name to '\' characters */ 04054 string_replace(service, '/','\\'); 04055 if (count_chars(service,'\\') < 3) { 04056 d_printf("\n%s: Not enough '\\' characters in service\n",service); 04057 poptPrintUsage(pc, stderr, 0); 04058 exit(1); 04059 } 04060 /* Remove trailing slashes */ 04061 len = strlen(service); 04062 while(len > 0 && service[len - 1] == '\\') { 04063 --len; 04064 service[len] = '\0'; 04065 } 04066 } 04067 04068 if ( strlen(new_workgroup) != 0 ) 04069 set_global_myworkgroup( new_workgroup ); 04070 04071 if ( strlen(calling_name) != 0 ) 04072 set_global_myname( calling_name ); 04073 else 04074 pstrcpy( calling_name, global_myname() ); 04075 04076 init_names(); 04077 04078 if(new_name_resolve_order) 04079 lp_set_name_resolve_order(new_name_resolve_order); 04080 04081 if (!tar_type && !*query_host && !*service && !message) { 04082 poptPrintUsage(pc, stderr, 0); 04083 exit(1); 04084 } 04085 04086 poptFreeContext(pc); 04087 04088 /* store the username an password for dfs support */ 04089 04090 cli_cm_set_credentials( &cmdline_auth_info ); 04091 pstrcpy(username, cmdline_auth_info.username); 04092 04093 DEBUG(3,("Client started (version %s).\n", SAMBA_VERSION_STRING)); 04094 04095 if (tar_type) { 04096 if (cmdstr) 04097 process_command_string(cmdstr); 04098 return do_tar_op(base_directory); 04099 } 04100 04101 if (*query_host) { 04102 char *qhost = query_host; 04103 char *slash; 04104 04105 while (*qhost == '\\' || *qhost == '/') 04106 qhost++; 04107 04108 if ((slash = strchr_m(qhost, '/')) 04109 || (slash = strchr_m(qhost, '\\'))) { 04110 *slash = 0; 04111 } 04112 04113 if ((p=strchr_m(qhost, '#'))) { 04114 *p = 0; 04115 p++; 04116 sscanf(p, "%x", &name_type); 04117 cli_cm_set_dest_name_type( name_type ); 04118 } 04119 04120 return do_host_query(qhost); 04121 } 04122 04123 if (message) { 04124 return do_message_op(); 04125 } 04126 04127 if (process(base_directory)) { 04128 return 1; 04129 } 04130 04131 talloc_destroy( ctx); 04132 return rc; 04133 }
char tar_type |
int port = 0 [static] |
参照元 cli_cm_set_port()・cli_connect()・cli_session_request()・cups_connect()・do_connect()・do_host_query()・do_message_op()・fill_port_1()・fill_port_2()・get_dc_list()・internal_resolve_name()・ipstr_list_parse()・main()・namecache_store()・open_sockets_smbd()・print_ldap_srvlist()・smb_krb5_locator_lookup()・smb_ldap_setup_conn()・swrap_auto_bind().
参照元 cmd_altname()・cmd_cd()・cmd_chmod()・cmd_chown()・cmd_del()・cmd_dir()・cmd_du()・cmd_get()・cmd_getfacl()・cmd_hardlink()・cmd_link()・cmd_mget()・cmd_mkdir()・cmd_more()・cmd_mput()・cmd_open()・cmd_posix()・cmd_posix_mkdir()・cmd_posix_open()・cmd_posix_rmdir()・cmd_posix_unlink()・cmd_put()・cmd_pwd()・cmd_reget()・cmd_rename()・cmd_reput()・cmd_rmdir()・cmd_show_connect()・cmd_stat()・cmd_symlink()・cmd_wdel()・do_cd()・do_del()・do_dskattr()・do_mget()・process_stdin()・remote_completion()・scan_directory()・tool_list()・writetarheader().
参照元 _lsa_unk_get_connuser()・_srv_net_sess_del()・api_RNetSessionEnum()・change_oem_password()・cli_cm_set_credentials()・cli_NetGroupGetUsers()・cli_NetSessionEnum()・cli_NetSessionGetInfo()・cli_RNetUserEnum()・cli_RNetUserEnum0()・cmd_netlogon_sam_logon()・connect_one()・decode_pac_data()・display_job_info_1()・display_job_info_2()・do_connect()・do_connection()・fetch_account_info_to_ldif()・fill_grent_mem()・get_auth_data()・get_auth_data_fn()・getpwsid_queryuser_recv()・getusername()・init_buffer_from_sam_v3()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・init_srv_sess_info_1()・ldapsam_add_sam_account()・ldapsam_create_user()・main()・make_server_info_sam()・manage_ntlm_change_password_1_request()・manage_ntlm_server_1_request()・open_pipe_creds()・pam_sm_acct_mgmt()・pam_sm_authenticate()・parse_mount_smb()・pdb_default_delete_user()・pdb_default_enum_group_memberships()・pdb_nds_update_login_attempts()・py_auth_crap()・py_auth_plaintext()・py_auth_smbd()・py_getpwnam()・py_smb_session_setup()・query_user_list()・read_credentials_file()・rpc_file_list_internals()・rpc_sh_user_flag_edit_internals()・rpc_sh_user_str_edit_internals()・run_sesssetup_bench()・run_tcon_devtype_test()・sam_password_ok()・send_message()・smb_getpwnam()・smbc_parse_path()・torture_cli_session_setup2()・torture_open_connection_share()・winbindd_getpwnam().
pstring calling_name [static] |
int io_bufsize = 64512 [static] |
int name_type = 0x20 [static] |
参照元 add_dns_result()・cli_cm_set_dest_name_type()・cli_connect()・do_connect()・do_message_op()・domain_master_node_status_success()・get_domain_master_name_node_status_success()・getgrgid_got_sid()・getgrgid_recv()・load_lmhosts_file()・lookup_groupmem()・main()・net_groupmap_add()・net_lookup_host()・nt_to_afs_acl()・process_get_backup_list_request()・process_name_query_request()・process_node_status_request()・reply_special()・winbindd_getgrnam().
int max_protocol |
TALLOC_CTX* ctx [static] |
参照元 _srv_net_disk_enum()・account_set_badpw()・account_set_lockduration()・account_set_maxpwage()・account_set_minpwage()・account_set_minpwlen()・account_set_pwhistlen()・account_set_resetduration()・account_show()・add_ace()・add_event_by_time()・ads_add_group_acct()・ads_add_service_principal_name()・ads_add_user_acct()・ads_check_posix_schema_mapping()・ads_clear_service_principal_names()・ads_create_machine_acct()・ads_current_time()・ads_do_paged_search_args()・ads_do_search()・ads_kdestroy()・ads_keytab_add_entry()・ads_keytab_create_default()・ads_process_results()・ads_sasl_gssapi_bind()・atalk_rename()・atalk_rmdir()・atalk_unlink()・cac_SetSmbcContext()・cacl_dump()・cacl_set()・call_nt_transact_create()・cmd_quit()・cmd_samr_query_sec_obj()・cmd_showacls()・create_builtin_administrators()・creds_init_128()・display_finfo()・dump_sd()・fam_handler()・fam_reopen()・fam_watch_context_destructor()・gpo_sync_directories()・gpo_sync_files()・gpo_sync_func()・hmac_md5()・hmac_md5_final()・hmac_md5_init_limK_to_64()・hmac_md5_init_rfc2104()・hmac_md5_update()・idmap_ad_initialize()・idmap_ad_sids_to_unixids()・idmap_ad_unixids_to_sids()・idmap_backends_sids_to_unixids()・idmap_backends_unixids_to_sids()・idmap_ldap_allocate_id()・idmap_ldap_close()・idmap_ldap_close_destructor()・idmap_ldap_db_init()・idmap_ldap_set_hwm()・idmap_ldap_set_mapping()・idmap_ldap_sids_to_unixids()・idmap_ldap_unixids_to_sids()・idmap_nss_sids_to_unixids()・idmap_nss_unixids_to_sids()・idmap_rid_id_to_sid()・idmap_rid_initialize()・idmap_rid_sid_to_id()・idmap_rid_sids_to_unixids()・idmap_rid_unixids_to_sids()・idmap_set_mapping()・idmap_sids_to_unixids()・idmap_tdb_alloc_init()・idmap_tdb_close()・idmap_tdb_db_init()・idmap_tdb_dump_data()・idmap_tdb_id_to_sid()・idmap_tdb_open_db()・idmap_tdb_remove_mapping()・idmap_tdb_set_mapping()・idmap_tdb_sid_to_id()・idmap_tdb_sids_to_unixids()・idmap_tdb_unixids_to_sids()・idmap_unixids_to_sids()・info_fn()・init_srv_share_info_1501()・init_srv_share_info_502()・init_srv_share_info_ctr()・inotify_setup()・kerberos_get_default_realm_from_ccache()・kerberos_kinit_password_ext()・main()・MD5Final()・MD5Init()・MD5Update()・messaging_callback()・messaging_context_destructor()・messaging_deregister()・messaging_init()・messaging_register()・net_ads_dns_register()・net_ads_join()・net_ads_leave()・net_file_enum_3()・net_idmap_restore()・net_idmap_secret()・net_lookup_kdc()・net_lookup_ldap()・net_rpc_shell()・net_sh_process()・net_sh_run()・net_usershare_add()・net_usershare_info()・net_usershare_list()・nt_printer_publish_ads()・ntlmssp_make_packet_signature()・ntv2_owf_gen()・owner_set()・pdb_new_rid()・process_usershare_file()・resolve_ads()・rpc_info_internals()・rpc_sh_acct_do()・rpc_sh_acct_pol_show()・rpc_sh_acct_set_badpw()・rpc_sh_acct_set_lockduration()・rpc_sh_acct_set_maxpwage()・rpc_sh_acct_set_minpwage()・rpc_sh_acct_set_minpwlen()・rpc_sh_acct_set_pwhistlen()・rpc_sh_acct_set_resetduration()・rpc_sh_handle_user()・rpc_sh_info()・rpc_sh_rights_grant()・rpc_sh_rights_list()・rpc_sh_rights_revoke()・rpc_sh_share_add()・rpc_sh_share_delete()・rpc_sh_share_info()・rpc_sh_share_list()・rpc_sh_user_flag_edit()・rpc_sh_user_flag_edit_internals()・rpc_sh_user_info()・rpc_sh_user_list()・rpc_sh_user_show()・rpc_sh_user_show_internals()・rpc_sh_user_str_edit()・rpc_sh_user_str_edit_internals()・save_driver_init_2()・sec_desc_parse()・sec_desc_upg_fn()・setup_dfs_referral()・smb_info_set_ea()・smbc_getxattr_ctx()・smbc_removexattr_ctx()・smbc_setxattr_ctx()・smbd_event_context()・smbd_messaging_context()・SMBOWFencrypt_ntv2()・SMBsesskeygen_ntv2()・sys_notify_context_create()・test_speed()・upgrade_to_version_4()・upgrade_to_version_5()・verify_idpool()・winbind_event_context().
time_t newer_than = 0 |
int archive_level = 0 [static] |
BOOL translation = False [static] |
int blocksize |
参照元 writetarheader().
struct in_addr dest_ip [static] |
BOOL abort_mget = True [static] |
pstring fileselection = "" [static] |
SMB_BIG_UINT get_total_size = 0 |
unsigned int get_total_time_ms = 0 |
SMB_BIG_UINT put_total_size = 0 [static] |
unsigned int put_total_time_ms = 0 [static] |
double dir_total [static] |
参照元 add_ntlmssp_auth_footer()・add_schannel_auth_footer()・ads_fetch_gpo_files()・auth_get_challenge_server()・browse_host()・browse_host_rpc()・cacl_dump()・cacl_get()・cacl_set()・calculate_data_len_tosend()・change_trust_account_password()・check_refresh_gpo()・check_refresh_gpo_list()・check_share_availability()・check_share_sanity()・check_smbserver_security()・cli_api()・cli_api_pipe()・cli_calculate_sign_mac()・cli_check_msdfs_proxy()・cli_check_sign_mac()・cli_chkpath()・cli_close()・cli_connect()・cli_ctemp()・cli_dfs_check_error()・cli_dfs_get_referral()・cli_dfs_make_full_path()・cli_do_rpc_ndr()・cli_dos_error()・cli_dskattr()・cli_echo()・cli_errno()・cli_errstr()・cli_free_signing_context()・cli_full_connection()・cli_get_ea_list()・cli_get_ea_list_fnum()・cli_get_ea_list_path()・cli_get_fs_attr_info()・cli_get_fs_quota_info()・cli_get_fs_volume_info()・cli_get_fs_volume_info_old()・cli_get_nt_error()・cli_get_pdc_name()・cli_get_quota_handle()・cli_get_server_domain()・cli_get_server_name()・cli_get_server_type()・cli_get_user_quota()・cli_getatr()・cli_getattrE()・cli_init_creds()・cli_initialise()・cli_is_dos_error()・cli_is_error()・cli_is_nt_error()・cli_issue_read()・cli_issue_readraw()・cli_issue_write()・cli_link_internal()・cli_list()・cli_list_new()・cli_list_old()・cli_list_user_quota()・cli_lock()・cli_lock64()・cli_locktype()・cli_lsa_query_domain_info_policy()・cli_make_unix_date()・cli_make_unix_date2()・cli_make_unix_date3()・cli_message_end()・cli_message_end_build()・cli_message_start()・cli_message_start_build()・cli_message_text()・cli_message_text_build()・cli_mkdir()・cli_negprot()・cli_negprot_send()・cli_NetConnectionEnum()・cli_NetFileClose()・cli_NetFileEnum()・cli_NetFileGetInfo()・cli_NetGroupAdd()・cli_NetGroupAddUser()・cli_NetGroupDelete()・cli_NetGroupDelUser()・cli_NetGroupGetUsers()・cli_NetPrintQEnum()・cli_NetPrintQGetInfo()・cli_NetServerEnum()・cli_NetSessionDel()・cli_NetSessionEnum()・cli_NetSessionGetInfo()・cli_NetShareAdd()・cli_NetShareDelete()・cli_NetUserAdd()・cli_NetUserDelete()・cli_NetUserGetGroups()・cli_NetWkstaUserLogoff()・cli_NetWkstaUserLogon()・cli_ns_check_server_type()・cli_nt_create()・cli_nt_create_full()・cli_nt_delete_on_close()・cli_nt_error()・cli_nt_hardlink()・cli_nt_pipes_close()・cli_ntrename()・cli_null_set_signing()・cli_oem_change_password()・cli_open()・cli_oplock_ack()・cli_oplock_handler()・cli_pipe_get_current_pdu()・cli_pipe_validate_current_pdu()・cli_pipe_validate_rpc_response()・cli_pipe_verify_ntlmssp()・cli_pipe_verify_schannel()・cli_posix_lock()・cli_posix_lock_internal()・cli_posix_mkdir()・cli_posix_open()・cli_posix_open_internal()・cli_posix_rmdir()・cli_posix_unlink()・cli_posix_unlink_internal()・cli_posix_unlock()・cli_print_queue()・cli_printjob_del()・cli_put_dos_date()・cli_put_dos_date2()・cli_put_dos_date3()・cli_qfileinfo()・cli_qfileinfo_test()・cli_qfilename()・cli_qpathinfo()・cli_qpathinfo2()・cli_qpathinfo_alt_name()・cli_qpathinfo_basic()・cli_query_secdesc()・cli_raw_ioctl()・cli_raw_tcon()・cli_read()・cli_readraw()・cli_receive_nt_trans()・cli_receive_smb()・cli_receive_trans()・cli_rename()・cli_reset_error()・cli_rmdir()・cli_RNetGroupEnum()・cli_RNetGroupEnum0()・cli_RNetServiceEnum()・cli_RNetShareEnum()・cli_RNetUserEnum()・cli_RNetUserEnum0()・cli_rpc_pipe_close()・cli_rpc_pipe_open()・cli_rpc_pipe_open_krb5()・cli_rpc_pipe_open_noauth()・cli_rpc_pipe_open_ntlmssp()・cli_rpc_pipe_open_ntlmssp_auth_schannel()・cli_rpc_pipe_open_ntlmssp_internal()・cli_rpc_pipe_open_schannel()・cli_rpc_pipe_open_schannel_with_key()・cli_rpc_pipe_open_spnego_ntlmssp()・cli_send_keepalive()・cli_send_nt_trans()・cli_send_smb()・cli_send_tconX()・cli_send_trans()・cli_servertime()・cli_session_request()・cli_session_setup()・cli_session_setup_blob()・cli_session_setup_blob_receive()・cli_session_setup_blob_send()・cli_session_setup_capabilities()・cli_session_setup_guest()・cli_session_setup_kerberos()・cli_session_setup_lanman2()・cli_session_setup_nt1()・cli_session_setup_ntlmssp()・cli_session_setup_plaintext()・cli_session_setup_spnego()・cli_set_case_sensitive()・cli_set_ea()・cli_set_ea_fnum()・cli_set_ea_path()・cli_set_fs_quota_info()・cli_set_nt_error()・cli_set_port()・cli_set_secdesc()・cli_set_session_key()・cli_set_smb_signing_common()・cli_set_timeout()・cli_set_unix_extensions_capabilities()・cli_set_user_quota()・cli_setatr()・cli_setattrE()・cli_setpathinfo()・cli_setpid()・cli_setup_bcc()・cli_setup_packet()・cli_setup_signing_state()・cli_shutdown()・cli_simple_set_signing()・cli_smb_errstr()・cli_smb_rw_error_to_ntstatus()・cli_smbwrite()・cli_sockopt()・cli_spl_close()・cli_spl_open()・cli_start_connection()・cli_tdis()・cli_temp_set_signing()・cli_ulogoff()・cli_unix_chmod()・cli_unix_chmod_chown_internal()・cli_unix_chown()・cli_unix_extensions_version()・cli_unix_getfacl()・cli_unix_hardlink()・cli_unix_stat()・cli_unix_symlink()・cli_unlink()・cli_unlink_full()・cli_unlock()・cli_unlock64()・cli_write()・client_set_trans_sign_state_off()・client_set_trans_sign_state_on()・clistr_align_in()・clistr_align_out()・clistr_pull_fn()・clistr_push_fn()・close_files()・cm_connect_lsa()・cm_connect_netlogon()・cm_connect_sam()・cm_prepare_connection()・cmd_chmod()・cmd_chown()・cmd_close()・cmd_dfs_add()・cmd_dfs_enum()・cmd_dfs_exist()・cmd_dfs_getinfo()・cmd_dfs_remove()・cmd_ds_dsrole_getprimarydominfo()・cmd_ds_enum_domain_trusts()・cmd_echo_add_one()・cmd_echo_data()・cmd_echo_sink_data()・cmd_echo_source_data()・cmd_getfacl()・cmd_hardlink()・cmd_link()・cmd_lock()・cmd_logon()・cmd_lsa_add_acct_rights()・cmd_lsa_create_account()・cmd_lsa_enum_acct_rights()・cmd_lsa_enum_privilege()・cmd_lsa_enum_privsaccounts()・cmd_lsa_enum_sids()・cmd_lsa_enum_trust_dom()・cmd_lsa_get_dispname()・cmd_lsa_lookup_names()・cmd_lsa_lookup_priv_value()・cmd_lsa_lookup_sids()・cmd_lsa_query_info_policy()・cmd_lsa_query_secobj()・cmd_lsa_query_trustdominfo()・cmd_lsa_query_trustdominfobyname()・cmd_lsa_query_trustdominfobysid()・cmd_lsa_remove_acct_rights()・cmd_mkdir()・cmd_mput()・cmd_netlogon_change_trust_pw()・cmd_netlogon_dsr_getdcname()・cmd_netlogon_dsr_getdcnameex()・cmd_netlogon_dsr_getdcnameex2()・cmd_netlogon_dsr_getsitename()・cmd_netlogon_getanydcname()・cmd_netlogon_logon_ctrl()・cmd_netlogon_logon_ctrl2()・cmd_netlogon_sam_deltas()・cmd_netlogon_sam_logon()・cmd_netlogon_sam_sync()・cmd_open()・cmd_posix()・cmd_posix_mkdir()・cmd_posix_open()・cmd_posix_rmdir()・cmd_posix_unlink()・cmd_queue()・cmd_rename()・cmd_rmdir()・cmd_samr_chgpasswd2()・cmd_samr_chgpasswd3()・cmd_samr_create_dom_alias()・cmd_samr_create_dom_group()・cmd_samr_create_dom_user()・cmd_samr_delete_alias()・cmd_samr_delete_dom_user()・cmd_samr_enum_als_groups()・cmd_samr_enum_dom_groups()・cmd_samr_enum_dom_users()・cmd_samr_get_dom_pwinfo()・cmd_samr_get_usrdom_pwinfo()・cmd_samr_lookup_domain()・cmd_samr_lookup_names()・cmd_samr_lookup_rids()・cmd_samr_query_aliasmem()・cmd_samr_query_dispinfo()・cmd_samr_query_dominfo()・cmd_samr_query_group()・cmd_samr_query_groupmem()・cmd_samr_query_sec_obj()・cmd_samr_query_user()・cmd_samr_query_useraliases()・cmd_samr_query_usergroups()・cmd_setcase()・cmd_show_connect()・cmd_shutdown_abort()・cmd_shutdown_init()・cmd_spoolss_addform()・cmd_spoolss_addprinterdriver()・cmd_spoolss_addprinterex()・cmd_spoolss_deletedriver()・cmd_spoolss_deletedriverex()・cmd_spoolss_deleteform()・cmd_spoolss_enum_data()・cmd_spoolss_enum_data_ex()・cmd_spoolss_enum_drivers()・cmd_spoolss_enum_forms()・cmd_spoolss_enum_jobs()・cmd_spoolss_enum_ports()・cmd_spoolss_enum_printerkey()・cmd_spoolss_enum_printers()・cmd_spoolss_getdriver()・cmd_spoolss_getdriverdir()・cmd_spoolss_getform()・cmd_spoolss_getprinter()・cmd_spoolss_getprinterdata()・cmd_spoolss_getprinterdataex()・cmd_spoolss_getprintprocdir()・cmd_spoolss_open_printer_ex()・cmd_spoolss_printercmp()・cmd_spoolss_rffpcnex()・cmd_spoolss_setdriver()・cmd_spoolss_setform()・cmd_spoolss_setprinter()・cmd_spoolss_setprinterdata()・cmd_spoolss_setprintername()・cmd_srvsvc_net_file_enum()・cmd_srvsvc_net_remote_tod()・cmd_srvsvc_net_share_enum()・cmd_srvsvc_net_share_get_info()・cmd_srvsvc_net_share_set_info()・cmd_srvsvc_srv_query_info()・cmd_stat()・cmd_symlink()・cmd_testme()・cmd_unlock()・cmd_volume()・cmd_vuid()・cmd_wdel()・connect_to_domain_password_server()・create_krb5_auth_bind_req()・create_ntlmssp_auth_rpc_bind_req()・create_procs()・create_rpc_bind_req()・create_schannel_auth_rpc_bind_req()・create_spnego_ntlmssp_auth_rpc_bind_req()・do_altname()・do_cancel()・do_cd()・do_cmd()・do_del()・do_dskattr()・do_get()・do_host_query()・do_list()・do_message_op()・do_mkdir()・do_put()・do_tar_op()・domain_client_validate()・enum_dom_groups()・enum_local_groups()・enumerate_domain_trusts()・fetch_domain_sid()・fetch_machine_sid()・free_server_private_data()・get_ipc_connect()・get_ipc_connect_master_ip()・get_ipc_connect_master_ip_bcast()・get_real_name()・get_remote_printer_publishing_data()・get_rpc_shares()・get_schannel_session_key()・get_schannel_session_key_auth_ntlmssp()・get_schannel_session_key_common()・get_servers()・get_shares()・get_sid_from_name()・get_workgroups()・gpo_copy_file()・gpo_sync_directories()・interpret_long_filename()・interpret_short_filename()・just_change_the_password()・list_servers()・lookup_groupmem()・lookup_usergroups()・lsa_open_policy()・main()・msrpc_lockout_policy()・msrpc_lookup_useraliases()・msrpc_name_to_sid()・msrpc_password_policy()・msrpc_rids_to_names()・msrpc_sid_to_name()・name_to_sid()・nb_setup()・net_ads_leave()・net_ads_printer_publish()・net_get_remote_domain_sid()・net_join_domain()・net_make_ipc_connection_ex()・net_rap_domain()・net_rap_file()・net_rap_group()・net_rap_password()・net_rap_printq()・net_rap_server()・net_rap_server_name()・net_rap_service()・net_rap_session()・net_rap_share()・net_rap_user()・net_rpc_check()・net_rpc_join_newstyle()・net_rpc_join_ok()・net_rpc_lookup_name()・net_share_enum_rpc()・netdom_get_domain_sid()・netdom_join_domain()・netdom_leave_domain()・new_cli_state_object()・new_lsa_policy_hnd_object()・new_samr_alias_hnd_object()・new_samr_connect_hnd_object()・new_samr_domain_hnd_object()・new_samr_group_hnd_object()・new_samr_user_hnd_object()・new_spoolss_policy_hnd_object()・open_files()・open_pipe_creds()・oplock3_handler()・owner_set()・parse_quota_set()・process()・process_cmd()・process_command_string()・py_cli_state_dealloc()・py_smb_close()・py_smb_connect()・py_smb_negprot()・py_smb_nt_create_andx()・py_smb_open()・py_smb_query_secdesc()・py_smb_read()・py_smb_session_request()・py_smb_session_setup()・py_smb_set_secdesc()・py_smb_tconx()・py_smb_unlink()・query_user()・query_user_list()・rap_file_close()・rap_file_info()・rap_group_add()・rap_group_delete()・rap_groupmember_add()・rap_groupmember_delete()・rap_groupmember_list()・rap_printq_delete()・rap_printq_info()・rap_session_delete()・rap_session_info()・rap_share_add()・rap_share_delete()・rap_user_add()・rap_user_delete()・rap_user_info()・readline_callback()・reconnect()・reg_match_one()・reg_test()・remote_completion()・remote_password_change()・retest()・rpc_api_pipe()・rpc_api_pipe_req()・rpc_finish_auth3_bind()・rpc_finish_spnego_ntlmssp_bind()・rpc_group_addmem_internals()・rpc_group_delmem_internals()・rpc_oldjoin_internals()・rpc_pipe_bind()・rpc_pipe_set_hnd_state()・rpc_printer_migrate_drivers_internals()・rpc_printer_migrate_forms_internals()・rpc_printer_migrate_printers_internals()・rpc_printer_migrate_security_internals()・rpc_printer_migrate_settings_internals()・rpc_printer_publish_list_internals()・rpc_read()・rpc_registry_save_internal()・rpc_samdump_internals()・rpc_share_allowedusers_internals()・rpc_share_migrate_files_internals()・rpc_share_migrate_security_internals()・rpc_share_migrate_shares_internals()・rpc_trustdom_add_internals()・rpc_trustdom_establish()・rpc_trustdom_list()・rpc_trustdom_vampire()・rpc_user_add_internals()・rpc_user_password_internals()・rpc_user_rename_internals()・rpccli_dfs_Add()・rpccli_dfs_Add2()・rpccli_dfs_AddFtRoot()・rpccli_dfs_AddStdRoot()・rpccli_dfs_AddStdRootForced()・rpccli_dfs_Enum()・rpccli_dfs_EnumEx()・rpccli_dfs_FlushFtTable()・rpccli_dfs_GetDcAddress()・rpccli_dfs_GetInfo()・rpccli_dfs_GetManagerVersion()・rpccli_dfs_ManagerGetConfigInfo()・rpccli_dfs_ManagerInitialize()・rpccli_dfs_ManagerSendSiteInfo()・rpccli_dfs_Move()・rpccli_dfs_Remove()・rpccli_dfs_Remove2()・rpccli_dfs_RemoveFtRoot()・rpccli_dfs_RemoveStdRoot()・rpccli_dfs_Rename()・rpccli_dfs_SetDcAddress()・rpccli_dfs_SetInfo()・rpccli_dfs_SetInfo2()・rpccli_ds_enum_domain_trusts()・rpccli_ds_getprimarydominfo()・rpccli_echo_add_one()・rpccli_echo_data()・rpccli_echo_sink_data()・rpccli_echo_source_data()・rpccli_lsa_add_account_rights()・rpccli_lsa_close()・rpccli_lsa_create_account()・rpccli_lsa_enum_account_rights()・rpccli_lsa_enum_privilege()・rpccli_lsa_enum_privsaccount()・rpccli_lsa_enum_sids()・rpccli_lsa_enum_trust_dom()・rpccli_lsa_get_dispname()・rpccli_lsa_lookup_names()・rpccli_lsa_lookup_priv_value()・rpccli_lsa_lookup_sids()・rpccli_lsa_open_account()・rpccli_lsa_open_policy()・rpccli_lsa_open_policy2()・rpccli_lsa_open_trusted_domain()・rpccli_lsa_open_trusted_domain_by_name()・rpccli_lsa_query_info_policy()・rpccli_lsa_query_info_policy2()・rpccli_lsa_query_info_policy2_new()・rpccli_lsa_query_info_policy_new()・rpccli_lsa_query_secobj()・rpccli_lsa_query_trusted_domain_info()・rpccli_lsa_query_trusted_domain_info_by_name()・rpccli_lsa_query_trusted_domain_info_by_sid()・rpccli_lsa_remove_account_rights()・rpccli_lsa_set_info_policy()・rpccli_net_auth2()・rpccli_net_auth3()・rpccli_net_req_chal()・rpccli_net_srv_pwset()・rpccli_net_srv_pwset2()・rpccli_netlogon_dsr_getdcname()・rpccli_netlogon_dsr_getdcnameex()・rpccli_netlogon_dsr_getdcnameex2()・rpccli_netlogon_dsr_getsitename()・rpccli_netlogon_getanydcname()・rpccli_netlogon_logon_ctrl2()・rpccli_netlogon_sam_deltas()・rpccli_netlogon_sam_logon()・rpccli_netlogon_sam_network_logon()・rpccli_netlogon_sam_sync()・rpccli_netlogon_setup_creds()・rpccli_reg_abort_shutdown()・rpccli_reg_close()・rpccli_reg_connect()・rpccli_reg_create_key_ex()・rpccli_reg_delete_key()・rpccli_reg_delete_val()・rpccli_reg_enum_key()・rpccli_reg_enum_val()・rpccli_reg_flush_key()・rpccli_reg_get_key_sec()・rpccli_reg_getversion()・rpccli_reg_open_entry()・rpccli_reg_open_hive_int()・rpccli_reg_query_key()・rpccli_reg_query_value()・rpccli_reg_save_key()・rpccli_reg_set_key_sec()・rpccli_reg_set_val()・rpccli_reg_shutdown()・rpccli_samr_add_aliasmem()・rpccli_samr_add_groupmem()・rpccli_samr_chgpasswd3()・rpccli_samr_chgpasswd_user()・rpccli_samr_chng_pswd_auth_crap()・rpccli_samr_close()・rpccli_samr_connect()・rpccli_samr_connect4()・rpccli_samr_create_dom_alias()・rpccli_samr_create_dom_group()・rpccli_samr_create_dom_user()・rpccli_samr_del_aliasmem()・rpccli_samr_del_groupmem()・rpccli_samr_delete_dom_alias()・rpccli_samr_delete_dom_group()・rpccli_samr_delete_dom_user()・rpccli_samr_enum_als_groups()・rpccli_samr_enum_dom_groups()・rpccli_samr_enum_dom_users()・rpccli_samr_get_dom_pwinfo()・rpccli_samr_get_usrdom_pwinfo()・rpccli_samr_lookup_domain()・rpccli_samr_lookup_names()・rpccli_samr_lookup_rids()・rpccli_samr_open_alias()・rpccli_samr_open_domain()・rpccli_samr_open_group()・rpccli_samr_open_user()・rpccli_samr_query_alias_info()・rpccli_samr_query_aliasmem()・rpccli_samr_query_dispinfo()・rpccli_samr_query_dom_info()・rpccli_samr_query_dom_info2()・rpccli_samr_query_groupinfo()・rpccli_samr_query_groupmem()・rpccli_samr_query_sec_obj()・rpccli_samr_query_useraliases()・rpccli_samr_query_usergroups()・rpccli_samr_query_userinfo()・rpccli_samr_remove_sid_foreign_domain()・rpccli_samr_set_aliasinfo()・rpccli_samr_set_domain_info()・rpccli_samr_set_groupinfo()・rpccli_samr_set_sec_obj()・rpccli_samr_set_userinfo()・rpccli_samr_set_userinfo2()・rpccli_shutdown_abort()・rpccli_shutdown_init()・rpccli_shutdown_init_ex()・rpccli_spoolss_addform()・rpccli_spoolss_addprinterdriver()・rpccli_spoolss_addprinterex()・rpccli_spoolss_close_printer()・rpccli_spoolss_deleteform()・rpccli_spoolss_deleteprinterdata()・rpccli_spoolss_deleteprinterdataex()・rpccli_spoolss_deleteprinterdriver()・rpccli_spoolss_deleteprinterdriverex()・rpccli_spoolss_deleteprinterkey()・rpccli_spoolss_enddocprinter()・rpccli_spoolss_endpageprinter()・rpccli_spoolss_enum_ports()・rpccli_spoolss_enum_printers()・rpccli_spoolss_enumforms()・rpccli_spoolss_enumjobs()・rpccli_spoolss_enumprinterdata()・rpccli_spoolss_enumprinterdataex()・rpccli_spoolss_enumprinterdrivers()・rpccli_spoolss_enumprinterkey()・rpccli_spoolss_getform()・rpccli_spoolss_getjob()・rpccli_spoolss_getprinter()・rpccli_spoolss_getprinterdata()・rpccli_spoolss_getprinterdataex()・rpccli_spoolss_getprinterdriver()・rpccli_spoolss_getprinterdriverdir()・rpccli_spoolss_getprintprocessordirectory()・rpccli_spoolss_open_printer_ex()・rpccli_spoolss_reply_close_printer()・rpccli_spoolss_reply_open_printer()・rpccli_spoolss_rffpcnex()・rpccli_spoolss_routerreplyprinter()・rpccli_spoolss_rrpcn()・rpccli_spoolss_setform()・rpccli_spoolss_setjob()・rpccli_spoolss_setprinter()・rpccli_spoolss_setprinterdata()・rpccli_spoolss_setprinterdataex()・rpccli_spoolss_startdocprinter()・rpccli_spoolss_startpageprinter()・rpccli_spoolss_writeprinter()・rpccli_srvsvc_net_file_close()・rpccli_srvsvc_net_file_enum()・rpccli_srvsvc_net_remote_tod()・rpccli_srvsvc_net_share_add()・rpccli_srvsvc_net_share_del()・rpccli_srvsvc_net_share_enum()・rpccli_srvsvc_net_share_get_info()・rpccli_srvsvc_net_share_set_info()・rpccli_srvsvc_net_srv_get_info()・rpccli_svcctl_close_service()・rpccli_svcctl_control_service()・rpccli_svcctl_enumerate_services()・rpccli_svcctl_get_dispname()・rpccli_svcctl_open_scm()・rpccli_svcctl_open_service()・rpccli_svcctl_query_config()・rpccli_svcctl_query_status()・rpccli_svcctl_start_service()・rpccli_wkssvc_NetrAddAlternateComputerName()・rpccli_WKSSVC_NETRENUMERATECOMPUTERNAMES()・rpccli_WKSSVC_NETRGETJOINABLEOUS()・rpccli_WKSSVC_NETRGETJOINABLEOUS2()・rpccli_WKSSVC_NETRGETJOININFORMATION()・rpccli_WKSSVC_NETRJOINDOMAIN()・rpccli_wkssvc_NetrJoinDomain2()・rpccli_WKSSVC_NETRLOGONDOMAINNAMEADD()・rpccli_WKSSVC_NETRLOGONDOMAINNAMEDEL()・rpccli_WKSSVC_NETRMESSAGEBUFFERSEND()・rpccli_wkssvc_NetrRemoveAlternateComputerName()・rpccli_WKSSVC_NETRRENAMEMACHINEINDOMAIN()・rpccli_wkssvc_NetrRenameMachineInDomain2()・rpccli_WKSSVC_NETRSETPRIMARYCOMPUTERNAME()・rpccli_WKSSVC_NETRUNJOINDOMAIN()・rpccli_wkssvc_NetrUnjoinDomain2()・rpccli_WKSSVC_NETRUSEADD()・rpccli_WKSSVC_NETRUSEDEL()・rpccli_WKSSVC_NETRUSEENUM()・rpccli_WKSSVC_NETRUSEGETINFO()・rpccli_WKSSVC_NETRVALIDATENAME()・rpccli_WKSSVC_NETRVALIDATENAME2()・rpccli_WKSSVC_NETRWKSTATRANSPORTADD()・rpccli_WKSSVC_NETRWKSTATRANSPORTDEL()・rpccli_WKSSVC_NETRWKSTAUSERGETINFO()・rpccli_WKSSVC_NETRWKSTAUSERSETINFO()・rpccli_WKSSVC_NETRWORKSTATIONSTATISTICSGET()・rpccli_wkssvc_NetWkstaEnumUsers()・rpccli_wkssvc_NetWkstaGetInfo()・rpccli_wkssvc_NetWkstaSetInfo()・rpccli_wkssvc_NetWkstaTransportEnum()・run_attrtest()・run_browsetest()・run_dirtest()・run_dirtest1()・run_eatest()・run_enums_test()・run_fdsesstest()・run_locktest2()・run_locktest6()・run_maxfidtest()・run_negprot_nowait()・run_netbench()・run_ntlogin_test()・run_oplock3()・run_properties()・run_randomipc()・run_readwritemulti()・run_rpc_command()・run_tcon2_test()・run_tcon_test()・run_torture()・run_trans2test()・run_unlinktest()・run_w2ktest()・samr_connect()・scan_nttrans()・scan_trans2()・send_message()・send_server_keepalive()・sequence_number()・server_cryptkey()・set_dc_type_and_flags()・show_userlist()・smb_complete_connection()・smb_connect()・smb_print()・smbc_opendir_ctx()・smbd_running()・spoolss_addprinterdriver()・spoolss_addprinterex()・spoolss_enumports()・spoolss_enumprinterdrivers()・spoolss_enumprinters()・spoolss_getprinterdriverdir()・spoolss_openprinter()・srvsvc_netservergetinfo()・sync_child()・tcon_devtest()・test_locks()・test_mask()・test_one()・testpair()・torture_casetable()・torture_chkpath_test()・torture_cli_session_setup2()・torture_ioctl_test()・torture_mangle()・torture_nttrans_scan()・torture_trans2_scan()・torture_utable()・trust_pw_change_and_store_it()・trust_pw_find_change_and_store_it()・trusted_domains()・try_nttrans()・try_nttrans_len()・try_samr_connects()・try_trans2()・try_trans2_len()・winbindd_add_client()・winbindd_dual_pam_chauthtok()・winbindd_dual_pam_chng_pswd_auth_crap()・winbindd_remove_client()・writetarheader().
char CLI_DIRSEP_CHAR = '\\' [static] |
char CLI_DIRSEP_STR[] = { '\\', '\0' } [static] |
BOOL do_list_recurse [static] |
BOOL do_list_dirs [static] |
char* do_list_queue = 0 [static] |
long do_list_queue_size = 0 [static] |
long do_list_queue_start = 0 [static] |
long do_list_queue_end = 0 [static] |
void(*) do_list_fn(file_info *) [static] |
const char* name |
参照元 _cleanup_failures()・_get_interfaces()・_lsa_enum_privs()・_lsa_lookup_priv_value()・_lsa_lookup_sids_internal()・_lsa_open_account()・_lsa_query_info()・_nss_wins_gethostbyname_r()・_reg_create_key_ex()・_reg_delete_key()・_reg_open_entry()・_reg_perfcount_get_instance_info()・_reg_perfcount_multi_sz_from_tdb()・_reg_query_value()・_samr_create_dom_alias()・_samr_create_dom_group()・_samr_enum_domains()・_samr_lookup_names()・_spoolss_enumprinters()・_spoolss_getform()・_spoolss_getprinterdriverdirectory()・_spoolss_open_printer_ex()・account_policy_get()・account_policy_set()・add_a_form()・add_expanded_sid()・add_member()・add_one_dc_unique()・ads_add_user_acct()・ads_dns_query_internal()・ads_dump_field()・ads_get_dnshostname()・ads_get_samaccountname()・ads_get_upn()・ads_gpo_get_sysvol_gpt_version()・ads_sasl_bind()・afs_set_nt_acl()・aix_cache_reload()・announce_remote()・api_reply()・api_RNetGroupEnum()・api_RNetServerGetInfo()・api_RNetUserEnum()・api_rpcTNP()・api_WPrintJobEnumerate()・api_WWkstaUserLogon()・atalk_add_to_list()・atalk_build_paths()・become_domain_master_query_fail()・become_domain_master_query_success()・browse_host_rpc()・bsd_attr_list()・cac_LsaAddPrivileges()・cac_LsaClearPrivileges()・cac_LsaEnumAccountRights()・cac_LsaOpenAccount()・cac_LsaRemovePrivileges()・cac_LsaSetPrivileges()・cac_SamOpenUser()・cacl_get()・catia_chdir()・catia_chmod()・catia_chown()・catia_lstat()・catia_open()・catia_opendir()・catia_stat()・catia_unlink()・cb_itemsignal()・cb_selection_changed()・cb_wholenet()・cgi_load_variables()・check_log_size()・cli_negprot()・cli_negprot_send()・cmd_altname()・cmd_getfacl()・cmd_help()・cmd_spoolss_enum_printers()・cmd_stat()・completion_fn()・construct_notify_printer_info()・copy_print_driver_3()・create_vk_record()・cups_cache_reload()・cups_pull_comment_location()・delete_a_form()・delete_machine_entry()・denystr()・diagnose_ntlm_auth()・display_group_info2()・display_print_driver_1()・display_print_driver_2()・display_print_driver_3()・display_print_info_0()・display_print_info_1()・display_printdriverdir_1()・display_query_info_3()・display_query_info_5()・display_sam_sync()・display_sam_unk_info_2()・display_sam_unk_info_4()・display_sam_unk_info_5()・display_sam_unk_info_6()・display_srv_info_101()・display_srv_info_102()・dns_marshall_domain_name()・dns_unmarshall_domain_name()・do_command()・dptr_normal_ReadDirName()・enum_accounts_for_privilege()・enum_dom_groups()・enum_privileges_for_accounts()・enumerate_status()・enumprintmonitors_level_1()・enumprintmonitors_level_2()・fam_open_connection()・fetch_alias_info()・fetch_group_info()・fill_grent()・fill_grent_mem()・find_idmap_domain_from_sid()・find_new_dc()・find_valuename_index()・free_namearray()・from_struct()・from_unistr_list()・get_a_builtin_ntform()・get_attr_list()・get_dc_list()・get_ipc_connect_master_ip()・get_key_from_keytab()・get_longvar_val()・get_rpc_shares()・get_user_tokens()・getprinterdriverdir_level_1()・gidtoname()・guid_string_to_name()・idmap_nss_sids_to_unixids()・idmap_nss_unixids_to_sids()・info_fn()・init_bitmap()・init_fake_file_handle()・init_r_enum_trust_dom()・init_service_op_table()・initialise_wins()・initiate_myworkgroup_startup()・insert_permanent_name_into_unicast()・insert_refresh_name_into_unicast()・interpret_interface()・iprint_cache_add_printer()・is_fake_file()・is_myname_or_ipaddr()・ldapsam_delete_entry()・ldapsam_lookup_rids()・load_lmhosts_file()・lookup()・lookup_groupmem()・lookup_lsa_rids()・lookup_lsa_sids()・lookup_name()・lookup_sid()・lookup_sids()・lookup_word()・lp_enum()・lsa_io_priv_entries()・lsa_io_trustdom_query_1()・luid_to_privilege_name()・main()・mangle_init()・map_unix_group()・msg_deliver()・msg_pool_usage_helper()・multihomed_register_name()・net_getlocalsid()・net_lookup_host()・net_lookup_name()・net_lookup_sid()・net_rap_server_name()・net_sam_listmem()・net_sam_provision()・net_sam_set_comment()・net_sam_set_pwdmustchangenow()・net_sam_set_userflag()・net_sam_show()・net_sam_userset()・net_usershare_add()・netbsdwinbind_getgrnam()・netbsdwinbind_getgrnam_r()・netbsdwinbind_getpwnam()・netbsdwinbind_getpwnam_r()・nmb_namestr()・node_status_query()・nt_to_afs_acl()・openstr()・pac_group_attr_string()・pam_sm_acct_mgmt()・pam_sm_authenticate()・parse_afs_acl()・parse_gpt_ini()・parse_nmb_name()・parse_node_status()・pcap_cache_reload()・pdb_create_builtin_alias()・pdb_default_lookup_rids()・pdb_default_sid_to_id()・pdb_new_rid()・pidfile_create()・print_count_samples()・print_domain_groups()・print_domain_users()・print_fsp_open()・process_node_status_request()・process_tok()・process_xcvlocal_command()・process_xcvtcp_command()・put_nmb_name()・py_enum_domain_groups()・py_enum_domain_users()・py_enum_trust_dom()・py_name_to_sid()・py_sid_to_name()・py_tdb_open()・py_to_FORM()・query_user_list()・reply_checkpath()・reply_copy()・reply_mv()・reply_unlink()・resultstr()・rpc_printer_migrate_forms_internals()・rpc_registry_enumerate_internal()・rpccli_lsa_enum_privilege()・rpccli_lsa_lookup_sids()・rpccli_spoolss_enumprinterdataex()・run_eatest()・sam_trusted_domains()・set_namearray()・set_socket_options()・show_parameter_list()・show_userlist()・smb_dos_err_name()・smb_dos_errstr()・smb_fn_name()・smb_io_unistr3()・smb_stat_cache_delete()・smbacl4_fill_ace4()・snapin_guid_string_to_name()・spoolss_addprinterex_level_2()・spoolss_enumports()・spoolss_enumprinterdrivers()・spoolss_enumprinters()・spoolss_hnd_enumforms()・spoolss_io_devmode()・standard_success_register()・swrap_getpeername()・swrap_getsockname()・sys_get_quota()・sys_set_quota()・sysv_cache_reload()・talloc_init()・talloc_named()・talloc_report_depth_FILE_helper()・talloc_set_name()・tdb_delete_samacct_only()・tdb_update_ridrec_only()・tdb_update_samacct_only()・tdb_wrap_log()・tdbsam_delete_sam_account()・tdbsam_getsampwnam()・tdbsam_getsampwrid()・test_misc()・test_realloc_child()・to_struct()・torture_mangle()・uid2name_recv()・uidtoname()・update_a_form()・usage()・validate_group()・wb_aix_attrlist()・wbinfo_list_domains()・winbindd_list_groups()・winbindd_list_users()・winbindd_wins_byip()・wins_process_name_registration_request()・wins_proxy_name_query_request_success()・wins_write_name_record()・write_ntforms()・writetarheader()・wsys_getpwnam().
int(* fn)(void) |
参照元 _Insure_trap_error()・ads_do_search_all_fn()・ads_process_results()・api_reply()・brl_forall()・cli_list_new()・cli_list_old()・cli_NetConnectionEnum()・cli_NetFileEnum()・cli_NetFileGetInfo()・cli_NetGroupGetUsers()・cli_NetServerEnum()・cli_NetSessionEnum()・cli_NetSessionGetInfo()・cli_NetUserGetGroups()・cli_print_queue()・cli_RNetGroupEnum()・cli_RNetGroupEnum0()・cli_RNetServiceEnum()・cli_RNetShareEnum()・cli_RNetUserEnum()・cli_RNetUserEnum0()・create_procs()・diagnose_ntlm_auth()・do_command()・gencache_iterate()・get_longvar_val()・main()・manage_squid_request()・map_regval_to_ads()・net_lookup()・net_run_function()・net_run_function2()・net_sam_userset()・pass_check()・pcap_printer_fn()・poptReadDefaultConfig()・process_tok()・process_xcvlocal_command()・process_xcvtcp_command()・rpc_sh_acct_do()・rpc_sh_handle_user()・run_rpc_command()・run_test()・search_notify()・showHelpIntro()・string_combinations()・string_combinations2()・switch_message()・tdb_traverse_internal()・tool_list()・uname_string_combinations2().
const char* description |
参照元 _lsa_priv_get_dispname()・_svcctl_query_service_config2()・account_policy_get_desc()・audit_description_str()・cmd_help()・cmd_lsa_get_dispname()・enum_groups_internal()・enum_privileges()・fetch_account_info_to_ldif()・fetch_alias_info_to_ldif()・fill_service_values()・init_sam_user_info21A()・rpc_group_list_internals()・rpc_rights_list_internal()・svcctl_io_service_description()・svcctl_lookup_description()・terminate().
char compl_args[2] |
struct { ... } commands[] [static] |
参照元 completion_fn().