Fix bug #8542 - smbclient posix_open command fails to return correct info on open...
authorJeremy Allison <jra@samba.org>
Sat, 22 Oct 2011 01:08:46 +0000 (18:08 -0700)
committerKarolin Seeger <kseeger@samba.org>
Tue, 1 Nov 2011 18:46:02 +0000 (19:46 +0100)
(cherry picked from commit d27f5a277ef47c5ff94e402930680b37e8f4d592)
(cherry picked from commit a7224ca5e77aa3e7d3a460515b07aa5b6cb099ae)

source3/client/client.c

index e35eb9b4c0b00025014aa11d53b6be2155db0cec..cf43171a595e8c4376f19a17559320580e79257a 100644 (file)
@@ -2305,8 +2305,8 @@ static int cmd_posix_open(void)
        }
 
        if (!NT_STATUS_IS_OK(cli_posix_open(targetcli, targetname, O_CREAT|O_RDWR, mode, &fnum))) {
-               if (!NT_STATUS_IS_OK(cli_posix_open(targetcli, targetname, O_CREAT|O_RDONLY, mode, &fnum))) {
-                       d_printf("posix_open file %s: for read/write fnum %d\n", targetname, fnum);
+               if (NT_STATUS_IS_OK(cli_posix_open(targetcli, targetname, O_CREAT|O_RDONLY, mode, &fnum))) {
+                       d_printf("posix_open file %s: for readonly fnum %d\n", targetname, fnum);
                } else {
                        d_printf("Failed to open file %s. %s\n", targetname, cli_errstr(cli));
                }