search for: newpath

Displaying 20 results from an estimated 67 matches for "newpath".

Did you mean: new_path
2003 Feb 05
2
Minor races in sftp-server.c
There are a couple of races in 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(o...
2009 Feb 12
2
[patch] hard link protocol extension for sftp
...t;link at openssh.com") == 0 && + strcmp(value, "1") == 0) { + exts |= SFTP_EXT_LINK; + known = 1; } if (known) { debug2("Server supports extension \"%s\" revision %s", @@ -731,6 +736,39 @@ do_rename(struct sftp_conn *conn, char * newpath, fx2txt(status)); return(status); +} + +int +do_link(struct sftp_conn *conn, char *oldpath, char *newpath) +{ + Buffer msg; + u_int status, id; + + buffer_init(&msg); + + /* Send link request */ + id = conn->msg_id++; + if ((conn->exts & SFTP_EXT_LINK) == 0) { + error("Serve...
2004 Apr 05
9
link(2) to rename files in sftp
Is there an alternative to using link(2) to rename files in sftp-server? Some users use sftp to upload files to a vfat partition on an sftp-server, and then renaming doesn't work. This breaks konqueror, for example (from KDE, which u), which upload files first with a ".part" extension and then renames them removing this extension.
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
2001 Jun 20
1
SFTP Logging Redux.
...LL); TRACE("rmdir id %d name %s", id, name); + log("(%d/%d/%s) Directory deleted: %s", ppid, cuid, CUNAME, name); ret = rmdir(name); status = (ret == -1) ? errno_to_portable(errno) : SSH2_FX_OK; send_status(id, status); @@ -869,6 +905,7 @@ oldpath = get_string(NULL); newpath = get_string(NULL); TRACE("rename id %d old %s new %s", id, oldpath, newpath); + log("(%d/%d/%s) File/Dir renamed: %s -> %s", ppid, cuid, CUNAME, oldpath, newpath); /* fail if 'newpath' exists */ if (stat(newpath, &st) == -1) { ret = rename(oldpath, newpa...
2002 Nov 05
0
[PATCH] Add readonly mode to scp, sftp_server
...ON_DENIED; + send_status(id, status); + return; + } TRACE("rmdir id %u name %s", id, name); ret = rmdir(name); status = (ret == -1) ? errno_to_portable(errno) : SSH2_FX_OK; *************** *** 881,886 **** --- 910,920 ---- id = get_int(); oldpath = get_string(NULL); newpath = get_string(NULL); + if (readonly) { + status = SSH2_FX_PERMISSION_DENIED; + send_status(id, status); + return; + } TRACE("rename id %u old %s new %s", id, oldpath, newpath); /* fail if 'newpath' exists */ if (stat(newpath, &st) == -1) { *************** *** 9...
2002 Mar 15
4
PATCH: sftp-server logging.
...E, status_to_logstr(status), name); ! #endif ! } else { ! status = SSH2_FX_OK; ! #ifdef SFTP_LOGGING ! log("(%d/%d/%s) Directory deleted: %s.", ppid, cuid, CUNAME, name); ! #endif ! } send_status(id, status); xfree(name); } *************** *** 885,891 **** /* fail if 'newpath' exists */ if (stat(newpath, &st) == -1) { ret = rename(oldpath, newpath); ! status = (ret == -1) ? errno_to_portable(errno) : SSH2_FX_OK; } send_status(id, status); xfree(oldpath); --- 1037,1057 ---- /* fail if 'newpath' exists */ if (stat(newpath, &st)...
2000 Aug 02
1
Re: [R] problem clipping R postscript plots within latex (PR#623)
...phics within > > > gsave/grestore instead. Sounds a bit tricky to get right. > > > > Thanks. To solve my current problem, I changed the definition of the > > `cl' operator in the postscript file to: > > > > /cl { gsave initclip newpath 3 index 3 index moveto 1 index > > 4 -1 roll lineto exch 1 index lineto lineto > > closepath clip grestore newpath } def > > > > [i.e. just adding the gsave ... grestore pair] > > > > Whether this is the proper solution th...
2007 Nov 11
1
ftp-server patch - restrict user to directory
...tus(id, errno_to_portable(errno)); + } else { + Stat s; + attrib_clear(&s.attrib); + s.name = s.long_name = resolvedname; + send_names(id, 1, &s); + } + } else + send_status(id, errno_to_portable(EPERM)); + xfree(path); } @@ -982,6 +1144,14 @@ oldpath = get_string(NULL); newpath = get_string(NULL); debug3("request %u: rename", id); + + if( ! allowed_access(oldpath, "rename") || ! allowed_access(newpath, "rename")) { /* RestrictDirectory ? */ + send_status(id, errno_to_portable(EPERM)); + xfree(oldpath); + xfree(newpath); + return; + } +...
2014 Jan 01
0
Soft chroot jail for sftp-server
...= s.long_name = jailed_resolvedname; > send_names(id, 1, &s); > } > free(jailed_resolvedname); > } > else { > s.name = s.long_name = resolvedname; > send_names(id, 1, &s); > } > 1070a1249,1250 > oldpath = jail_to_actual(oldpath); > newpath = jail_to_actual(newpath); 1131a1312 > path = jail_to_actual(path); 1156a1338,1339 > oldpath = jail_to_actual(oldpath); > newpath = jail_to_actual(newpath); 1178a1362,1363 > oldpath = jail_to_actual(oldpath); > newpath = jail_to_actual(newpath); 1198a1384 > path = jail_to_ac...
2006 Aug 19
0
[PATCH] add atomic rename extension to sftp-server
...================================= --- ssh.orig/sftp-server.c 2006-08-19 16:49:03.000000000 +0200 +++ ssh/sftp-server.c 2006-08-19 16:51:26.000000000 +0200 @@ -1087,6 +1087,23 @@ process_extended_statfs(u_int32_t id) } static void +process_extended_posix_rename(u_int32_t id) +{ + char *oldpath, *newpath; + + oldpath = get_string(NULL); + newpath = get_string(NULL); + debug3("request %u: posix-rename", id); + logit("posix-rename old \"%s\" new \"%s\"", oldpath, newpath); + if (rename(oldpath, newpath) == -1) + send_status(id, errno_to_portab...
2000 Aug 02
1
Re: [R] problem clipping R postscript plots within latex (PR#625)
...; > gsave/grestore instead. Sounds a bit tricky to get right. > > > > > > Thanks. To solve my current problem, I changed the definition of the > > > `cl' operator in the postscript file to: > > > > > > /cl { gsave initclip newpath 3 index 3 index moveto 1 index > > > 4 -1 roll lineto exch 1 index lineto lineto > > > closepath clip grestore newpath } def > > > > > > [i.e. just adding the gsave ... grestore pair] > > > > > > Whether...
2004 May 04
2
[Bug 861] Swapped parameters of SSH_FXP_SYMLINK packet of SFTP protocol
....openssh.org/txt/draft-ietf-secsh-filexfer-02.txt The SSH_FXP_SYMLINK request will create a symbolic link on the server. It is of the following format uint32 id string linkpath string targetpath The latest (CVS) sftp-server.c: 873: oldpath = get_string(NULL); 874: newpath = get_string(NULL); 875: TRACE("symlink id %u old %s new %s", id, oldpath, newpath); 876: /* this will fail if 'newpath' exists */ 877: ret = symlink(oldpath, newpath); The same bug is obviously even in OpenSSH SFTP client: The latest (CVS) sftp-client.c: 647: id = c...
2007 Dec 07
2
[PATCH] add statfs extension to sftp-server
And while we are at it, can you please comment on these patches as well, originally submitted around one year ago. Oh, and I think we can agree, that the secsh-filexfer standardization is dead, so there's not much point in trying to support newer protocol versions, which don't have statfs anyway. Thanks, Miklos ----- This is needed to be able to support statfs operation on an SSH
2019 Jan 18
0
[klibc:master] rename, renameat: Use renameat2() system call
...; <?> int mknodat(int, const char *, mode_t, dev_t); <?> int chmod(const char *, mode_t); diff --git a/usr/klibc/rename.c b/usr/klibc/rename.c index 587c26f..d76b739 100644 --- a/usr/klibc/rename.c +++ b/usr/klibc/rename.c @@ -5,7 +5,7 @@ int rename(const char *oldpath, const char *newpath) { - return renameat(AT_FDCWD, oldpath, AT_FDCWD, newpath); + return renameat2(AT_FDCWD, oldpath, AT_FDCWD, newpath, 0); } #endif /* __NR_rename */ diff --git a/usr/klibc/renameat.c b/usr/klibc/renameat.c new file mode 100644 index 0000000..10c8882 --- /dev/null +++ b/usr/klibc/renameat.c @@ -...
2016 Jun 10
1
When is PATH directive used?
Ady asked: > Have you read the "See also" section(s) of the wiki page(s)? Yes. > By reading the relevant wiki pages, a user should (_hopefully_) get to > the conclusion that the PATH directive is relevant for c32 modules, and > not a replacement for the CONFIG / INCLUDE directives nor for relative > paths based on the "Working Directory". There's nothing
2006 Mar 18
1
listing nodes in paths
Hi All, I have the following adjacency matrix for a directed graph: [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0 0 0 0 0 0 0 0 [2,] 0 0 0 0 0 0 0 0 [3,] 1 0 0 0 0 0 0 0 [4,] 0 0 1 0 0 0 0 0 [5,] 0 0 1 0 0 0 0 0 [6,] 1 1 0 0 0 0 0 0 [7,] 0 0
2002 Nov 05
0
[PATCH] Add getlink command to sftp
...lient.c@@\main\1 Tue Oct 1 17:26:20 2002 --- sftp-client.c Wed Oct 23 15:57:34 2002 *************** *** 666,672 **** status = get_status(conn->fd_in, id); if (status != SSH2_FX_OK) ! error("Couldn't rename file \"%s\" to \"%s\": %s", oldpath, newpath, fx2txt(status)); return(status); --- 666,672 ---- status = get_status(conn->fd_in, id); if (status != SSH2_FX_OK) ! error("Couldn't symlink file \"%s\" to \"%s\": %s", oldpath, newpath, fx2txt(status)); return(status); ***********...
2011 Aug 03
1
one way to solve bad looking density plots in postscript
...d? I did notice that rectangles are plotted with slightly different sizes - 50, 51, 50, 51 and so on. Is that it? After a lot of experimentation, I found that a small change in the eps file can correct the output. If in the eps file produced above, you change the line /p2 { gsave bg fill grestore newpath } def with /p2 { bg gsave fill grestore stroke newpath } def and add 0.0001 setlinewidth two lines before the next p2 - i.e. before we start plotting the rectangles of the image: change: /bg { 1 0 0 setrgb } def 59.04 73.44 41.47 37.15 r p2 to: 0.0001 setlinewidth /bg { 1 0 0 setrgb } def 59.04 73...
2000 Nov 16
1
postscript error
...le: R Graphics Output %%Creator: R Software %%Pages: (atend) %%Orientation: Landscape %%BoundingBox: 18 18 577 824 %%EndComments %%BeginProlog /gs { gsave } def /gr { grestore } def /bp { gs 595.00 0 translate 90 rotate} def /ep { showpage gr } def /m { moveto } def /l { lineto } def /np { newpath } def /cp { closepath } def /f { fill } def /o { stroke } def /c { newpath 0 360 arc } def /r { 3 index 3 index moveto 1 index 4 -1 roll lineto exch 1 index lineto lineto closepath } def /p1 { stroke } def /p2 { bg setrgbcolor fill fg setrgbcolor } def /p3 { gsave bg setrgbcolor fill g...