GNU bug report logs - #15520
24.3; secrets.el secrets-create-item has wrong dbus arguments (fix included)

Previous Next

Package: emacs;

Reported by: Nicolas Petton <petton.nicolas <at> gmail.com>

Date: Thu, 3 Oct 2013 20:30:08 UTC

Severity: normal

Found in version 24.3

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15520 in the body.
You can then email your comments to 15520 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15520; Package emacs. (Thu, 03 Oct 2013 20:30:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Petton <petton.nicolas <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 03 Oct 2013 20:30:10 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Petton <petton.nicolas <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; secrets.el secrets-create-item has wrong dbus arguments (fix
 included)
Date: Wed, 02 Oct 2013 19:20:06 +0200
In secrets.el, secrets-create-item has the wrong label property for the
created item, and the secret struct is not built correctly.

Here's a new version that fixes the issue.


(defun secrets-create-item (collection item password &rest attributes)
  "Create a new item in COLLECTION with label ITEM and password
PASSWORD.
ATTRIBUTES are key-value pairs set for the created item.  The
keys are keyword symbols, starting with a colon.  Example:

  \(secrets-create-item \"Tramp collection\" \"item\" \"geheim\"
   :method \"sudo\" :user \"joe\" :host \"remote-host\"\)

The object path of the created item is returned."
  (unless (member item (secrets-list-items collection))
    (let ((collection-path (secrets-unlock-collection collection))
	  result props)
      (unless (secrets-empty-path collection-path)
	;; Create attributes list.
	(while (consp (cdr attributes))
	  (unless (keywordp (car attributes))
	    (error 'wrong-type-argument (car attributes)))
	  (setq props (add-to-list
		       'props
		       (list :dict-entry
			     (substring (symbol-name (car attributes)) 1)
			     (cadr attributes))
		       'append)
		attributes (cddr attributes)))
	;; Create the item.
	(setq result
	      (dbus-call-method
	       :session secrets-service collection-path
	       secrets-interface-collection "CreateItem"
	       ;; Properties.
	       (append
		`(:array
		  (:dict-entry "org.freedesktop.Secret.Item.Label" (:variant ,item)))
		(when props
		  `((:dict-entry
		     "org.freedesktop.Secret.Item.Attributes" (:variant ,(append
'(:array) props))))))
	       ;; Secret.
	       `(:struct :object-path ,secrets-session-path
			 ,(dbus-string-to-byte-array "")
			 ,(dbus-string-to-byte-array password)
			 "text/plain")
	       ;; Do not replace. Replace does not seem to work.
	       nil))
	(secrets-prompt (cadr result))
	;; Return the object path.
	(car result)))))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15520; Package emacs. (Fri, 04 Oct 2013 10:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 15520 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Nicolas Petton <petton.nicolas <at> gmail.com>
Cc: 15520 <at> debbugs.gnu.org
Subject: Re: bug#15520: 24.3;
 secrets.el secrets-create-item has wrong dbus arguments (fix included)
Date: Fri, 04 Oct 2013 12:26:12 +0200
Nicolas Petton <petton.nicolas <at> gmail.com> writes:

Hi Nicolas,

> In secrets.el, secrets-create-item has the wrong label property for the
> created item, and the secret struct is not built correctly.
>
> Here's a new version that fixes the issue.

Thanks for the report.

This problem was solved back in June already. That solution ought to be
backwards compatible, because it was due to an interface change of
"org.freedesktop.Secret.Item.CreateItem".

Please check, whether
<http://bzr.savannah.gnu.org/lh/emacs/trunk/download/head:/secrets.el-20100313201810-6s62gy70hbdnhfs1-1/secrets.el>
works for you.

Best regards, Michael.




bug marked as fixed in version 24.4, send any further explanations to 15520 <at> debbugs.gnu.org and Nicolas Petton <petton.nicolas <at> gmail.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 07 Oct 2013 00:33:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 04 Nov 2013 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 251 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.