The Samba-Bugzilla – Attachment 3914 Details for
Bug 6090
renaming or deleting a "not matching/resolving" symlink is failing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
test program.
testlink.c (text/plain), 2.03 KB, created by
Jeremy Allison
on 2009-02-04 17:21:06 UTC
(
hide
)
Description:
test program.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2009-02-04 17:21:06 UTC
Size:
2.03 KB
patch
obsolete
>#include <stdio.h> >#include <unistd.h> >#include <sys/types.h> >#include <sys/stat.h> >#include <fcntl.h> >#include <string.h> > > >int main(int argc, char** argv) >{ > int ret1, ret2; > char dir[200] = "test"; > char file1[200]; > char file2[200]; > char file3[200]; > > if (argc > 1) > strcpy(dir, argv[1]); > > sprintf(file1, "%s/test1", dir); /* e.g test/test1 */ > sprintf(file2, "%s/test2", dir); /* e.g test/test2 */ > sprintf(file3, "%s/test3", dir); /* e.g test/test3 */ > > mkdir(dir, 0777); > > ret1 = symlink(file1, file2); > if (ret1 == -1) > perror("symlink() failed: "); > > ret2 = rename(file2, file3); > if (ret2 == -1) > perror("rename() failed: "); > > printf("Returns %d,%d\n",ret1,ret2); > > return 0; > > >} > > >/* >rename("plc_vpn/.svn/tmp/prop-base/plc_static.key.svn-base", "plc_vpn/.svn/prop-base/plc_static.key.svn-base") = 0 >lstat("plc_vpn/.svn/prop-base/plc_static.key.svn-base", {st_mode=S_IFREG|0644, st_size=27, ...}) = 0 >chmod("plc_vpn/.svn/prop-base/plc_static.key.svn-base", 0444) = 0 >open("plc_vpn/.svn/prop-base/plc_static.key.svn-base", O_RDONLY) = 6 >read(6, "K 11\nsvn:special\nV 1\n*\nEND\n", 4096) = 27 >close(6) = 0 >open("plc_vpn/.svn/prop-base/plc_static.key.svn-base", O_RDONLY) = 6 >read(6, "K 11\nsvn:special\nV 1\n*\nEND\n", 4096) = 27 >close(6) = 0 >lstat("plc_vpn/.svn/tmp/text-base/plc_static.key.svn-base", {st_mode=S_IFREG|0644, st_size=20, ...}) = 0 >lstat("plc_vpn/.svn/tmp/text-base/plc_static.key.svn-base", {st_mode=S_IFREG|0644, st_size=20, ...}) = 0 >open("plc_vpn/.svn/tmp/text-base/plc_static.key.svn-base", O_RDONLY) = 6 >read(6, "link plc_static2.key", 16384) = 20 >read(6, "", 16384) = 0 >close(6) = 0 >symlink("plc_static2.key", "plc_vpn/plc_static.key.tmp") = 0 >rename("plc_vpn/plc_static.key.tmp", "plc_vpn/plc_static.key") = -1 ENOENT (No such file or directory) >write(3, "\25\3\1\0 \377w\355\20\306Ry?PCEt9\202\255\376\17\353"..., 37) = 37 >close(3) = 0 >close(4) = 0 >*/
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 6090
: 3914 |
3915
|
3916