diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-05-17 20:04:54 +0200 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-05-17 20:08:11 +0200 |
commit | 0ec847bbe7d2db3ced1ab891308159f7017ef5b3 (patch) | |
tree | b74794467969323967740f1745f139747071ec0d /tests | |
parent | 08bc076a0af55bb9fc6dfc48db2a0efdb35223a3 (diff) | |
download | libssh-0ec847bbe7d2db3ced1ab891308159f7017ef5b3.tar.gz libssh-0ec847bbe7d2db3ced1ab891308159f7017ef5b3.tar.xz libssh-0ec847bbe7d2db3ced1ab891308159f7017ef5b3.zip |
Added some other junk test file
Diffstat (limited to 'tests')
-rw-r--r-- | tests/chmodtest.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/chmodtest.c b/tests/chmodtest.c new file mode 100644 index 0000000..1e6f511 --- /dev/null +++ b/tests/chmodtest.c @@ -0,0 +1,33 @@ +#include <stdio.h> + +#include <libssh/libssh.h> +#include "examples_common.h" +#include <libssh/sftp.h> + +int main(void) { + ssh_session session; + sftp_session sftp; + char buffer[1024*1024]; + int rc; + + session = connect_ssh("localhost", NULL, 0); + if (session == NULL) { + return 1; + } + + sftp=sftp_new(session); + sftp_init(sftp); + rc=sftp_rename(sftp,"/tmp/test","/tmp/test"); + rc=sftp_rename(sftp,"/tmp/test","/tmp/test"); + rc=sftp_chmod(sftp,"/tmp/test",0644); + if (rc < 0) { + printf("error : %s\n",ssh_get_error(sftp)); + + ssh_disconnect(session); + return 1; + } + + ssh_disconnect(session); + + return 0; +} |