Author: kalim Date: 2005-08-01 03:33:45 +0000 (Mon, 01 Aug 2005) New Revision: 8880
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8880 Log: Added rmdir command. Took out some debugging stuff. -Kalim Modified: branches/SOC/SAMBA_3_0/source/client/client.c Changeset: Modified: branches/SOC/SAMBA_3_0/source/client/client.c =================================================================== --- branches/SOC/SAMBA_3_0/source/client/client.c 2005-08-01 01:52:01 UTC (rev 8879) +++ branches/SOC/SAMBA_3_0/source/client/client.c 2005-08-01 03:33:45 UTC (rev 8880) @@ -124,14 +124,11 @@ static char authSet = 0; - d_printf("Authentication function called\n"); - if (authSet) { strncpy(pWorkgroup, authWorkgroup, maxLenWorkgroup - 1); strncpy(pUsername, authUsername, maxLenUsername - 1); strncpy(pPassword, authPassword, maxLenPassword - 1); - d_printf("Loaded stored authentication values\n"); } else { @@ -364,8 +361,6 @@ pstrcat(targetpath, cur_dir); unix_format(targetpath); - d_printf("Target is: %s\n", targetpath); - d_printf("cur_dir: %s\n", cur_dir); dh = smbc_opendir(targetpath); if (dh < 0) @@ -1747,8 +1742,10 @@ pstring buf; struct cli_state *targetcli; pstring targetname; - - pstrcpy(mask,cur_dir); + + pstrcpy(mask, "smb:"); + pstrcat(mask, service); + pstrcat(mask,cur_dir); if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { d_printf("rmdir <dirname>\n"); @@ -1756,7 +1753,7 @@ } pstrcat(mask,buf); - if ( !cli_resolve_path( "", cli, mask, &targetcli, targetname ) ) { + /*if ( !cli_resolve_path( "", cli, mask, &targetcli, targetname ) ) { d_printf("rmdir %s: %s\n", mask, cli_errstr(cli)); return 1; } @@ -1764,7 +1761,10 @@ if (!cli_rmdir(targetcli, targetname)) { d_printf("%s removing remote directory file %s\n", cli_errstr(targetcli),mask); - } + }*/ + + if (smbc_rmdir(mask) < 0) + d_printf("Error: %s removing remote directory file %s\n", strerror(errno), mask); return 0; } @@ -2759,7 +2759,7 @@ /* {"chmod",cmd_chmod,"<src> <mode> chmod a file using UNIX permission",{COMPL_REMOTE,COMPL_REMOTE}}, */ /* {"chown",cmd_chown,"<src> <uid> <gid> chown a file using UNIX uids and gids",{COMPL_REMOTE,COMPL_REMOTE}}, */ /* {"del",cmd_del,"<mask> delete all matching files",{COMPL_REMOTE,COMPL_NONE}}, */ -/* {"dir",cmd_dir,"<mask> list the contents of the current directory",{COMPL_REMOTE,COMPL_NONE}}, */ +/* {"dir",cmd_dir,"<mask> list the contents of the current directory",{COMPL_REMOTE,COMPL_NONE}},*/ /* {"du",cmd_du,"<mask> computes the total size of the current directory",{COMPL_REMOTE,COMPL_NONE}}, */ {"exit",cmd_quit,"logoff the server",{COMPL_NONE,COMPL_NONE}}, /* {"get",cmd_get,"<remote name> [local name] get a file",{COMPL_REMOTE,COMPL_LOCAL}}, */ @@ -2772,7 +2772,7 @@ /* {"listconnect",cmd_list_connect,"list open connections",{COMPL_NONE,COMPL_NONE}}, */ /* {"logon",cmd_logon,"establish new logon",{COMPL_NONE,COMPL_NONE}}, */ {"lowercase",cmd_lowercase,"toggle lowercasing of filenames for get",{COMPL_NONE,COMPL_NONE}}, -/* {"ls",cmd_dir,"<mask> list the contents of the current directory",{COMPL_REMOTE,COMPL_NONE}}, */ +/* {"ls",cmd_dir,"<mask> list the contents of the current directory",{COMPL_REMOTE,COMPL_NONE}},*/ /* {"mask",cmd_select,"<mask> mask all filenames against this",{COMPL_REMOTE,COMPL_NONE}}, */ /* {"md",cmd_mkdir,"<directory> make a directory",{COMPL_NONE,COMPL_NONE}}, */ /* {"mget",cmd_mget,"<mask> get all the matching files",{COMPL_REMOTE,COMPL_NONE}}, */ @@ -2788,13 +2788,13 @@ {"q",cmd_quit,"logoff the server",{COMPL_NONE,COMPL_NONE}}, /* {"queue",cmd_queue,"show the print queue",{COMPL_NONE,COMPL_NONE}}, */ {"quit",cmd_quit,"logoff the server",{COMPL_NONE,COMPL_NONE}}, -/* {"rd",cmd_rmdir,"<directory> remove a directory",{COMPL_NONE,COMPL_NONE}}, */ + {"rd",cmd_rmdir,"<directory> remove a directory",{COMPL_NONE,COMPL_NONE}}, /* {"recurse",cmd_recurse,"toggle directory recursion for mget and mput",{COMPL_NONE,COMPL_NONE}}, */ /* {"reget",cmd_reget,"<remote name> [local name] get a file restarting at end of local file",{COMPL_REMOTE,COMPL_LOCAL}},*/ /* {"rename",cmd_rename,"<src> <dest> rename some files",{COMPL_REMOTE,COMPL_REMOTE}},*/ /* {"reput",cmd_reput,"<local name> [remote name] put a file restarting at end of remote file",{COMPL_LOCAL,COMPL_REMOTE}},*/ /* {"rm",cmd_del,"<mask> delete all matching files",{COMPL_REMOTE,COMPL_NONE}},*/ -/* {"rmdir",cmd_rmdir,"<directory> remove a directory",{COMPL_NONE,COMPL_NONE}},*/ + {"rmdir",cmd_rmdir,"<directory> remove a directory",{COMPL_NONE,COMPL_NONE}}, /* {"setmode",cmd_setmode,"filename <setmode string> change modes of file",{COMPL_REMOTE,COMPL_NONE}},*/ /* {"showconnect",cmd_show_connect,"display the current active connection",{COMPL_NONE,COMPL_NONE}},*/ /* {"stat",cmd_stat,"filename Do a UNIX extensions stat call on a file",{COMPL_REMOTE,COMPL_REMOTE}},*/
