static int atalk_rmdir(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path)
{
	BOOL add = False;
	TALLOC_CTX *ctx = 0;
	char *dpath;

	if (!conn || !conn->origpath || !path) goto exit_rmdir;

	/* due to there is no way to change bDeleteVetoFiles variable
	 * from this module, gotta use talloc stuff..
	 */

	strstr(path, APPLEDOUBLE) ? (add = False) : (add = True);

	if (!(ctx = talloc_init("remove_directory")))
		goto exit_rmdir;

	if (!(dpath = talloc_asprintf(ctx, "%s/%s%s", 
	  conn->origpath, path, add ? "/"APPLEDOUBLE : "")))
		goto exit_rmdir;

	atalk_rrmdir(ctx, dpath);

exit_rmdir:
	talloc_destroy(ctx);
	return SMB_VFS_NEXT_RMDIR(handle, conn, path);
}
Exemple #2
0
static int atalk_rmdir(struct vfs_handle_struct *handle,
			const struct smb_filename *smb_fname)
{
	bool add = False;
	TALLOC_CTX *ctx = 0;
	const char *path = smb_fname->base_name;
	char *dpath;

	if (!handle->conn->cwd || !path) goto exit_rmdir;

	/* due to there is no way to change bDeleteVetoFiles variable
	 * from this module, gotta use talloc stuff..
	 */

	strstr_m(path, APPLEDOUBLE) ? (add = False) : (add = True);

	if (!(ctx = talloc_init("remove_directory")))
		goto exit_rmdir;

	if (!(dpath = talloc_asprintf(ctx, "%s/%s%s", 
	  handle->conn->cwd, path, add ? "/"APPLEDOUBLE : "")))
		goto exit_rmdir;

	atalk_rrmdir(ctx, dpath);

exit_rmdir:
	talloc_destroy(ctx);
	return SMB_VFS_NEXT_RMDIR(handle, smb_fname);
}