FreeBSD Bugzilla – Attachment 84176 Details for
Bug 120128
[libc] [patch] __getcwd erroneously returning ENOENT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
getcwd_bug.c
getcwd_bug.c (text/plain), 1.05 KB, created by
Mike Kelly
on 2009-04-10 04:27:27 UTC
(
hide
)
Description:
getcwd_bug.c
Filename:
MIME Type:
Creator:
Mike Kelly
Created:
2009-04-10 04:27:27 UTC
Size:
1.05 KB
patch
obsolete
>/* > * This is a proof-of-concept for a FreeBSD bug. > */ > >#include <stdio.h> >#include <stdlib.h> >#include <unistd.h> >#include <sys/stat.h> >#include <sys/param.h> > >int >main(int argc, char** argv) { > char path[MAXPATHLEN]; > if (-1 == mkdir("top",0755)) { > perror("mkdir \"top\""); > return(1); > } > if (-1 == mkdir("top/mine",0755)) { > perror("mkdir \"top/mine\""); > return(1); > } > if (-1 == mkdir("top/mine/tmp",0755)) { > perror("mkdir \"top/mine/tmp\""); > return(1); > } > if (-1 == chmod("top",0111)) { > perror("chmod \"top\", 0111"); > return(1); > } > if (-1 == chdir("top/mine")) { > perror("chdir \"top/mine\""); > return(1); > } > if (0 == getcwd(path,MAXPATHLEN)) { > perror("getcwd"); > return(1); > } > printf("CWD: %s\n",path); > if (-1 == rmdir("tmp")) { > perror("rmdir \"tmp\""); > return(1); > } > if (0 == getcwd(path,MAXPATHLEN)) { > perror("getcwd"); > return(1); > } > printf("CWD: %s\n",path); > > return(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 120128
:
84175
| 84176