+ d_printf("symlink <src> <dest>\n");
+ return 1;
+ }
+
+ pstrcat(src,buf);
+ pstrcat(dest,buf2);
+
+ if (!cli_unix_symlink(cli, src, dest)) {
+ d_printf("%s symlinking files (%s -> %s)\n",
+ cli_errstr(cli), src, dest);
+ return 1;
+ }
+
+ return 0;
+}
+
+/****************************************************************************
+ UNIX chmod.
+****************************************************************************/
+
+static int cmd_chmod(void)
+{
+ pstring src;
+ mode_t mode;
+ fstring buf, buf2;
+
+ if (!SERVER_HAS_UNIX_CIFS(cli)) {
+ d_printf("Server doesn't support UNIX CIFS calls.\n");
+ return 1;
+ }
+
+ pstrcpy(src,cur_dir);
+
+ if (!next_token(NULL,buf,NULL,sizeof(buf)) ||
+ !next_token(NULL,buf2,NULL, sizeof(buf2))) {
+ d_printf("chmod mode file\n");
+ return 1;
+ }
+
+ mode = (mode_t)strtol(buf, NULL, 8);
+ pstrcat(src,buf2);
+
+ if (!cli_unix_chmod(cli, src, mode)) {
+ d_printf("%s chmod file %s 0%o\n",
+ cli_errstr(cli), src, (unsigned int)mode);
+ return 1;
+ }
+
+ return 0;
+}
+
+/****************************************************************************
+ UNIX chown.
+****************************************************************************/
+
+static int cmd_chown(void)
+{
+ pstring src;
+ uid_t uid;
+ gid_t gid;
+ fstring buf, buf2, buf3;
+
+ if (!SERVER_HAS_UNIX_CIFS(cli)) {
+ d_printf("Server doesn't support UNIX CIFS calls.\n");
+ return 1;
+ }
+
+ pstrcpy(src,cur_dir);
+
+ if (!next_token(NULL,buf,NULL,sizeof(buf)) ||
+ !next_token(NULL,buf2,NULL, sizeof(buf2)) ||
+ !next_token(NULL,buf3,NULL, sizeof(buf3))) {
+ d_printf("chown uid gid file\n");
+ return 1;
+ }
+
+ uid = (uid_t)atoi(buf);
+ gid = (gid_t)atoi(buf2);
+ pstrcat(src,buf3);
+
+ if (!cli_unix_chown(cli, src, uid, gid)) {
+ d_printf("%s chown file %s uid=%d, gid=%d\n",
+ cli_errstr(cli), src, (int)uid, (int)gid);
+ return 1;
+ }
+
+ return 0;
+}
+
+/****************************************************************************
+rename some files
+****************************************************************************/
+static int cmd_rename(void)
+{
+ pstring src,dest;
+ fstring buf,buf2;
+
+ pstrcpy(src,cur_dir);
+ pstrcpy(dest,cur_dir);
+
+ if (!next_token_nr(NULL,buf,NULL,sizeof(buf)) ||
+ !next_token_nr(NULL,buf2,NULL, sizeof(buf2))) {
+ d_printf("rename <src> <dest>\n");
+ return 1;