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 686003 Details for
Bug 896612
rpc.ypxfrd doesn't support the needed database type
[?]
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.
[patch]
Fix mode when opening Tokyo Cabinet files
ypserv-2.29-dbopen.patch (text/plain), 4.75 KB, created by
Honza Horak
on 2013-01-23 15:26:23 UTC
(
hide
)
Description:
Fix mode when opening Tokyo Cabinet files
Filename:
MIME Type:
Creator:
Honza Horak
Created:
2013-01-23 15:26:23 UTC
Size:
4.75 KB
patch
obsolete
>diff -up ypserv-2.29/lib/yp_db.c.dbopen ypserv-2.29/lib/yp_db.c >--- ypserv-2.29/lib/yp_db.c.dbopen 2012-05-30 13:28:49.000000000 +0200 >+++ ypserv-2.29/lib/yp_db.c 2013-01-23 16:11:32.116224180 +0100 >@@ -173,11 +173,14 @@ _db_open (const char *domain, const char > sprintf (buf, "%s/%s", domain, map); > > dbp = tcbdbnew (); >- isok = tcbdbopen (dbp, buf, BDBOREADER); >+ isok = tcbdbopen (dbp, buf, BDBOREADER | BDBONOLCK); > > if (debug_flag && !isok) >- log_msg ("tcbdbopen: Tokyo Cabinet Error: %s", >- tcbdberrmsg (tcbdbecode (dbp))); >+ { >+ log_msg ("tcbdbopen: Tokyo Cabinet Error: %s", >+ tcbdberrmsg (tcbdbecode (dbp))); >+ log_msg ("tcbdbopen: consider rebuilding maps using ypinit"); >+ } > else if (debug_flag) > log_msg ("\t\t->Returning OK!"); > } >diff -up ypserv-2.29/makedbm/makedbm.c.dbopen ypserv-2.29/makedbm/makedbm.c >--- ypserv-2.29/makedbm/makedbm.c.dbopen 2012-05-30 13:28:49.000000000 +0200 >+++ ypserv-2.29/makedbm/makedbm.c 2013-01-23 16:13:32.896215921 +0100 >@@ -490,6 +490,9 @@ create_file (char *fileName, char *dbmNa > #endif > #else > unlink (dbmName); >+#if defined(HAVE_LIBTC) >+ chmod(filename, S_IRUSR|S_IWUSR); >+#endif > rename (filename, dbmName); > #endif > free (filename); >@@ -517,6 +520,7 @@ dump_file (char *dbmName) > if (dbm == NULL) > { > fprintf (stderr, "makedbm: Cannot open %s\n", dbmName); >+ fprintf (stderr, "makedbm: Consider rebuilding maps using ypinit\n"); > exit (1); > } > #if defined(HAVE_COMPAT_LIBGDBM) >diff -up ypserv-2.29/yphelper/yphelper.c.dbopen ypserv-2.29/yphelper/yphelper.c >--- ypserv-2.29/yphelper/yphelper.c.dbopen 2012-05-30 13:28:50.000000000 +0200 >+++ ypserv-2.29/yphelper/yphelper.c 2013-01-23 16:11:32.117224180 +0100 >@@ -507,10 +507,10 @@ get_dbm_entry (char *key, char *map, cha > #if defined(HAVE_COMPAT_LIBGDBM) > dbm = gdbm_open (mappath, 0, GDBM_READER, 0600, NULL); > #elif defined(HAVE_NDBM) >- dbm = dbm_open (mappath, O_CREAT | O_RDWR, 0600); >+ dbm = dbm_open (mappath, O_RDONLY, 0600); > #elif defined(HAVE_LIBTC) > dbm = tcbdbnew(); >- if (!tcbdbopen(dbm, mappath, BDBOWRITER | BDBOCREAT)) >+ if (!tcbdbopen(dbm, mappath, BDBOREADER)) > { > tcbdbdel(dbm); > dbm = NULL; >@@ -519,6 +519,7 @@ get_dbm_entry (char *key, char *map, cha > if (dbm == NULL) > { > fprintf (stderr, "yphelper: cannot open %s\n", mappath); >+ fprintf (stderr, "yphelper: consider rebuilding maps using ypinit\n", mappath); > exit (1); > } > >diff -up ypserv-2.29/yppush/yppush.c.dbopen ypserv-2.29/yppush/yppush.c >--- ypserv-2.29/yppush/yppush.c.dbopen 2012-08-30 09:53:16.000000000 +0200 >+++ ypserv-2.29/yppush/yppush.c 2013-01-23 16:11:32.117224180 +0100 >@@ -290,10 +290,10 @@ get_dbm_entry (char *key) > #if defined(HAVE_COMPAT_LIBGDBM) > dbm = gdbm_open (mappath, 0, GDBM_READER, 0600, NULL); > #elif defined(HAVE_NDBM) >- dbm = dbm_open (mappath, O_CREAT | O_RDWR, 0600); >+ dbm = dbm_open (mappath, O_RDONLY, 0600); > #elif defined(HAVE_LIBTC) > dbm = tcbdbnew(); >- if (!tcbdbopen(dbm, mappath, BDBOWRITER | BDBOCREAT)) >+ if (!tcbdbopen(dbm, mappath, BDBOREADER)) > { > tcbdbdel(dbm); > dbm = NULL; >@@ -302,6 +302,7 @@ get_dbm_entry (char *key) > if (dbm == NULL) > { > log_msg ("YPPUSH: Cannot open %s", mappath); >+ log_msg ("YPPUSH: consider rebuilding maps using ypinit"); > exit (1); > } > >diff -up ypserv-2.29/ypxfr/ypxfr.c.dbopen ypserv-2.29/ypxfr/ypxfr.c >--- ypserv-2.29/ypxfr/ypxfr.c.dbopen 2013-01-23 16:11:32.068224183 +0100 >+++ ypserv-2.29/ypxfr/ypxfr.c 2013-01-23 16:14:05.895213665 +0100 >@@ -557,10 +557,10 @@ ypxfr (char *map, char *source_host, cha > #if defined(HAVE_COMPAT_LIBGDBM) > dbm = gdbm_open (dbName_orig, 0, GDBM_READER, 0600, NULL); > #elif defined(HAVE_NDBM) >- dbm = dbm_open (dbName_orig, O_CREAT|O_RDWR, 0600); >+ dbm = dbm_open (dbName_orig, O_RDONLY, 0600); > #elif defined(HAVE_LIBTC) > dbm = tcbdbnew (); >- if (!tcbdbopen (dbm, dbName_orig, BDBOWRITER | BDBOCREAT)) >+ if (!tcbdbopen (dbm, dbName_orig, BDBOREADER)) > { > tcbdbdel (dbm); > dbm = NULL; >@@ -629,7 +629,7 @@ ypxfr (char *map, char *source_host, cha > dbm = dbm_open (dbName_temp, O_CREAT|O_RDWR, 0600); > #elif defined(HAVE_LIBTC) > dbm = tcbdbnew (); >- if (!tcbdbopen (dbm, dbName_orig, BDBOWRITER | BDBOCREAT)) >+ if (!tcbdbopen (dbm, dbName_orig, BDBOWRITER | BDBOCREAT | BDBOTRUNC)) > { > tcbdbdel (dbm); > dbm = NULL; >@@ -782,7 +782,12 @@ ypxfr (char *map, char *source_host, cha > } > > if (result == 0) >- rename (dbName_temp, dbName_orig); >+ { >+#if defined(HAVE_LIBTC) >+ chmod(dbName_temp, S_IRUSR|S_IWUSR); >+#endif >+ rename (dbName_temp, dbName_orig); >+ } > else > unlink(dbName_temp); >
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 896612
: 686003