search for: value_len

Displaying 20 results from an estimated 58 matches for "value_len".

2014 Feb 04
2
Re: [PATCH 2/3] New API: part-get-name (RHBZ#593511).
On Tue, Feb 04, 2014 at 04:01:32PM +0100, Pino Toscano wrote: > +static char * > +extract_optionally_quoted (const char *value) > +{ > + size_t value_len = strlen (value); > + > + if (value_len >= 2 && > + ((value[0] == '\'' && value[value_len - 1] == '\'') || > + (value[0] == '"' && value[value_len - 1] == '"'))) { > + value_len -= 2; > +...
2014 Feb 04
6
[PATCH 0/3] virt-resize: preserve GPT partitions label
Hi, attached there are few patches to implement a way to get the label of GPT partitions (refactoring an existing function and adding a new daemon API) and using it in virt-resize to restore them when copying partitions. Thanks, Pino Toscano (3): daemon: parted: refactor sgdisk info parsing code New API: part-get-name (RHBZ#593511). resize: preserve GPT partition names (RHBZ#1060404).
2014 Feb 04
0
[PATCH 1/3] daemon: parted: refactor sgdisk info parsing code
...d, fieldlen) == 0) { -#undef SEARCH /* The value starts after the colon */ char *value = colon + 1; /* Skip any leading whitespace */ value += strspn (value, " \t"); - /* The value contains only valid GUID characters */ - size_t value_len = strspn (value, "-0123456789ABCDEF"); - - char *ret = malloc (value_len + 1); + /* Extract the actual information from the field. */ + char *ret = extract (value); if (ret == NULL) { - reply_with_perror ("malloc"); + /* The extrac...
2009 Mar 09
4
[PATCH] ocfs2: Use xs->bucket to set xattr value outside.
...1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index f1b9af1..503a1d7 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -4795,19 +4795,34 @@ static int ocfs2_xattr_bucket_set_value_outside(struct inode *inode, char *val, int value_len) { - int offset; + int ret, offset, block_off; struct ocfs2_xattr_value_root *xv; struct ocfs2_xattr_entry *xe = xs->here; + struct ocfs2_xattr_bucket *bucket = xs->bucket; + struct ocfs2_xattr_header *xh = bucket_xh(bucket); + void *base; BUG_ON(!xs->base || !xe || ocfs2_xattr_is...
2009 Feb 11
2
[PATCH 0/2] ocfs2: two fixes for xattr
Hi, For EAs data structure in inode/block are little different from them in bucket. These two patches try to make them same for the most part. The first patch set xh_free_start and xh_name_value_len when EAs in inode/block. xh_free_start is useful to keep the minimum offset of the xattr name/value. But xh_name_value_len is not very useful because we don't have "hole" when EAs in inode/block, we just calculate and set it here, maybe it's useful for fsck. The second patch re...
2005 Jan 06
0
[2.6 patch] fs/ext3/: possible cleanups
...ode *inode, int name_index, const char *name, int *free) { @@ -698,7 +698,7 @@ * * this routine add/remove/replace attribute in inode body */ -int +static int ext3_xattr_ibody_set(handle_t *handle, struct inode *inode, int name_index, const char *name, const void *value, size_t value_len, int flags) @@ -846,112 +846,11 @@ } /* - * ext3_xattr_set_handle() - * - * Create, replace or remove an extended attribute for this inode. Buffer - * is NULL to remove an existing extended attribute, and non-NULL to - * either replace an existing extended attribute, or create a new ex...
2009 Feb 16
3
[PATCH 0/2] ocfs2: two fixes for xattr -v2
...n version 1 patches. These two patches based on the latest main line kernel. Thanks, tiger > For EAs data structure in inode/block are little different from them in > bucket. These two patches try to make them same for the most part. > > The first patch set xh_free_start and xh_name_value_len when EAs in > inode/block. xh_free_start is useful to keep the minimum offset of the > xattr name/value. But xh_name_value_len is not very useful because we > don't have "hole" when EAs in inode/block, we just calculate and set it > here, maybe it's useful for fsck....
2015 Sep 09
2
[PATCH] inspect: try to use /etc/os-release on Linux guests
...asonably large (%" PRIi64 " bytes)"), + filename, size); + return -1; + } + + lines = guestfs_read_lines (g, filename); + if (lines == NULL) + return -1; + + for (i = 0; lines[i] != NULL; ++i) { + const char *line = lines[i]; + const char *value; + size_t value_len; + + if (line[0] == '#') + continue; + + value = strchr (line, '='); + if (value == NULL) + continue; + + ++value; + value_len = strlen (line) - (value - line); + if (value_len > 1 && value[0] == '"' && value[value_len-1] =...
2014 Feb 04
0
[PATCH 2/3] New API: part-get-name (RHBZ#593511).
...insertions(+), 1 deletion(-) diff --git a/daemon/parted.c b/daemon/parted.c index 5282adb..83f2411 100644 --- a/daemon/parted.c +++ b/daemon/parted.c @@ -886,9 +886,42 @@ extract_uuid (const char *value) return ret; } +static char * +extract_optionally_quoted (const char *value) +{ + size_t value_len = strlen (value); + + if (value_len >= 2 && + ((value[0] == '\'' && value[value_len - 1] == '\'') || + (value[0] == '"' && value[value_len - 1] == '"'))) { + value_len -= 2; + ++value; + } + + char *ret...
2014 Feb 04
0
Re: [PATCH 2/3] New API: part-get-name (RHBZ#593511).
On Tuesday 04 February 2014 15:59:36 Richard W.M. Jones wrote: > On Tue, Feb 04, 2014 at 04:01:32PM +0100, Pino Toscano wrote: > > +static char * > > +extract_optionally_quoted (const char *value) > > +{ > > + size_t value_len = strlen (value); > > + > > + if (value_len >= 2 && > > + ((value[0] == '\'' && value[value_len - 1] == '\'') || > > + (value[0] == '"' && value[value_len - 1] == '"'))) { > > +...
2023 Jan 10
3
[PATCH v7 2/6] ocfs2: Switch to security_inode_init_security()
...xattrs(struct inode *inode, const struct xattr *xattr_array, > void *fs_info) > { > + struct ocfs2_security_xattr_info *si = fs_info; > const struct xattr *xattr; > int err = 0; > > + if (si) { > + si->value = kmemdup(xattr_array->value, xattr_array->value_len, > + GFP_KERNEL); > + if (!si->value) > + return -ENOMEM; > + > + si->name = xattr_array->name; > + si->value_len = xattr_array->value_len; > + return 0; > + } > + > for (xattr = xattr_array; xattr->name != NULL; xattr++) { > err...
2015 Oct 09
1
[PATCH] inspect: Don't free uninitialized string.
...c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index cda1b5d..3d19276 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -232,7 +232,6 @@ parse_os_release (guestfs_h *g, struct inspect_fs *fs, const char *filename) char buf[value_len + 1]; snprintf (buf, sizeof buf, "%*s", (int) value_len, value); major_version = guestfs_int_parse_unsigned_int (g, buf); - free (major); /* Handle cases where VERSION_ID is not a number. */ if (major_version != -1) minor_version = 0;...
2013 Sep 24
1
imaptest-20130617 seems to be reporting spurious header changes
...client_state_error(client, "%s: Header %s changed '%.*s' (len %d) -> '%.*\ s' (len %d)", msg->message_id, fetch_headers[i].name, (int)orig_headers[j].value_len, (const char *)orig_headers[j].value, (int)orig_headers[j].value_len, (int)fetch_headers[i].value_len, (const char *)fetch_headers[i].value,...
2012 Dec 14
1
[PATCH] Add support for getting and setting GPT partition type GUIDs
...len(SEARCH)) == 0) + { +#undef SEARCH + /* The value starts after the colon */ + char *value = colon + 1; + + /* Skip any leading whitespace */ + value += strspn (value, " \t"); + + /* The value contains only valid GUID characters */ + size_t value_len = strspn (value, "-0123456789ABCDEF"); +fprintf(stderr, "%zi: %s\n", value_len, value); + + char *ret = malloc (value_len + 1); + if (ret == NULL) { + reply_with_perror ("malloc"); + return NULL; + } + + memcpy (ret, value,...
2023 Feb 21
0
[PATCH v7 2/6] ocfs2: Switch to security_inode_init_security()
...void *fs_info) > > > { > > > + struct ocfs2_security_xattr_info *si = fs_info; > > > const struct xattr *xattr; > > > int err = 0; > > > > > > + if (si) { > > > + si->value = kmemdup(xattr_array->value, xattr_array->value_len, > > > + GFP_KERNEL); > > > + if (!si->value) > > > + return -ENOMEM; > > > + > > > + si->name = xattr_array->name; > > > + si->value_len = xattr_array->value_len; > > > + return 0; > > > + } > &g...
2011 May 16
0
[PATCH v5 12/21] evm: add evm_inode_post_init call in btrfs
...+ struct xattr lsm_xattr; + struct xattr evm_xattr; char *name; - err = security_inode_init_security(inode, dir, qstr, &suffix, &value, - &len); + err = security_inode_init_security(inode, dir, qstr, &lsm_xattr.name, + &lsm_xattr.value, + &lsm_xattr.value_len); if (err) { if (err == -EOPNOTSUPP) return 0; return err; } - name = kmalloc(XATTR_SECURITY_PREFIX_LEN + strlen(suffix) + 1, + name = kmalloc(XATTR_SECURITY_PREFIX_LEN + strlen(lsm_xattr.name) + 1, GFP_NOFS); if (!name) { err = -ENOMEM; } else { strcpy(name, XAT...
2011 Jun 02
0
[PATCH v6 11/20] evm: add evm_inode_post_init call in btrfs
...+ struct xattr lsm_xattr; + struct xattr evm_xattr; char *name; - err = security_inode_init_security(inode, dir, qstr, &suffix, &value, - &len); + err = security_inode_init_security(inode, dir, qstr, &lsm_xattr.name, + &lsm_xattr.value, + &lsm_xattr.value_len); if (err) { if (err == -EOPNOTSUPP) return 0; return err; } - name = kmalloc(XATTR_SECURITY_PREFIX_LEN + strlen(suffix) + 1, + name = kmalloc(XATTR_SECURITY_PREFIX_LEN + strlen(lsm_xattr.name) + 1, GFP_NOFS); if (!name) { err = -ENOMEM; } else { strcpy(name, XAT...
2023 Mar 14
2
[PATCH v8 2/6] ocfs2: Switch to security_inode_init_security()
...handler *handler, static int ocfs2_initxattrs(struct inode *inode, const struct xattr *xattr_array, void *fs_info) { + struct ocfs2_security_xattr_info *si = fs_info; const struct xattr *xattr; int err = 0; + if (si) { + si->value = kmemdup(xattr_array->value, xattr_array->value_len, + GFP_KERNEL); + if (!si->value) + return -ENOMEM; + + si->name = xattr_array->name; + si->value_len = xattr_array->value_len; + return 0; + } + for (xattr = xattr_array; xattr->name != NULL; xattr++) { err = ocfs2_xattr_set(inode, OCFS2_XATTR_INDEX_SECURITY,...
2008 Oct 27
3
ocfs2: add security EA support v4
Hi, I split the previous support security EA patch into four patches for review. Them besed on joel's xattr-28 branch and tao's patch "Merge xattr set transaction". 1: move new_inode out of the transaction. 2: add ocfs2_xattr_set_handle. 3: add security xattr APIs 4: add init_security in mknod. Best regards, tiger
2009 Feb 08
1
[PATCH] ocfs2/security: Check xattr support in security_init.
..._security_get(struct inode *inode, struct inode *dir, struct ocfs2_security_xattr_info *si) { + if (!ocfs2_supports_xattr(OCFS2_SB(inode->i_sb))) + return -EOPNOTSUPP; + return security_inode_init_security(inode, dir, &si->name, &si->value, &si->value_len); } -- 1.5.4.4