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 865188 Details for
Bug 1067142
Ownership of /var/lib/dhcpd/dhcpd.leases reverts to root:root on every dhcpd start
[?]
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]
DHCP Paranoia Patch
dhcp-4.1.1-P1-paranoia.patch (text/plain), 3.23 KB, created by
Avram Lubkin
on 2014-02-19 19:27:24 UTC
(
hide
)
Description:
DHCP Paranoia Patch
Filename:
MIME Type:
Creator:
Avram Lubkin
Created:
2014-02-19 19:27:24 UTC
Size:
3.23 KB
patch
obsolete
>--- dhcp-4.1.1-P1/client/dhclient.c.paranoia 2014-02-19 16:53:20.553495677 -0500 >+++ dhcp-4.1.1-P1/client/dhclient.c 2014-02-19 16:54:58.578488835 -0500 >@@ -1760,11 +1760,6 @@ int write_host (host) > return 0; > } > >-void db_startup (testp) >- int testp; >-{ >-} >- > void bootp (packet) > struct packet *packet; > { >--- dhcp-4.1.1-P1/includes/dhcpd.h.paranoia 2014-02-19 16:57:56.871552512 -0500 >+++ dhcp-4.1.1-P1/includes/dhcpd.h 2014-02-19 17:00:37.901499773 -0500 >@@ -2634,7 +2634,11 @@ int write_billing_class PROTO ((struct c > void commit_leases_timeout PROTO ((void *)); > void commit_leases_readerdry(void *); > int commit_leases PROTO ((void)); >+#if defined (PARANOIA) >+void db_startup (int, uid_t, gid_t); >+#else > void db_startup PROTO ((int)); >+#endif /* PARANOIA */ > int new_lease_file PROTO ((void)); > int group_writer (struct group_object *); > int write_ia(const struct ia_xx *); >--- dhcp-4.1.1-P1/server/confpars.c.paranoia 2014-02-19 17:02:15.915505962 -0500 >+++ dhcp-4.1.1-P1/server/confpars.c 2014-02-19 17:05:18.008463186 -0500 >@@ -224,7 +224,11 @@ void trace_conf_input (trace_type_t *tty > } > > if (!leaseconf_initialized && ttype == trace_readleases_type) { >+#if defined (PARANOIA) >+ db_startup (0, 0, 0); >+#else > db_startup (0); >+#endif /* PARANOIA */ > leaseconf_initialized = 1; > postdb_startup (); > } >--- dhcp-4.1.1-P1/server/db.c.paranoia 2014-02-19 17:06:41.262530102 -0500 >+++ dhcp-4.1.1-P1/server/db.c 2014-02-19 17:13:14.948500476 -0500 >@@ -45,6 +45,10 @@ static int counting = 0; > static int count = 0; > TIME write_time; > int lease_file_is_corrupt = 0; >+#if defined (PARANOIA) >+uid_t global_set_uid = 0; >+gid_t global_set_gid = 0; >+#endif /* PARANOIA */ > > /* Write a single binding scope value in parsable format. > */ >@@ -997,8 +1001,11 @@ int commit_leases () > return 1; > } > >-void db_startup (testp) >- int testp; >+#if defined (PARANOIA) >+void db_startup (int testp, uid_t set_uid, gid_t set_gid) >+#else >+void db_startup (int testp) >+#endif /* PARANOIA */ > { > isc_result_t status; > >@@ -1013,6 +1020,11 @@ void db_startup (testp) > } > #endif > >+#if defined (PARANOIA) >+ global_set_uid = set_uid; >+ global_set_gid = set_gid; >+#endif /* PARANOIA */ >+ > #if defined (TRACING) > /* If we're playing back, there is no lease file, so we can't > append it, so we create one immediately (maybe this isn't >@@ -1075,6 +1087,17 @@ int new_lease_file () > log_error ("Can't create new lease file: %m"); > return 0; > } >+ >+#if defined (PARANOIA) >+ if (global_set_uid && !geteuid() && >+ global_set_gid && !getegid()) >+ if (fchown(db_fd, global_set_uid, global_set_gid)) { >+ log_fatal ("Can't chown new lease file: %m"); >+ close(db_fd); >+ goto fdfail; >+ } >+#endif /* PARANOIA */ >+ > if ((new_db_file = fdopen(db_fd, "we")) == NULL) { > log_error("Can't fdopen new lease file: %m"); > close(db_fd); >--- dhcp-4.1.1-P1/server/dhcpd.c.paranoia 2014-02-19 17:22:45.981513677 -0500 >+++ dhcp-4.1.1-P1/server/dhcpd.c 2014-02-19 17:23:55.899492529 -0500 >@@ -684,7 +684,11 @@ main(int argc, char **argv) { > group_write_hook = group_writer; > > /* Start up the database... */ >+#if defined (PARANOIA) >+ db_startup (lftest, set_uid, set_gid); >+#else > db_startup (lftest); >+#endif /* PARANOIA */ > > if (lftest) > exit (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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1067142
: 865188