Changeset 481 for trunk/src/trustfile.c
- Timestamp:
- Jul 18, 2015, 5:06:52 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/trustfile.c
r474 r481 102 102 103 103 104 #if ndef TRUST_MAIN104 #if !defined(TRUST_MAIN) 105 105 106 106 #include "slib.h" … … 121 121 122 122 #define TRUST_DEBUG 123 #define S L_FALSE 0124 #define S L_TRUE 1123 #define S_FALSE 0 124 #define S_TRUE 1 125 125 #define SL_ENTER(string) 126 126 #define SL_IRETURN(a, b) return a … … 222 222 223 223 uid_t tf_euid = tf_uid_neg; 224 int EUIDSLOT = sizeof(test_rootonly)/sizeof(uid_t);225 int ORIG_EUIDSLOT = sizeof(test_rootonly)/sizeof(uid_t);224 unsigned int EUIDSLOT = sizeof(test_rootonly)/sizeof(uid_t); 225 unsigned int ORIG_EUIDSLOT = sizeof(test_rootonly)/sizeof(uid_t); 226 226 227 227 char tf_path[MAXFILENAME]; /* error path for trust function */ … … 381 381 SL_ENTER(_("isin")); 382 382 if (list == NULL) 383 SL_IRETURN(S L_FALSE, _("isin"));383 SL_IRETURN(S_FALSE, _("isin")); 384 384 385 385 while(*list != tf_uid_neg && *list != n) … … 400 400 (UID_CAST) n); 401 401 #endif 402 SL_IRETURN(S L_FALSE, _("isin"));402 SL_IRETURN(S_FALSE, _("isin")); 403 403 } 404 404 … … 408 408 (UID_CAST)n, (UID_CAST)*list); 409 409 #endif 410 SL_IRETURN(S L_TRUE, _("isin"));410 SL_IRETURN(S_TRUE, _("isin")); 411 411 } 412 412 … … 506 506 if (pbuffer) free(pbuffer); 507 507 #endif 508 SL_IRETURN(S L_FALSE, _("isingrp"));508 SL_IRETURN(S_FALSE, _("isingrp")); 509 509 510 510 end_true: … … 513 513 if (pbuffer) free(pbuffer); 514 514 #endif 515 SL_IRETURN(S L_TRUE, _("isingrp"));515 SL_IRETURN(S_TRUE, _("isingrp")); 516 516 } 517 517 … … 537 537 #endif 538 538 539 int retval = S L_FALSE;539 int retval = S_FALSE; 540 540 541 541 SL_ENTER(_("onlytrustedingrp")); … … 567 567 (UID_CAST)grp); 568 568 #endif 569 retval = S L_FALSE;569 retval = S_FALSE; 570 570 goto end_retval; 571 571 } … … 574 574 575 575 if(g->gr_mem == NULL || g->gr_mem[0] == NULL ) 576 SL_IRETURN(S L_TRUE, _("onlytrustedingrp") );576 SL_IRETURN(S_TRUE, _("onlytrustedingrp") ); 577 577 */ 578 578 … … 640 640 #endif 641 641 tf_baduid = w->pw_uid; 642 retval = S L_FALSE;642 retval = S_FALSE; 643 643 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) 644 644 if (pbuffer) free(pbuffer); … … 698 698 #endif 699 699 tf_baduid = w->pw_uid; 700 retval = S L_FALSE;700 retval = S_FALSE; 701 701 goto out; 702 /* SL_IRETURN(S L_FALSE, _("onlytrustedingrp")); */703 } 704 } 705 } 706 retval = S L_TRUE;702 /* SL_IRETURN(S_FALSE, _("onlytrustedingrp")); */ 703 } 704 } 705 } 706 retval = S_TRUE; 707 707 708 708 out: … … 720 720 721 721 #ifdef TRUST_DEBUG 722 if (retval == S L_TRUE)722 if (retval == S_TRUE) 723 723 fprintf(stderr, 724 724 "trustfile: group %ld: all members are trusted users --> OK\n", … … 849 849 char * csym; /* contents of symlink file */ 850 850 char * full; /* "full" name of symlink */ 851 register char *b, *t; /* used to copy stuff around */ 852 register int lsym; /* num chars in symlink ref */ 853 register int i; /* trustworthy or not? */ 851 char *b; /* used to copy stuff around */ 852 const char *t; /* used to copy stuff around */ 853 int lsym; /* num chars in symlink ref */ 854 int i; /* trustworthy or not? */ 854 855 const char * t_const; 855 856 char *end; … … 915 916 /* smack on the /../ 916 917 */ 917 t_const = "/../"; t = (c har *)t_const;918 t_const = "/../"; t = (const char *)t_const; 918 919 while(*t && b < end) 919 920 *b++ = *t++; … … 997 998 * file regardless of permissions, so bomb 998 999 */ 999 if (((okusers != NULL && S L_FALSE == isin((uid_t)stbuf.st_uid,okusers))||1000 (badusers != NULL && S L_TRUE == isin((uid_t)stbuf.st_uid,badusers))))1000 if (((okusers != NULL && S_FALSE == isin((uid_t)stbuf.st_uid,okusers))|| 1001 (badusers != NULL && S_TRUE == isin((uid_t)stbuf.st_uid,badusers)))) 1001 1002 { 1002 1003 #ifdef TRUST_DEBUG
Note:
See TracChangeset
for help on using the changeset viewer.