Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\common.c Create Date:2022-07-28 19:34:31
Last Modify:2020-03-18 09:15:18 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:moyo_write_profile - Write profile table.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.

Proto:static int tomoyo_write_profile(struct tomoyo_io_buffer *head)

Type:int

Parameter:

TypeParameterName
struct tomoyo_io_buffer *head
676  data = Buffer for writing.
681  If sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments == 1 Then Return 0
684  i = simple_strtoul - convert a string to an unsigned long*@cp: The start of the string*@endp: A pointer to the end of the parsed string will be placed here*@base: The number base to use* This function is obsolete. Please use kstrtoul instead.
685  If cp != '-' Then Return -EINVAL
687  data = cp + 1
688  profile = moyo_assign_profile - Create a new profile.*@ns: Pointer to "struct tomoyo_policy_namespace".*@profile: Profile number to create.* Returns pointer to "struct tomoyo_profile" on success, NULL otherwise.
689  If Not profile Then Return -EINVAL
691  cp = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
692  If Not cp Then Return -EINVAL
694  cp++ = '\0'
695  If Not strcmp(data, "COMMENT") Then
696  DEFINE_SPINLOCK(lock)
697  new_comment = tomoyo_get_name(cp)
701  If Not new_comment Then Return -ENOMEM
703  spin_lock( & lock)
704  old_comment = comment
705  comment = new_comment
706  spin_unlock( & lock)
707  moyo_put_name - Drop reference on "struct tomoyo_name".*@name: Pointer to "struct tomoyo_path_info". Maybe NULL.* Returns nothing.
708  Return 0
710  If Not strcmp(data, "PREFERENCE") Then
711  When i < TOMOYO_MAX_PREF cycle moyo_set_uint - Set value for specified preference.*@i: Pointer to "unsigned int".*@string: String to check.*@find: Name of keyword.* Returns nothing.
714  Return 0
716  Return moyo_set_mode - Set mode for specified profile.*@name: Name of functionality.*@value: Mode for @name.*@profile: Pointer to "struct tomoyo_profile".* Returns 0 on success, negative value otherwise.