mac.c (391b1d758dcc162c1ce1544d0708c768b69510fb) | mac.c (4bae1674ce22d73383ff03c86d26b9ceacab8bc9) |
---|---|
1/* 2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed by Robert Watson for the TrustedBSD Project. 7 * 8 * This software was developed for the FreeBSD Project in part by NAI Labs, --- 228 unchanged lines hidden (view full) --- 237 } 238 239 (*mac)->m_buflen = strlen((*mac)->m_string)+1; 240 241 return (0); 242} 243 244int | 1/* 2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed by Robert Watson for the TrustedBSD Project. 7 * 8 * This software was developed for the FreeBSD Project in part by NAI Labs, --- 228 unchanged lines hidden (view full) --- 237 } 238 239 (*mac)->m_buflen = strlen((*mac)->m_string)+1; 240 241 return (0); 242} 243 244int |
245mac_to_text(struct mac *mac, char **text) 246{ 247 248 *text = strdup(mac->m_string); 249 if (*text == NULL) 250 return (ENOMEM); 251 return (0); 252} 253 254int |
|
245mac_prepare(struct mac **mac, char *elements) 246{ 247 struct mac *temp; 248 249 if (strlen(elements) >= MAC_MAX_LABEL_BUF_LEN) 250 return (EINVAL); 251 252 *mac = (struct mac *) malloc(sizeof(**mac)); --- 9 unchanged lines hidden (view full) --- 262 263 strcpy((*mac)->m_string, elements); 264 (*mac)->m_buflen = MAC_MAX_LABEL_BUF_LEN; 265 266 return (0); 267} 268 269int | 255mac_prepare(struct mac **mac, char *elements) 256{ 257 struct mac *temp; 258 259 if (strlen(elements) >= MAC_MAX_LABEL_BUF_LEN) 260 return (EINVAL); 261 262 *mac = (struct mac *) malloc(sizeof(**mac)); --- 9 unchanged lines hidden (view full) --- 272 273 strcpy((*mac)->m_string, elements); 274 (*mac)->m_buflen = MAC_MAX_LABEL_BUF_LEN; 275 276 return (0); 277} 278 279int |
270mac_to_text(struct mac *mac, char **text) 271{ 272 273 *text = strdup(mac->m_string); 274 if (*text == NULL) 275 return (ENOMEM); 276 return (0); 277} 278 279int | |
280mac_prepare_file_label(struct mac **mac) 281{ 282 int error; 283 284 error = mac_maybe_init_internal(); 285 if (error != 0) 286 return (error); 287 --- 78 unchanged lines hidden --- | 280mac_prepare_file_label(struct mac **mac) 281{ 282 int error; 283 284 error = mac_maybe_init_internal(); 285 if (error != 0) 286 return (error); 287 --- 78 unchanged lines hidden --- |