Displaying 3 results from an estimated 3 matches for "handle_to_fd".
2006 May 15
1
[PATCH 8/12] openssh-4.3p2 return code check bugs
...te(void)
}
}
}
+out:
send_status(id, status);
- xfree(data);
+ if (data)
+ xfree(data);
}
static void
@@ -539,6 +549,8 @@ process_fstat(void)
id = get_int();
handle = get_handle();
+ if (handle < 0)
+ goto out;
TRACE("fstat id %u handle %d", id, handle);
fd = handle_to_fd(handle);
if (fd >= 0) {
@@ -551,6 +563,7 @@ process_fstat(void)
status = SSH2_FX_OK;
}
}
+out:
if (status != SSH2_FX_OK)
send_status(id, status);
}
@@ -614,6 +627,10 @@ process_fsetstat(void)
id = get_int();
handle = get_handle();
+ if (handle < 0) {
+ status = SSH2_F...
2013 Oct 14
0
[PATCH-resend] Implement SSH2_FXF_APPEND
..., DIR *dirp)
{
int i;
@@ -220,6 +225,7 @@ handle_new(int use, const char *name, in
handles[i].use = use;
handles[i].dirp = dirp;
handles[i].fd = fd;
+ handles[i].flags = flags;
handles[i].name = xstrdup(name);
handles[i].bytes_read = handles[i].bytes_write = 0;
@@ -282,6 +288,14 @@ handle_to_fd(int handle)
return -1;
}
+static int
+handle_to_flags(int handle)
+{
+ if (handle_is_ok(handle, HANDLE_FILE))
+ return handles[handle].flags;
+ return -1;
+}
+
static void
handle_update_read(int handle, ssize_t bytes)
{
@@ -567,7 +581,7 @@ process_open(void)
if (fd < 0) {
status...
2001 Jun 20
1
SFTP Logging Redux.
...%s) Permissions altered: %s (%04o).", ppid, cuid, CUNAME, name, a->perm & 0777);
if (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) {
ret = chmod(name, a->perm & 0777);
if (ret == -1)
@@ -623,6 +655,7 @@
TRACE("fsetstat id %d handle %d", id, handle);
fd = handle_to_fd(handle);
name = handle_to_name(handle);
+ log("(%d/%d/%s) Permissions altered: %s (%04o).", ppid, cuid, CUNAME, name, a->perm & 0777);
if (fd < 0 || name == NULL) {
status = SSH2_FX_FAILURE;
} else {
@@ -790,6 +823,7 @@
id = get_int();
name = get_string(NULL);
TRA...