The Samba-Bugzilla – Attachment 4226 Details for
Bug 6426
Check for user's existence and valid uid/gid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
check negative uid/gid
testparm.diff (text/plain), 1.72 KB, created by
Zhou Weikuan
on 2009-06-01 03:53:59 UTC
(
hide
)
Description:
check negative uid/gid
Filename:
MIME Type:
Creator:
Zhou Weikuan
Created:
2009-06-01 03:53:59 UTC
Size:
1.72 KB
patch
obsolete
>diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c >index e8458fd..f96400d 100644 >--- a/source3/utils/testparm.c >+++ b/source3/utils/testparm.c >@@ -33,6 +33,34 @@ > > #include "includes.h" > >+#if defined(HPUX) >+/***************************************************** >+ Prevent uid and gid from negative numbers >+ If found invallid uid/gid for guest account, return 1. >+ Otherwise return 0. >+ *****************************************************/ >+int check_valid_guestaccount() >+{ >+ struct passwd *pw; >+ fstring guser; >+ int ret=0; >+ >+ fstrcpy(guser,lp_guestaccount()); >+ pw=sys_getpwnam(guser); >+ >+ if (!pw) { >+ fprintf(stderr, "ERROR: Not found the user %s as guest account from /etc/passwd\n", guser); >+ ret = 1; >+ } else { >+ if ( pw->pw_uid < 0 || pw->pw_gid < 0 ) { >+ fprintf(stderr, "ERROR: Invalid uid/gid as guest account = %s on global due to nagetive values\n", guser); >+ ret = 1; >+ } >+ } >+ return ret; >+} >+#endif >+ > extern bool AllowDebugChange; > > /*********************************************** >@@ -211,6 +239,21 @@ via the %%o substitution. With encrypted passwords this is not possible.\n", lp_ > } > #endif > >+#if defined(HPUX) >+ /* >+ * Protect the valid user as guest account from negative uid and gid. >+ * When guest account is set to a user with negative uid or gid, >+ * we suggest Administrator to use smbnull as guest account for HP_UX >+ * in smb.conf. >+ */ >+ if (check_valid_guestaccount()) >+ { >+ fprintf(stderr, "Recommend: Please use smbnull as guest account on [global]\n"); >+ fprintf(stderr, " or change invalid uid/gid to positive numbers.\n\n"); >+ ret = 1; >+ } >+#endif /* HPUX */ >+ > if (!lp_passdb_backend()) { > fprintf(stderr,"ERROR: passdb backend must have a value or be left out\n"); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 6426
: 4226