author | Jan Parcel <jan.parcel@oracle.com> |
Mon, 01 Feb 2016 06:53:50 -0800 | |
changeset 5376 | 4615bc2f4a50 |
parent 4503 | bf30d46ab06e |
child 5819 | c5f05bd2a9bc |
permissions | -rw-r--r-- |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
1 |
# |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
2 |
# This patch is to provide a SFTP DTrace provider which offers an administrator |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
3 |
# some observability of SFTP data transfer. This was developed in-house. |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
4 |
# Because this is Solaris-specific and not suitable for upstream, we will not |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
5 |
# contribute the changes to the upstream community. |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
6 |
# |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
7 |
diff -pur old/Makefile.in new/Makefile.in |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
8 |
--- old/Makefile.in 2015-03-28 14:10:39.426859283 +0100 |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
9 |
+++ new/Makefile.in 2015-03-28 14:16:12.472203388 +0100 |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
10 |
@@ -26,6 +26,7 @@ ASKPASS_PROGRAM=$(libexecdir)/ssh-askpas |
3820
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
11 |
SFTP_SERVER=$(libexecdir)/sftp-server |
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
12 |
SSH_KEYSIGN=$(libexecdir)/ssh-keysign |
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
13 |
SSH_PKCS11_HELPER=$(libexecdir)/ssh-pkcs11-helper |
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
14 |
+ROOTDLIBDIR64=$(DESTDIR)/usr/lib/dtrace/64 |
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
15 |
PRIVSEP_PATH=@PRIVSEP_PATH@ |
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
16 |
SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@ |
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
17 |
STRIP_OPT=@STRIP_OPT@ |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
18 |
@@ -85,6 +86,7 @@ LIBSSH_OBJS=${LIBOPENSSH_OBJS} \ |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
19 |
atomicio.o key.o dispatch.o mac.o uidswap.o uuencode.o misc.o \ |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
20 |
monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \ |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
21 |
msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \ |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
22 |
+ sftp_provider.o \ |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
23 |
ssh-pkcs11.o smult_curve25519_ref.o \ |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
24 |
poly1305.o chacha.o cipher-chachapoly.o \ |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
25 |
ssh-ed25519.o digest-openssl.o digest-libc.o hmac.o \ |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
26 |
@@ -110,7 +112,7 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passw |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
27 |
sftp-server.o sftp-common.o \ |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
28 |
roaming_common.o roaming_serv.o \ |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
29 |
sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \ |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
30 |
- sandbox-seccomp-filter.o sandbox-capsicum.o |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
31 |
+ sandbox-seccomp-filter.o sandbox-capsicum.o sftp_provider.o |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
32 |
|
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
33 |
MANPAGES = moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-keysign.8.out ssh-pkcs11-helper.8.out sshd_config.5.out ssh_config.5.out |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
34 |
MANPAGES_IN = moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-keysign.8 ssh-pkcs11-helper.8 sshd_config.5 ssh_config.5 |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
35 |
@@ -187,8 +189,8 @@ ssh-pkcs11-helper$(EXEEXT): $(LIBCOMPAT) |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
36 |
ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o roaming_dummy.o |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
37 |
$(LD) -o $@ ssh-keyscan.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
38 |
|
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
39 |
-sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o sftp-server-main.o |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
40 |
- $(LD) -o $@ sftp-server.o sftp-common.o sftp-server-main.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
41 |
+sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o sftp-server-main.o sftp_provider.o |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
42 |
+ $(LD) -o $@ sftp-server.o sftp-common.o sftp-server-main.o sftp_provider.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
43 |
|
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
44 |
sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
45 |
$(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT) |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
46 |
@@ -225,9 +227,18 @@ umac128.o: umac.c |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
47 |
-Dumac_update=umac128_update -Dumac_final=umac128_final \ |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
48 |
-Dumac_delete=umac128_delete |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
49 |
|
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
50 |
+# dtrace sftp |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
51 |
+sftp_provider.h: $(srcdir)/sftp_provider.d |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
52 |
+ /usr/sbin/dtrace -xnolibs -h -s $(srcdir)/sftp_provider.d \ |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
53 |
+ -o $(srcdir)/sftp_provider.h |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
54 |
+ |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
55 |
+sftp_provider.o: sftp_provider.d sftp_provider.h sftp-server.o |
2196
2063c1da2a7a
18163120 deliver OpenSSH in 64bit mode
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
1862
diff
changeset
|
56 |
+ /usr/sbin/dtrace -G -64 -xnolibs -s $(srcdir)/sftp_provider.d \ |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
57 |
+ sftp-server.o -o sftp_provider.o |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
58 |
+ |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
59 |
clean: regressclean |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
60 |
rm -f *.o *.a $(TARGETS) logintest config.cache config.log |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
61 |
- rm -f *.out core survey |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
62 |
+ rm -f *.out core survey sftp_provider.h |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
63 |
rm -f regress/unittests/test_helper/*.a |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
64 |
rm -f regress/unittests/test_helper/*.o |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
65 |
rm -f regress/unittests/sshbuf/*.o |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
66 |
@@ -340,6 +351,7 @@ install-files: |
3820
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
67 |
ln -s ./ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin |
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
68 |
-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
69 |
ln -s ./ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
70 |
+ mkdir -p $(ROOTDLIBDIR64) && cp $(srcdir)/sftp64.d $(ROOTDLIBDIR64)/sftp64.d |
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
71 |
|
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
72 |
install-sysconf: |
1063fcafa7a5
20397201 /usr/lib/dtrace/sftp.d should be a mediated link in OPENSSH and link to sftp64.d
kavya.racharla@oracle.com <kavya.racharla@oracle.com>
parents:
2196
diff
changeset
|
73 |
if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \ |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
74 |
diff -pur old/sftp-server.c new/sftp-server.c |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
75 |
--- old/sftp-server.c 2015-03-17 06:49:20.000000000 +0100 |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
76 |
+++ new/sftp-server.c 2015-03-28 14:27:55.661510029 +0100 |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
77 |
@@ -55,6 +55,9 @@ |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
78 |
|
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
79 |
#include "sftp.h" |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
80 |
#include "sftp-common.h" |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
81 |
+#ifdef DTRACE_SFTP |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
82 |
+#include "sftp_provider_impl.h" |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
83 |
+#endif |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
84 |
|
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
85 |
/* Our verbosity */ |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
86 |
static LogLevel log_level = SYSLOG_LEVEL_ERROR; |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
87 |
@@ -741,14 +744,17 @@ process_read(u_int32_t id) |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
88 |
u_int32_t len; |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
89 |
int r, handle, fd, ret, status = SSH2_FX_FAILURE; |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
90 |
u_int64_t off; |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
91 |
+ char *fpath; |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
92 |
|
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
93 |
if ((r = get_handle(iqueue, &handle)) != 0 || |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
94 |
(r = sshbuf_get_u64(iqueue, &off)) != 0 || |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
95 |
(r = sshbuf_get_u32(iqueue, &len)) != 0) |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
96 |
fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
97 |
|
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
98 |
- debug("request %u: read \"%s\" (handle %d) off %llu len %d", |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
99 |
- id, handle_to_name(handle), handle, (unsigned long long)off, len); |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
100 |
+ fpath = handle_to_name(handle); |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
101 |
+ |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
102 |
+ debug("request %u: read \"%s\" (handle %d) off %llu len %d", |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
103 |
+ id, fpath, handle, (unsigned long long)off, len); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
104 |
if (len > sizeof buf) { |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
105 |
len = sizeof buf; |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
106 |
debug2("read change len %d", len); |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
107 |
@@ -759,7 +765,13 @@ process_read(u_int32_t id) |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
108 |
error("process_read: seek failed"); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
109 |
status = errno_to_portable(errno); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
110 |
} else { |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
111 |
+#ifdef DTRACE_SFTP |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
112 |
+ SFTP_TRANSFER_START_OP("read", fd, fpath, len); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
113 |
+#endif |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
114 |
ret = read(fd, buf, len); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
115 |
+#ifdef DTRACE_SFTP |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
116 |
+ SFTP_TRANSFER_DONE_OP("read", fd, fpath, ret); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
117 |
+#endif |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
118 |
if (ret < 0) { |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
119 |
status = errno_to_portable(errno); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
120 |
} else if (ret == 0) { |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
121 |
@@ -782,14 +794,16 @@ process_write(u_int32_t id) |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
122 |
size_t len; |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
123 |
int r, handle, fd, ret, status; |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
124 |
u_char *data; |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
125 |
+ char *fpath; |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
126 |
|
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
127 |
if ((r = get_handle(iqueue, &handle)) != 0 || |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
128 |
(r = sshbuf_get_u64(iqueue, &off)) != 0 || |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
129 |
(r = sshbuf_get_string(iqueue, &data, &len)) != 0) |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
130 |
fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
131 |
|
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
132 |
+ fpath = handle_to_name(handle); |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
133 |
debug("request %u: write \"%s\" (handle %d) off %llu len %zu", |
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
134 |
- id, handle_to_name(handle), handle, (unsigned long long)off, len); |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
135 |
+ id, fpath, handle, (unsigned long long)off, len); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
136 |
fd = handle_to_fd(handle); |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
137 |
|
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
138 |
if (fd < 0) |
4503
bf30d46ab06e
PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
3820
diff
changeset
|
139 |
@@ -801,7 +815,14 @@ process_write(u_int32_t id) |
1862
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
140 |
error("process_write: seek failed"); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
141 |
} else { |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
142 |
/* XXX ATOMICIO ? */ |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
143 |
+#ifdef DTRACE_SFTP |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
144 |
+ SFTP_TRANSFER_START_OP("write", fd, fpath, len); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
145 |
+#endif |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
146 |
ret = write(fd, data, len); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
147 |
+#ifdef DTRACE_SFTP |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
148 |
+ SFTP_TRANSFER_DONE_OP("write", fd, fpath, ret); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
149 |
+#endif |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
150 |
+ |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
151 |
if (ret < 0) { |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
152 |
error("process_write: write failed"); |
753bed6dd354
18127340 migrate the sftp dtrace provider feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff
changeset
|
153 |
status = errno_to_portable(errno); |