Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 913633 Details for
Bug 1114814
[gfapi] In object handle based implementation, `..' should refer to root itself when lookupat is called on root
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
test case
rootbug.c (text/x-csrc), 3.80 KB, created by
Ravishankar N
on 2014-07-01 05:14:19 UTC
(
hide
)
Description:
test case
Filename:
MIME Type:
Creator:
Ravishankar N
Created:
2014-07-01 05:14:19 UTC
Size:
3.80 KB
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> >#include <errno.h> >#include <api/glfs.h> >#include <api/glfs-handles.h> >#include <string.h> >#include <time.h> > >//gcc -ggdb -I /usr/local/include/glusterfs/ -L /usr/local/lib -l gfapi rootbug.c -o rootbug > >static void >peek_stat (struct stat *sb, char*file) >{ > printf ("\n+++++++ Dumping stat information for:\"%s\" +++++++++++++\n",file); > printf ("File type: "); > > switch (sb->st_mode & S_IFMT) { > case S_IFBLK: printf ("block device\n"); break; > case S_IFCHR: printf ("character device\n"); break; > case S_IFDIR: printf ("directory\n"); break; > case S_IFIFO: printf ("FIFO/pipe\n"); break; > case S_IFLNK: printf ("symlink\n"); break; > case S_IFREG: printf ("regular file\n"); break; > case S_IFSOCK: printf ("socket\n"); break; > default: printf ("unknown?\n"); break; > } > > printf ("I-node number: %lu\n", (long) sb->st_ino); > > printf ("Mode: %lo (octal)\n", > (unsigned long) sb->st_mode); > > printf ("Link count: %ld\n", (long) sb->st_nlink); > printf ("Ownership: UID=%ld GID=%ld\n", > (long) sb->st_uid, (long) sb->st_gid); > > printf ("Preferred I/O block size: %ld bytes\n", > (long) sb->st_blksize); > printf ("File size: %lld bytes\n", > (long long) sb->st_size); > printf ("Blocks allocated: %lld\n", > (long long) sb->st_blocks); > > printf ("Last status change: %s", ctime(&sb->st_ctime)); > printf ("Last file access: %s", ctime(&sb->st_atime)); > printf ("Last file modification: %s", ctime(&sb->st_mtime)); > > return; >} > >int >main (int argc, char *argv[]) >{ > int ret = 0; > struct stat sb = {0, }; > glfs_t *fs = NULL; > struct glfs_object *root = NULL, *tobj = NULL; > > if (argc != 3) { > printf ("Expect following args\n\t%s <volname> <hostname>\n", argv[0]); > return -1; > } > > fs = glfs_new (argv[1]); > if (!fs) { > fprintf (stdout, "glfs_new: returned NULL\n"); > return 1; > } > > ret = glfs_set_volfile_server (fs, "tcp", argv[2], 24007); > ret = glfs_set_logging (fs, "/dev/stderr", 7); > ret = glfs_init (fs); > if (ret != 0) { > printf("Unable to init filesystem\n"); > return 1; > } > > root = glfs_h_lookupat (fs, NULL, "/", &sb); > if (root == NULL) { > fprintf (stdout, "glfs_h_lookupat: error on lookup of %s: from (%p),%s\n", > "/", NULL, strerror (errno)); > printf ("glfs_h_lookupat tests: FAILED\n"); > return errno; > } > peek_stat (&sb, "NULL + /"); > > tobj = glfs_h_lookupat (fs, root, "..", &sb); > if (tobj == NULL) { > fprintf(stdout, "glfs_h_lookupat: error on lookup of " > "%s(EXPECTED, PASS): from (%p), %s\n", "..", root, > strerror(errno)); > return errno; > } > peek_stat (&sb,"root + .."); > > tobj = glfs_h_lookupat (fs, NULL, "/..", &sb); > if (tobj == NULL) { > fprintf(stdout, "glfs_h_lookupat: error on lookup of " > "%s(EXPECTED, PASS): from (%p), %s\n", "/..",NULL, > strerror(errno)); > return errno; > } > peek_stat (&sb,"NULL + /.."); > > > return errno; >}
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 1114814
: 913633