diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-09-22 17:15:08 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-09-22 17:15:08 +0400 |
commit | 24d25db025ea9525ef47b434f1e54fe84b5ba0dc (patch) | |
tree | c522ad72a9a6e576a8e3f6de2c67fafc5b0ca213 /dladm/debian/patches | |
parent | 006175566a8095c59d27d2e99971a4e937e9397f (diff) | |
download | illumos-packaging-24d25db025ea9525ef47b434f1e54fe84b5ba0dc.tar.gz |
dladm (2.10+1) unstable; urgency=low
* Use native version scheme
* Added libdladm-create-db.patch
* Moved postinst script for /etc/dladm from dladm to libdladm1
Diffstat (limited to 'dladm/debian/patches')
-rw-r--r-- | dladm/debian/patches/libdladm-create-db.patch | 34 | ||||
-rw-r--r-- | dladm/debian/patches/series | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/dladm/debian/patches/libdladm-create-db.patch b/dladm/debian/patches/libdladm-create-db.patch new file mode 100644 index 0000000..fbbb592 --- /dev/null +++ b/dladm/debian/patches/libdladm-create-db.patch @@ -0,0 +1,34 @@ +Description: create file if it does not exist +Index: dladm/usr/src/lib/libdladm/common/libdladm.c +=================================================================== +--- dladm.orig/usr/src/lib/libdladm/common/libdladm.c 2013-09-22 13:11:07.074790424 +0400 ++++ dladm/usr/src/lib/libdladm/common/libdladm.c 2013-09-22 14:39:34.386136565 +0400 +@@ -711,6 +711,7 @@ + char newfile[MAXPATHLEN]; + char *db_basename; + int nfd, lock_fd; ++ int fd; + + /* + * If we are called from a boot script such as net-physical, +@@ -728,7 +729,7 @@ + return (dladm_errno2status(errno)); + + (void) snprintf(file, MAXPATHLEN, "%s/%s", dladm_rootdir, db_file); +- if ((fp = fopen(file, (writeop ? "r+" : "r"))) == NULL) { ++ if ((fd = open(file, (writeop ? O_RDWR | O_CREAT : O_RDONLY), db_perms)) < 0) { + int err = errno; + + i_dladm_unlock_db(lock, lock_fd); +@@ -737,6 +738,11 @@ + + return (dladm_errno2status(err)); + } ++ if ((fp = fdopen(fd, (writeop ? "r+" : "r"))) == NULL) { ++ i_dladm_unlock_db(lock, lock_fd); ++ (void) close(fd); ++ return (dladm_errno2status(errno)); ++ } + + if (writeop) { + (void) snprintf(newfile, MAXPATHLEN, "%s/%s.new", diff --git a/dladm/debian/patches/series b/dladm/debian/patches/series index 94f8646..2411510 100644 --- a/dladm/debian/patches/series +++ b/dladm/debian/patches/series @@ -18,3 +18,4 @@ libdladm-missing-prototypes.patch flowstat-include-time.h.patch flowstat-fprev-may-be-used-uninitialized.patch dlstat-fix-libinetutil-callbacks.patch +libdladm-create-db.patch |