summaryrefslogtreecommitdiffstats
path: root/source/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-11-06 18:40:51 +0000
committerJeremy Allison <jra@samba.org>1998-11-06 18:40:51 +0000
commitb5981c0149ad8c6f13ea87db450080616538b5d5 (patch)
tree14d0b867ac3230a6dfdd8cf7214381aa75ce9eb0 /source/utils
parent222829885cba9ccb8af0e9df232fd5d614cec1ad (diff)
downloadsamba-b5981c0149ad8c6f13ea87db450080616538b5d5.tar.gz
samba-b5981c0149ad8c6f13ea87db450080616538b5d5.tar.xz
samba-b5981c0149ad8c6f13ea87db450080616538b5d5.zip
lib/charcnv.c: Improved debug comment.
libsmb/namequery.c: Fix to remove 2 second wait is we are doing a unicast and got a reply. smbd/dfree.c: smbd/noquotas.c: smbd/quotas.c: Fixes from Dejan Ilic <svedja@lysator.liu.se> for the quota code. utils/smbpasswd.c: Fixes to allow smbpasswd to be called from swat. Jeremy.
Diffstat (limited to 'source/utils')
-rw-r--r--source/utils/smbpasswd.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/utils/smbpasswd.c b/source/utils/smbpasswd.c
index 2d4ce319e84..147e3492af2 100644
--- a/source/utils/smbpasswd.c
+++ b/source/utils/smbpasswd.c
@@ -191,7 +191,8 @@ int main(int argc, char **argv)
extern char *optarg;
extern int optind;
extern int DEBUGLEVEL;
- int real_uid;
+ uid_t real_uid;
+ uid_t eff_uid;
struct passwd *pwd = NULL;
fstring old_passwd;
fstring new_passwd;
@@ -217,7 +218,7 @@ int main(int argc, char **argv)
char *new_domain = NULL;
pstring servicesf = CONFIGFILE;
void *vp;
- struct nmb_name calling, called;
+ struct nmb_name calling, called;
new_passwd[0] = '\0';
@@ -265,16 +266,17 @@ int main(int argc, char **argv)
codepage_initialise(lp_client_code_page());
- /* Get the real uid */
+ /* Get the real and effective uids */
real_uid = getuid();
-
+ eff_uid = geteuid();
+
/* Check the effective uid */
- if ((geteuid() == 0) && (real_uid != 0)) {
+ if ((eff_uid == (uid_t)0) && (real_uid != (uid_t)0)) {
fprintf(stderr, "%s: Must *NOT* be setuid root.\n", prog_name);
exit(1);
}
- is_root = (real_uid == 0);
+ is_root = (eff_uid == (uid_t)0);
while ((ch = getopt(argc, argv, "adehmnj:r:sR:D:U:")) != EOF) {
switch(ch) {
@@ -434,7 +436,7 @@ int main(int argc, char **argv)
exit(1);
}
} else {
- if((pwd = getpwuid(real_uid)) != NULL)
+ if((pwd = getpwuid(eff_uid)) != NULL)
pstrcpy( user_name, pwd->pw_name);
}
@@ -463,7 +465,7 @@ int main(int argc, char **argv)
got_new_pass = True;
}
- if(!remote_user_name && ((pwd = getpwuid(real_uid)) != NULL))
+ if(!remote_user_name && ((pwd = getpwuid(eff_uid)) != NULL))
pstrcpy( user_name, pwd->pw_name);
/*