Displaying 20 results from an estimated 28 matches for "get_int".
Did you mean:
set_int
2001 May 24
1
chroot sftp-server [PATCH]
I'm working on setting up a semi-trusted sftp service, and to get it
working, I need chroot capability.
I've taken the /./ wuftpd magic token code from contrib/chroot.diff and
put it into the sftp server. The main problem is that privileges have
been dropped by the time the subsystem is exec'ed, so my patch requires
that sftp-server be setuid root. Not ideal, I know, but I drop all
2002 Nov 05
0
[PATCH] Add readonly mode to scp, sftp_server
...ue Nov 5 10:07:54 2002
***************
*** 52,57 ****
--- 52,60 ----
/* Version of client */
int version;
+ /* deny client write operations */
+ int readonly = 0;
+
/* portable attibutes, etc. */
typedef struct Stat Stat;
***************
*** 390,395 ****
--- 393,404 ----
pflags = get_int(); /* portable flags */
a = get_attrib();
flags = flags_from_portable(pflags);
+ if (((flags & O_ACCMODE) == O_RDWR) ||
+ ((flags & O_ACCMODE) == O_WRONLY)) {
+ status = SSH2_FX_PERMISSION_DENIED;
+ send_status(id, status);
+ return;
+ }
mode = (a->flags & SSH2_FI...
2006 May 15
1
[PATCH 8/12] openssh-4.3p2 return code check bugs
...25 insertions(+), 2 deletions(-)
diff -uprN openssh-4.3p2/sftp-server.c openssh-4.3p2-kylie/sftp-server.c
--- openssh-4.3p2/sftp-server.c 2006-01-02 06:40:51.000000000 -0600
+++ openssh-4.3p2-kylie/sftp-server.c 2006-05-08 15:42:04.795120304 -0500
@@ -408,9 +408,12 @@ process_close(void)
id = get_int();
handle = get_handle();
+ if (handle < 0)
+ goto out;
TRACE("close id %u handle %d", id, handle);
ret = handle_close(handle);
status = (ret == -1) ? errno_to_portable(errno) : SSH2_FX_OK;
+out:
send_status(id, status);
}
@@ -424,6 +427,8 @@ process_read(void)
id = g...
2014 Jun 29
2
[LLVMdev] Wrong behavior modifying and executing llvm::Function with JIT Engine
...ways get the output from the first iteration for all the
>> iterations.
>>
>> This is what I do:
>>
>>
>> I generate the following 2 functions on the fly based on the FunctionType
>> of the declaration below in C code.
>>
>>
>> define i32 @get_int_5(i32, i32) #1 {
>> ret i32 5
>> }
>>
>> define i32 @get_int_10(i32, i32) #1 {
>> ret i32 10
>> }
>>
>> I have the following C code:
>>
>>
>> // This is only a declaration
>> // I use this FunctionType to generate the funct...
2009 Feb 12
2
[patch 1/3] add protocol extension to ATTR message
...t->st_rdev = a->rdev;
+ if (a->ext_flags & SSH2_FXE_EXTATTR_BLKSIZE)
+ st->st_blksize = a->blksize;
+ if (a->ext_flags & SSH2_FXE_EXTATTR_BLOCKS)
+ st->st_blocks = a->blocks;
+}
+
+static void
+decode_extra_attrib(Buffer *b, Attrib *a)
+{
+ a->ext_flags = buffer_get_int(b);
+ if (a->ext_flags & SSH2_FXE_EXTATTR_DEV)
+ a->dev = buffer_get_int64(b);
+ if (a->ext_flags & SSH2_FXE_EXTATTR_INO)
+ a->ino = buffer_get_int64(b);
+ if (a->ext_flags & SSH2_FXE_EXTATTR_NLINK)
+ a->nlink = buffer_get_int(b);
+ if (a->ext_flags & SSH2_FX...
2001 Jun 20
1
SFTP Logging Redux.
...psflags++;
+ if (pflags & SSH2_FXF_CREAT)
+ *psflags = 'c';
+ psflags++;
+ if (pflags & SSH2_FXF_TRUNC)
+ *psflags = 't';
+ psflags++;
+ if (pflags & SSH2_FXF_EXCL)
+ *psflags = 'e';
+}
+
Attrib *
get_attrib(void)
{
@@ -370,6 +398,7 @@
version = buffer_get_int(&iqueue);
TRACE("client version %d", version);
+ log("(%d/%d/%s) Client version %d", ppid, cuid, CUNAME, version);
buffer_init(&msg);
buffer_put_char(&msg, SSH2_FXP_VERSION);
buffer_put_int(&msg, SSH2_FILEXFER_VERSION);
@@ -382,7 +411,7 @@
{
u_int32_t...
2007 Nov 11
1
ftp-server patch - restrict user to directory
...#include <stdio.h>
#include <string.h>
-#include <pwd.h>
#include <time.h>
#include <unistd.h>
#include <stdarg.h>
@@ -44,6 +43,7 @@
#include "sftp.h"
#include "sftp-common.h"
+#include "pathnames.h"
/* helper */
#define get_int64() buffer_get_int64(&iqueue);
@@ -74,6 +74,141 @@
Attrib attrib;
};
+/* Name of the server configuration file. */
+char *config_file_name = _PATH_SFTP_CONFIG_FILE;
+
+/* If not NULL restrict the user to under this directory */
+char* RestrictDirectory;
+
+/* **** Start parsing config fi...
2014 Jun 29
2
[LLVMdev] Wrong behavior modifying and executing llvm::Function with JIT Engine
...AllUsesWith' and then execute it with the JIT engine
several times but I always get the output from the first iteration for
all the iterations.
This is what I do:
I generate the following 2 functions on the fly based on the
FunctionType of the declaration below in C code.
define i32 @get_int_5(i32, i32) #1 {
ret i32 5
}
define i32 @get_int_10(i32, i32) #1 {
ret i32 10
}
I have the following C code:
// This is only a declaration
// I use this FunctionType to generate the functions above
int sum(int a, int b);
int get_int()
{
re...
2003 Feb 05
2
Minor races in sftp-server.c
...sftp-server as this patch shows:
--- sftp-server.c 28 Jan 2003 18:06:53 -0000 1.1.1.2
+++ sftp-server.c 5 Feb 2003 19:19:42 -0000
@@ -832,19 +832,22 @@
process_rename(void)
{
u_int32_t id;
- struct stat st;
char *oldpath, *newpath;
- int ret, status = SSH2_FX_FAILURE;
+ int status;
id = get_int();
oldpath = get_string(NULL);
newpath = get_string(NULL);
TRACE("rename id %u old %s new %s", id, oldpath, newpath);
/* fail if 'newpath' exists */
- if (stat(newpath, &st) == -1) {
- ret = rename(oldpath, newpath);
- status = (ret == -1) ? errno_to_portable(errno)...
2012 Oct 23
4
Disable rm on sftp
...he file. This will be used to store logs so, I
need to make sure once the logs written to my server the user cannot remove
it.
I tried doing this by changing the code of process_remove from:
static void
process_remove(void)
{
char *name;
u_int32_t id;
int status = SSH2_FX_FAILURE;
int ret;
id = get_int();
name = get_string(NULL);
debug3("request %u: remove", id);
logit("remove name \"%s\"", name);
if (readonly)
status = SSH2_FX_PERMISSION_DENIED;
else {
ret = unlink(name);
status = (ret == -1) ? errno_to_portable(errno) : SSH2_FX_OK;
}
send_status(id, status);
xfree(...
2007 Jan 30
2
error finding library when running test program
...ns/wxwin.ico"))
else
set_icon(Wx::Icon.new("./icons/wxwin16x16.xpm"))
end
show(true) #true is the default value, so it may be left off
end
def on_change_icon(event)
if Wx::RUBY_PLATFORM == "WXMSW"
case event.get_int
when 0
set_icon(Wx::Icon.new("./icons/wxwin.ico"))
when 1
set_icon(Wx::Icon.new("./icons/mondrian.ico"))
when 2
set_icon(Wx::Icon.new("./icons/ogl.ico"))...
2020 Jun 01
1
[PATCH] erlang: Port to libei for Erlang 23
...g (const char *funname, ETERM *optargname);
-extern ETERM *unknown_function (ETERM *fun);
-extern ETERM *make_string_list (char **r);
-extern ETERM *make_table (char **r);
-extern ETERM *make_bool (int r);
-extern char **get_string_list (ETERM *term);
-extern int get_bool (ETERM *term);
-extern int get_int (ETERM *term);
-extern int64_t get_int64 (ETERM *term);
-
/* This stops things getting out of hand, but also lets us detect
* protocol problems quickly.
*/
#define MAX_MESSAGE_SIZE (32*1024*1024)
-static unsigned char *read_message (void);
-static void write_reply (ETERM *);
+static char *r...
2002 Mar 15
4
PATCH: sftp-server logging.
...9;;
+ psflags++;
+ if (pflags & SSH2_FXF_TRUNC)
+ *psflags = 't';
+ psflags++;
+ if (pflags & SSH2_FXF_EXCL)
+ *psflags = 'e';
+ return;
+ }
+ #endif
+
static Attrib *
get_attrib(void)
{
***************
*** 370,375 ****
--- 423,431 ----
version = buffer_get_int(&iqueue);
TRACE("client version %d", version);
+ #ifdef SFTP_LOGGING
+ log("(%d/%d/%s) Client version %d.", ppid, cuid, CUNAME, version);
+ #endif
buffer_init(&msg);
buffer_put_char(&msg, SSH2_FXP_VERSION);
buffer_put_int(&msg, SSH2_FILEXFER_VERSION)...
2001 Dec 18
1
chroot howto for sftp-server
...it's better to use a dummy shell.
5 The Patch:
============
(diff against 3.0.1)
--- sftp-server.c Tue Jul 31 14:42:50 2001
+++ sftp-server.c~ Fri Nov 23 10:56:48 2001
@@ -33,6 +33,8 @@
#include "sftp.h"
#include "sftp-common.h"
+#define CHROOT
+
/* helper */
#define get_int64() buffer_get_int64(&iqueue);
#define get_int() buffer_get_int(&iqueue);
@@ -1008,6 +1010,36 @@
}
}
+#ifdef CHROOT
+void
+chroot_init(void)
+{
+ char *user_dir, *new_root;
+
+ user_dir = getenv("HOME");
+
+ if (!user_dir)
+ fatal("HOME isn't in environment&quo...
2007 Sep 20
7
Troubles with ListBox and CheckListBox events
...ed or unchecked.
- event.checked? doesn''t tell whether the item is checked or not
(see the ommented line). I had to go through the CheckListBox object
and calls checked? with the index (see the uncommented line).
=> Question :
The wxRuby documentation states that :
"CommandEvent#get_int
Integer get_int()
Returns the integer identifier corresponding to a listbox, choice or
radiobox selection (only if the event was a selection, not a
deselection), or a boolean value representing the value of a
checkbox."
Are int and selection synonyms or is one of them is the normal way for
ac...
2017 Mar 03
1
[PATCH] erlang: Rename 'message' to something less generic.
...message);
+extern ETERM *dispatch (ETERM *args_tuple);
extern int atom_equals (ETERM *atom, const char *name);
extern ETERM *make_error (const char *funname);
extern ETERM *unknown_optarg (const char *funname, ETERM *optargname);
@@ -205,7 +205,7 @@ extern int get_bool (ETERM *term);
extern int get_int (ETERM *term);
extern int64_t get_int64 (ETERM *term);
-#define ARG(i) (ERL_TUPLE_ELEMENT(message,(i)+1))
+#define ARG(i) (ERL_TUPLE_ELEMENT(args_tuple,(i)+1))
";
@@ -229,7 +229,7 @@ extern int64_t get_int64 (ETERM *term);
List.iter (
fun { name = name } ->
- pr "...
2003 Aug 16
0
sftp-server (secure) chroot patch, comment fix
...-
#include "sftp.h"
#include "sftp-common.h"
+#ifdef CHROOT
+#include "uidswap.h"
+#include <pwd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <unistd.h>
+#endif /* CHROOT */
+
/* helper */
#define get_int64() buffer_get_int64(&iqueue);
#define get_int() buffer_get_int(&iqueue);
@@ -62,6 +71,51 @@
Attrib attrib;
};
+#ifdef CHROOT
+static void
+chroot_init(void)
+{
+ gid_t gidset[1];
+ struct passwd *pw;
+ struct stat st;
+
+ /* Sanity checking before chroot */
+ if ((pw = getpwuid(g...
2004 Oct 25
1
Bug in sftp's chmod
Hi,
I've discovered that on OpenSSH_3.6.1p1 (the latest SSH available on
OSX, but I've also tried a couple of different linux distributions),
when you 'sftp' to it, and try to 'chmod' some file or directory, only
last three octal digits do actually matter.
Example:
sftp sshtest at localhost
Connecting to localhost...
sshtest at localhost's password:
sftp> ls -l
2006 Aug 17
0
[RFC] proposed extensions for SFTP
...atvfs", id);
+ verbose("statvfs \"%s\"", path);
+
+ ret = statvfs(path, &st);
+ if (ret == -1)
+ send_status(id, errno_to_portable(errno));
+ else
+ send_statvfs(id, &st);
+}
+
+static void
process_extended(void)
{
u_int32_t id;
@@ -1056,7 +1104,10 @@
id = get_int();
request = get_string(NULL);
- send_status(id, SSH2_FX_OP_UNSUPPORTED); /* MUST */
+ if (strcmp(request, "statvfs at openssh.org") == 0)
+ process_extended_statvfs(id);
+ else
+ send_status(id, SSH2_FX_OP_UNSUPPORTED); /* MUST */
xfree(request);
}
Index: sftp.h
===============...
2006 Aug 19
0
[PATCH] add statfs extension to sftp-server
..."%s\"", path);
+
+ ret = statfs(path, &st);
+ if (ret == -1)
+ send_status(id, errno_to_portable(errno));
+ else
+ send_statfs(id, &st);
+ xfree(path);
+}
+
+static void
process_extended(void)
{
u_int32_t id;
@@ -1056,7 +1094,10 @@ process_extended(void)
id = get_int();
request = get_string(NULL);
- send_status(id, SSH2_FX_OP_UNSUPPORTED); /* MUST */
+ if (strcmp(request, "statfs at openssh.org") == 0)
+ process_extended_statfs(id);
+ else
+ send_status(id, SSH2_FX_OP_UNSUPPORTED); /* MUST */
xfree(request);
}